Aloha!
3 jan 2014 kl. 21:27 skrev nisse@lysator.liu.se (Niels Möller):
(3) The SHA-224 H0-table refers to the _SHA256_DIGEST_LENGTH. This imho should be a separate define _SHA224_DIGEST_LENGTH. Yes, it is the same length in practice but it looks weird
Maybe this constant is misnamed. It's the size of the *internal* state, which for sha224 (and sha384) is unrelated to the output digest size. It's defined in the public sha2.h header only because it's the size of the state array in struct sha256_ctx.
Yes, exactly. The name is confusing
And a separate define for sha224 makes little sense, because there is no separate struct sha224_ctx, it's just a #define alias for sha256_ctx.
Clean code. It makes sense because for the user it is a different algorithm even though it shares a lot of the guts with SHA-256. An alias is enough just like a define that actually define the same size of the state. Imho.
Regards, /Niel
-- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance.