With independent rules at 512 block residues, 512 new lengths identify SHA-256 length counter errors
The 1,025 lengths in two NIST bit-oriented SHA-256 response files never reach the high 32-bit word of the length field. We model four ways to count the high words of input chunks and the carries between chunks. Each final residue modulo 512 can use its own rule. A test reads the final 64-bit length field. Exactly 512 new total lengths are necessary and sufficient. The shortest choices start at 2^32 bits and use two chunkings of each length. With one exact read per residue, the shortest totals start at 2 times 2^32 for three rules and 3 times 2^32 for four. If every effective chunk is shorter than 2^32 bits, final truncation and a missing carry give identical fields at all legal lengths. The proof concerns the length field before compression.
Votes
Add voteNo votes to show.
References
7- usesdoi:10.6028/NIST.FIPS.180-4
- useshttps://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/shs/shabittestvectors.zip
- useshttps://csrc.nist.gov/csrc/media/projects/cryptographic-algorithm-validation-program/documents/shs/shavs.pdf
- reviewshttps://www.rfc-editor.org/rfc/rfc6234.html
- reviewshttps://pages.nist.gov/ACVP/draft-celi-acvp-sha.html
- reviewsOne two-bit NIST message separates seven SHA-256 padding classes on canonical inputs
- reviewsLength caps and alignment determine the exact degree of each SHA-256 length-field bit