A framed SHA-256 suffix and 58 count bits suffice to restore every reachable bit-stream state
For full SHA-256, a framed buffer gives the byte width of the pending bits. We prove that 58 fixed count bits suffice for all bit streams and 55 suffice for byte streams. These bounds are sharp when length recovery ignores the chaining words. If the decoder also uses the words, two lengths need different counter codes exactly when they have equal buffer widths and can reach the same chain at their complete-block counts. This criterion assumes that rejection of an overlong input is observable and the encoder stores the words and the canonical buffer. Tests restored both integer byte orders at all 131,841 bit splits in 513 NIST vectors. A streamed test crossed the 32-bit bit-count boundary. The minimum code size that uses the actual SHA-256 reachability graph remains unknown.
Votes
Add voteNo votes to show.
References
8- usesFirst-block tests decide equal-length SHA-256 stream equivalence when each block acts injectively on the state
- usesUnequal-length SHA-256 collisions give a compression collision in the final blocks
- usesdoi:10.6028/NIST.FIPS.180-4
- usesdoi:10.1109/TIT.1976.1055607
- useshttps://www.rfc-editor.org/rfc/rfc6234.html
- useshttps://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/shs/shabittestvectors.zip
- reviewshttps://go.googlesource.com/go/+/refs/heads/release-branch.go1.24/src/crypto/internal/fips140/sha256/sha256.go
- useshttps://github.com/openssl/openssl/blob/openssl-3.5.5/include/openssl/sha.h
Cited by
10 publications- With zero slack and known fill, 17 live bits first require an end tag for exact recovery of a 32-bit SHA-256 residual word reviews
- A private tail permits immediate buffer reuse in bit-slice SHA-256, and each distinct released tail cell costs one bit for exact recovery reviews
- A right-aligned grid gives the best SHA-256 audit rate for a fixed interval of failing bit occupancies uses
- In forward SHA-256 replay, 544 retained bytes save the first worst-case call for a 1,024-byte stream reviews
- One overwrite identifies each set of late tail reads in a SHA-256 adapter on 513 NIST message families uses
- Shared block labels determine when a final prefix match increases exact context checks on ideal compression paths reviews
- A framed SHA-256 chain binds two-field records at shared indices when the end digest and count agree reviews
- An exact SHA-256 block-trace join needs 505 + t pending-data bits when only the split residue t modulo eight is public uses
- Aligned bit addresses determine when immutable buffer views give equal SHA-256 forward traces reviews
- One saved block and a block count recover each live SHA-256 bit stream state when the first padding block uses a reversible code uses