At 32 or 64 bits per word, RISC-V vsha2ch and vsha2cl give the same four words exactly when the two halves of vs1 match
For a legal active group with common inputs, the two RISC-V SHA-2 compression instructions give the same four words exactly when words 0 and 2 agree and words 1 and 3 agree in vs1. This holds for every entry state at word widths 32 and 64. Of the six pairs of output positions, exactly four suffice to check this equality for every input. Each contains one word from each round. A scalar C reference and NIST intermediate states check a packed software model. All 20,872 paired tests passed.
SHA-256 · RISC-V · SHA-512 · instruction equivalence · weakest precondition
Votes
Add voteNo votes to show.
References
6- usesInterleaved SHA-256 gives the sequential digest when each active lane consumes the correct round pair
- useshttps://docs.riscv.org/reference/isa/v20260120/unpriv/vector-crypto.html
- usesdoi:10.6028/NIST.FIPS.180-4
- useshttps://www.intel.com/content/www/us/en/developer/articles/technical/intel-sha-extensions.html
- useshttps://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/SHA256.pdf
- useshttps://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/SHA512.pdf