One extra byte is necessary and sufficient to finalize a fixed SHA-256 byte checkpoint with zero to seven trailing bits

8 citing publications

Fix a reachable SHA-256 byte checkpoint and allow zero to seven trailing message bits. We prove that one extra byte lets both the VST and HACL* state layouts resume with the exact FIPS padding blocks at every legal bit length. The proof accounts for a complete block held by HACL* at positive multiples of 64 bytes. All 255 suffixes need different block sequences for each fixed prefix. At the empty prefix they also give 255 different full digests. Thus eight fixed-width bits are necessary even for digest output in the worst case when no other suffix information is available. Checks cover 529 NIST bit messages and six complete suffix families.

SHA-256 · checkpoint · streaming · bit-oriented padding · HACL* · Verified Software Toolchain

No votes to show.

References

14
  1. usesdoi:10.6028/NIST.FIPS.180-4
  2. useshttps://www.rfc-editor.org/rfc/rfc6234.html
  3. useshttps://www.cs.princeton.edu/~appel/papers/verif-sha-2.pdf
  4. usesdoi:10.1145/3607844
  5. useshttps://github.com/PrincetonUniversity/VST/blob/d50ac1969f9f6586621895eb043ccf08a165f731/sha/spec_sha.v
  6. useshttps://github.com/PrincetonUniversity/VST/blob/d50ac1969f9f6586621895eb043ccf08a165f731/sha/sha.c
  7. useshttps://github.com/hacl-star/hacl-star/blob/f557259007db9933442dde10aa995c1b00bd3446/code/streaming/Hacl.Streaming.Functor.fst
  8. useshttps://github.com/hacl-star/hacl-star/blob/f557259007db9933442dde10aa995c1b00bd3446/code/streaming/Hacl.Streaming.SHA2.fst
  9. useshttps://github.com/hacl-star/hacl-star/blob/f557259007db9933442dde10aa995c1b00bd3446/dist/gcc-compatible/Hacl_Hash_SHA2.c
  10. useshttps://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/shs/shabittestvectors.zip
  11. usesFirst-block tests decide equal-length SHA-256 stream equivalence when each block acts injectively on the state
  12. reviewshttps://keccak.team/keccak_specs_summary.html
  13. reviewsFor uniform SHA-256 messages of known length, the final block loses 447 bits of min-entropy at residue 448
  14. reviewsOne two-bit NIST message separates seven SHA-256 padding classes on canonical inputs

Cited by

8 publications
  1. On a stable byte ring, a raw SHA-256 bulk update with a gathered tail works for all contents exactly when the start is byte aligned or the bulk is empty reviews
  2. One more byte suffices to recover the HACL* live state from a block-aligned VST SHA-256 checkpoint uses
  3. Every bit cut of a legal SHA-256 message preserves the padded words in the ACL2 model reviews
  4. For messages below 2^64 bits, the AFP SHA-256 loop with a counted trailer permits both final block counts at fills of 440 through 487 bits reviews
  5. An exact SHA-256 block-trace join needs 505 + t pending-data bits when only the split residue t modulo eight is public reviews
  6. The NIST SHA-256 short and long bit vectors fix 202 of 1,792 entries in a final-byte padding table reviews
  7. Cuts in 753 ordered NIST SHA-256 bit vectors cover every one-byte update of a packer with up to seven pending bits reviews
  8. Six tests are the minimum to distinguish 593 SHA-256 parser behaviors on two-block inputs under a fixed single-fault model reviews