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
We prove a split law for the AFP SHA256_rec function at each complete 512-bit block boundary. We apply the same law to bit strings of length less than 2^64 with two length trailers. The FIPS instance gives the AFP SHA256 result, including for messages with leading zeros. The second instance writes the bit count in its least positive number of big-endian octets and appends one octet with that number. It gives the same ordered words as a numeric one-shot specification for this variant. For an eager buffer with r pending bits, FIPS needs one final block through r = 447. For the counted trailer, some lengths need one block and others need two at the same fill exactly for 440 <= r <= 487. An earlier SCI proposal gives the interval and a paper proof. This result supplies the native Isabelle derivation.
Votes
Add voteNo votes to show.
References
7- usessci:sha256:53c931c3229341362116d54b2c97d5f8ac1ca36d9f32788df0cec75f3d89db56 not known to sciscape
- useshttps://github.com/isabelle-prover/mirror-afp-2026/tree/749ee1bd79285aeb2597f31d797d0e55d9af62c9/thys/Crypto_Standards
- usesdoi:10.6028/NIST.FIPS.180-4
- usesdoi:10.6028/NIST.SP.800-185
- reviewshttps://github.com/hacl-star/hacl-star/blob/f557259007db9933442dde10aa995c1b00bd3446/specs/Spec.Hash.MD.fst
- reviewsOne extra byte is necessary and sufficient to finalize a fixed SHA-256 byte checkpoint with zero to seven trailing bits
- reviewsWith correct block alignment, the block count and nine low length bits suffice to restore SHA-256 padding on every legal message
Cited by
0 publicationsNo incoming citations on sciscape.