diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-04-12 15:53:39 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-04-12 17:01:10 +0100 |
commit | 02879299c96e02e0ad6093d86b04468ab89d3cfe (patch) | |
tree | 91e9cbd2496a6304d9d5ea92e5bcf72e45aa6c22 /src/include/ipxe/sha512.h | |
parent | 6f713c2d959ab3280afc83e722d6589da2029108 (diff) | |
download | ipxe-02879299c96e02e0ad6093d86b04468ab89d3cfe.tar.gz |
[crypto] Add SHA-384 algorithm
SHA-384 is almost identical to SHA-512, with differing initial hash
values and a truncated output length.
This implementation has been verified using the NIST SHA-384 test
vectors.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/sha512.h')
-rw-r--r-- | src/include/ipxe/sha512.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/ipxe/sha512.h b/src/include/ipxe/sha512.h index 0cfa35b9e..44a4c8309 100644 --- a/src/include/ipxe/sha512.h +++ b/src/include/ipxe/sha512.h @@ -75,6 +75,9 @@ struct sha512_context { /** SHA-512 digest size */ #define SHA512_DIGEST_SIZE sizeof ( struct sha512_digest ) +/** SHA-384 digest size */ +#define SHA384_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 384 / 512 ) + extern void sha512_family_init ( struct sha512_context *context, const struct sha512_digest *init, size_t digestsize ); @@ -82,5 +85,6 @@ extern void sha512_update ( void *ctx, const void *data, size_t len ); extern void sha512_final ( void *ctx, void *out ); extern struct digest_algorithm sha512_algorithm; +extern struct digest_algorithm sha384_algorithm; #endif /* IPXE_SHA512_H */ |