From: Jim Meyering Date: Thu, 31 Jul 2008 13:35:25 +0000 (+0200) Subject: sha256.h: correct definition on SHA224_DIGEST_SIZE X-Git-Tag: v0.1~7175 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=3054279c0cca4c1f9c61997f924685b1d70c2353;p=gnulib.git sha256.h: correct definition on SHA224_DIGEST_SIZE * lib/sha256.h (SHA224_DIGEST_SIZE): Define to 28, not 24. Reported by Paulie Pena IV . Define as 224 / 8, rather than as a literal. (SHA256_DIGEST_SIZE): Define as 256/8 rather than equivalent literal. * lib/sha512.h (SHA384_DIGEST_SIZE): Likewise, define as equiv: 384/8. (SHA512_DIGEST_SIZE): Likewise, define as equivalent quotient: 512/8. --- diff --git a/ChangeLog b/ChangeLog index 792a1ef93..e3d13f184 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-07-31 Jim Meyering + + sha256.h: correct definition of SHA224_DIGEST_SIZE + * lib/sha256.h (SHA224_DIGEST_SIZE): Define to 28, not 24. + Reported by Paulie Pena IV . + Define as 224 / 8, rather than as a literal. + (SHA256_DIGEST_SIZE): Define as 256/8 rather than equivalent literal. + * lib/sha512.h (SHA384_DIGEST_SIZE): Likewise, define as equiv: 384/8. + (SHA512_DIGEST_SIZE): Likewise, define as equivalent quotient: 512/8. + 2008-07-31 Bruno Haible * lib/regex_internal.h (BITSET_WORD_BITS): Make first conditional work diff --git a/lib/sha256.h b/lib/sha256.h index 3aa1ce97b..a63b2015d 100644 --- a/lib/sha256.h +++ b/lib/sha256.h @@ -31,8 +31,8 @@ struct sha256_ctx uint32_t buffer[32]; }; -enum { SHA224_DIGEST_SIZE = 24 }; -enum { SHA256_DIGEST_SIZE = 32 }; +enum { SHA224_DIGEST_SIZE = 224 / 8 }; +enum { SHA256_DIGEST_SIZE = 256 / 8 }; /* Initialize structure containing state of computation. */ extern void sha256_init_ctx (struct sha256_ctx *ctx); diff --git a/lib/sha512.h b/lib/sha512.h index 84fe5591f..ed12d545c 100644 --- a/lib/sha512.h +++ b/lib/sha512.h @@ -32,8 +32,8 @@ struct sha512_ctx u64 buffer[32]; }; -enum { SHA384_DIGEST_SIZE = 48 }; -enum { SHA512_DIGEST_SIZE = 64 }; +enum { SHA384_DIGEST_SIZE = 384 / 8 }; +enum { SHA512_DIGEST_SIZE = 512 / 8 }; /* Initialize structure containing state of computation. */ extern void sha512_init_ctx (struct sha512_ctx *ctx);