diff options
author | Brian Smith <brian@briansmith.org> | 2015-11-01 23:13:24 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-11-03 05:04:38 +0300 |
commit | 00461cf201b66205653fd6159ae260f453738641 (patch) | |
tree | 656151ba243139bf71ee1cfa1712c7fb75ee4c60 /include/openssl/sha.h | |
parent | ecc2591b6cbb376dfa0ea1dfce35f1f172ffd0d5 (diff) |
Improve crypto/digest/md32_common.h mechanism.
The documentation in md32_common.h is now (more) correct with respect
to the most important details of the layout of |HASH_CTX|. The
documentation explaining why sha512.c doesn't use md32_common.h is now
more accurate as well.
Before, the C implementations of HASH_BLOCK_DATA_ORDER took a pointer
to the |HASH_CTX| and the assembly language implementations tool a
pointer to the hash state |h| member of |HASH_CTX|. (This worked
because |h| is always the first member of |HASH_CTX|.) Now, the C
implementations take a pointer directly to |h| too.
The definitions of |MD4_CTX|, |MD5_CTX|, and |SHA1_CTX| were changed to
be consistent with |SHA256_CTX| and |SHA512_CTX| in storing the hash
state in an array. This will break source compatibility with any
external code that accesses the hash state directly, but will not
affect binary compatibility.
The second parameter of |HASH_BLOCK_DATA_ORDER| is now of type
|const uint8_t *|; previously it was |void *| and all implementations
had a |uint8_t *data| variable to access it as an array of bytes.
This change paves the way for future refactorings such as automatically
generating the |*_Init| functions and/or sharing one I-U-F
implementation across all digest algorithms.
Change-Id: I30513bb40b5f1d2c8932551d54073c35484b3f8b
Reviewed-on: https://boringssl-review.googlesource.com/6401
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'include/openssl/sha.h')
-rw-r--r-- | include/openssl/sha.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/openssl/sha.h b/include/openssl/sha.h index ac2ab758..58f5424f 100644 --- a/include/openssl/sha.h +++ b/include/openssl/sha.h @@ -98,7 +98,7 @@ OPENSSL_EXPORT uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out); OPENSSL_EXPORT void SHA1_Transform(SHA_CTX *sha, const uint8_t *block); struct sha_state_st { - uint32_t h0, h1, h2, h3, h4; + uint32_t h[5]; uint32_t Nl, Nh; uint32_t data[16]; unsigned int num; |