Reading — step 1 of 5
Read
~1 min readPutting It Together
Putting It All Together
You've built every piece:
| Layer | Lesson |
|---|---|
| Bit ops + ROTR | 1 |
| Endianness | 2 |
| Constants | 3 |
| Schedule | 4 |
| Compression | 5 |
| Padding | 6 |
| Merkle-Damgård | 7 |
| Test vectors | 8 |
| HMAC | 9 |
What we glossed over:
- SHA-512: same structure but 64-bit words, 80 rounds, different constants.
- SHA-3 / Keccak: completely different (sponge construction).
- BLAKE2/3: faster than SHA-256, similar security; tree mode for parallelism.
- Hardware acceleration: SHA-NI x86 instructions (sha256rnds2, sha256msg1/2) speed it up ~6x. Always-on in modern CPUs.
- Side-channel hardening: SHA itself is constant-time, but key-dependent code paths around it must also be.
Where SHA-256 is used:
- Bitcoin (block headers, mining proof-of-work, transaction IDs)
- Git (object IDs)
- TLS certificates (signature, fingerprint)
- HMAC for API request signing
- Password hashing (NEVER use bare SHA — use bcrypt/scrypt/argon2)
You now understand the function used trillions of times per second worldwide.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…