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

1 citing publication

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

No votes to show.

References

6
  1. usesInterleaved SHA-256 gives the sequential digest when each active lane consumes the correct round pair
  2. useshttps://docs.riscv.org/reference/isa/v20260120/unpriv/vector-crypto.html
  3. usesdoi:10.6028/NIST.FIPS.180-4
  4. useshttps://www.intel.com/content/www/us/en/developer/articles/technical/intel-sha-extensions.html
  5. useshttps://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/SHA256.pdf
  6. useshttps://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/SHA512.pdf

Cited by

1 publication
  1. A bit mask gives the exact number of shared RISC-V SHA-2 destinations for two fixed entry states at 32 or 64 bits per word uses