lib/crypto: sha512: Add HMAC-SHA384 and HMAC-SHA512 support
authorEric Biggers <ebiggers@kernel.org>
Mon, 30 Jun 2025 16:03:07 +0000 (09:03 -0700)
committerEric Biggers <ebiggers@kernel.org>
Mon, 30 Jun 2025 16:26:19 +0000 (09:26 -0700)
commit23e8b4371dbd5907d633262f36903144a378a114
tree708d92da954c07c28f831be6dabd6ba9f380afc4
parentb693c703accb08cbd52f0b94d810d6abbca3bfb9
lib/crypto: sha512: Add HMAC-SHA384 and HMAC-SHA512 support

Since HMAC support is commonly needed and is fairly simple, include it
as a first-class citizen of the SHA-512 library.

The API supports both incremental and one-shot computation, and either
preparing the key ahead of time or just using a raw key.  The
implementation is much more streamlined than crypto/hmac.c.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250630160320.2888-4-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
include/crypto/sha2.h
lib/crypto/Kconfig
lib/crypto/sha512.c