aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/sha512.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2022-10-09 15:14:41 +0100
committerMichael Brown <mcb30@ipxe.org>2022-10-10 12:21:54 +0100
commit007d3cb800fd0e4b01be8a76f0cce2c795cfc89b (patch)
treeb2c065f186542751e784f178a73da8066ab0dc06 /src/include/ipxe/sha512.h
parent88419b608d71247445de287c9f8bebbf5e33e0c8 (diff)
downloadipxe-007d3cb800fd0e4b01be8a76f0cce2c795cfc89b.tar.gz
[crypto] Simplify internal HMAC API
Simplify the internal HMAC API so that the key is provided only at the point of calling hmac_init(), and the (potentially reduced) key is stored as part of the context for later use by hmac_final(). This simplifies the calling code, and avoids the need for callers such as TLS to allocate a potentially variable length block in order to retain a copy of the unmodified key. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/sha512.h')
-rw-r--r--src/include/ipxe/sha512.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/ipxe/sha512.h b/src/include/ipxe/sha512.h
index 8e22d8357..82a9e4e69 100644
--- a/src/include/ipxe/sha512.h
+++ b/src/include/ipxe/sha512.h
@@ -72,6 +72,9 @@ struct sha512_context {
/** SHA-512 context size */
#define SHA512_CTX_SIZE sizeof ( struct sha512_context )
+/** SHA-512 block size */
+#define SHA512_BLOCK_SIZE sizeof ( union sha512_block )
+
/** SHA-512 digest size */
#define SHA512_DIGEST_SIZE sizeof ( struct sha512_digest )