From e5e91ab47107dde8eb66442cf35722b5c2ee89f9 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 12 Apr 2015 16:34:33 +0100 Subject: [crypto] Add SHA-512/256 algorithm SHA-512/256 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-512/256 test vectors. Signed-off-by: Michael Brown --- src/include/ipxe/sha512.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include/ipxe/sha512.h') diff --git a/src/include/ipxe/sha512.h b/src/include/ipxe/sha512.h index 44a4c8309..8e9892bfb 100644 --- a/src/include/ipxe/sha512.h +++ b/src/include/ipxe/sha512.h @@ -78,6 +78,9 @@ struct sha512_context { /** SHA-384 digest size */ #define SHA384_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 384 / 512 ) +/** SHA-512/256 digest size */ +#define SHA512_256_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 256 / 512 ) + extern void sha512_family_init ( struct sha512_context *context, const struct sha512_digest *init, size_t digestsize ); @@ -86,5 +89,6 @@ extern void sha512_final ( void *ctx, void *out ); extern struct digest_algorithm sha512_algorithm; extern struct digest_algorithm sha384_algorithm; +extern struct digest_algorithm sha512_256_algorithm; #endif /* IPXE_SHA512_H */ -- cgit v1.2.3-55-g7522