For one 120-byte SHA-256 prefix, caching by length saves 135 additions and 75 small-sigma calls per message after setup
We count the SHA-256 operations that can have one cached value on three domains. Each message starts with the bytes 0 through 119 and ends in one or two arbitrary bytes. We fix the order of binary additions. One cache for both lengths leaves 1083 additions, 152 small-sigma calls and 226 large-sigma calls per message. At either fixed length, 948 additions, 77 small-sigma calls and 226 large-sigma calls remain. The difference comes entirely from the final schedule. For N messages at d distinct lengths, a shared cache with separate final schedules saves 135(N - d) additions and 75(N - d) small-sigma calls including setup, compared with one cache for both lengths. A dependency proof certifies each constant site. Valid message pairs certify each variable site. Two trace programs agree on 515 messages. The counts apply to the specified word operations.
Votes
Add voteNo votes to show.
References
7- doi:10.6028/NIST.FIPS.180-4
- https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/SHA256.pdf
- doi:10.48550/arXiv.1604.00575
- https://patents.google.com/patent/EP4710505A1/en
- doi:10.1080/02533839.2025.2576145
- In a four-suffix SHA-256 test, three-score counts leave the cost per one-bit match between 5.762 and 6.566 compressions
- The SHA-256 schedule has binary affine dimension 1744 for all 32-byte messages with FIPS padding