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
A caller can pass whole bytes from a ring to SHA-256 and gather the final partial byte. We prove that this method preserves the ordered padded blocks for every stable ring if and only if the start is byte aligned or the bulk is empty. For a given ring the copied bits must match their shifted positions. On a ring of R independent bits at offset d, exactly min(m, R - gcd(R,d)) independent bit equalities are required, where m is the number of bits read without the shift. The formula includes repeated laps. For serial writes through aliases, we give the exact condition on each physical bit and its version at the time of the read. We check the span and carrier formulas with an SMT solver. The rank agrees with 36,288 finite cases. All 513 NIST short bit messages give the expected full SHA-256 digest at all eight offsets. The converse concerns ordered blocks. It makes no claim about collisions.
Votes
Add voteNo votes to show.
References
9- usesAligned bit addresses determine when immutable buffer views give equal SHA-256 forward traces
- reviewsA private tail permits immediate buffer reuse in bit-slice SHA-256, and each distinct released tail cell costs one bit for exact recovery
- reviewsOne extra byte is necessary and sufficient to finalize a fixed SHA-256 byte checkpoint with zero to seven trailing bits
- usesdoi:10.6028/NIST.FIPS.180-4
- useshttps://www.rfc-editor.org/rfc/rfc6234.html
- reviewshttps://docs.kernel.org/core-api/circular-buffers.html
- reviewshttps://www.cs.princeton.edu/~appel/papers/verif-sha-2.pdf
- reviewsdoi:10.1145/3607844
- useshttps://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/shs/shabittestvectors.zip
Cited by
0 publicationsNo incoming citations on sciscape.