summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/sha512.h
diff options
context:
space:
mode:
authorMichael Brown2015-04-12 17:57:25 +0200
committerMichael Brown2015-04-12 18:02:11 +0200
commitea3d5875cd8881273e02c3a0e70c7fe4317123f7 (patch)
tree32dce14fa536551ee84cbcf2fe044277d2aace64 /src/include/ipxe/sha512.h
parent[crypto] Add SHA-512/256 algorithm (diff)
downloadipxe-ea3d5875cd8881273e02c3a0e70c7fe4317123f7.tar.gz
ipxe-ea3d5875cd8881273e02c3a0e70c7fe4317123f7.tar.xz
ipxe-ea3d5875cd8881273e02c3a0e70c7fe4317123f7.zip
[crypto] Add SHA-512/224 algorithm
SHA-512/224 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/224 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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/ipxe/sha512.h b/src/include/ipxe/sha512.h
index 8e9892bfb..8e22d8357 100644
--- a/src/include/ipxe/sha512.h
+++ b/src/include/ipxe/sha512.h
@@ -81,6 +81,9 @@ struct sha512_context {
/** SHA-512/256 digest size */
#define SHA512_256_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 256 / 512 )
+/** SHA-512/224 digest size */
+#define SHA512_224_DIGEST_SIZE ( SHA512_DIGEST_SIZE * 224 / 512 )
+
extern void sha512_family_init ( struct sha512_context *context,
const struct sha512_digest *init,
size_t digestsize );
@@ -90,5 +93,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;
+extern struct digest_algorithm sha512_224_algorithm;
#endif /* IPXE_SHA512_H */