Mercurial > hg > octave-lyh > gnulib-hg
changeset 10295:f265e54053d2
sha256.h: correct definition on SHA224_DIGEST_SIZE
* lib/sha256.h (SHA224_DIGEST_SIZE): Define to 28, not 24.
Reported by Paulie Pena IV <paulie4@gmail.com>.
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.
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Thu, 31 Jul 2008 15:35:25 +0200 |
parents | 8fd1a5ad043a |
children | 06a4179ed804 |
files | ChangeLog lib/sha256.h lib/sha512.h |
diffstat | 3 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-07-31 Jim Meyering <meyering@redhat.com> + + sha256.h: correct definition of SHA224_DIGEST_SIZE + * lib/sha256.h (SHA224_DIGEST_SIZE): Define to 28, not 24. + Reported by Paulie Pena IV <paulie4@gmail.com>. + 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 <bruno@clisp.org> * lib/regex_internal.h (BITSET_WORD_BITS): Make first conditional work
--- a/lib/sha256.h +++ b/lib/sha256.h @@ -31,8 +31,8 @@ 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);
--- a/lib/sha512.h +++ b/lib/sha512.h @@ -32,8 +32,8 @@ 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);