crypto: sha1 - Wrap library and add HMAC support
authorEric Biggers <ebiggers@kernel.org>
Sat, 12 Jul 2025 23:22:56 +0000 (16:22 -0700)
committerEric Biggers <ebiggers@kernel.org>
Mon, 14 Jul 2025 15:59:20 +0000 (08:59 -0700)
commit8bc79ab67d78e2991b9d6cf0b63789189212375a
treedc491a3a1bf22c8754899d20d50339f1c51b0038
parent4cbc84471bb606ddfaf424709dd8d56b56d7ae7b
crypto: sha1 - Wrap library and add HMAC support

Like I did for crypto/sha512.c, rework crypto/sha1_generic.c (renamed to
crypto/sha1.c) to simply wrap the normal library functions instead of
accessing the low-level block function directly.  Also add support for
HMAC-SHA1, again just wrapping the library functions.

Since the replacement crypto_shash algorithms are implemented using the
(potentially arch-optimized) library functions, give them driver names
ending with "-lib" rather than "-generic".  Update crypto/testmgr.c and
an odd driver to take this change in driver name into account.

Note: to see the diff from crypto/sha1_generic.c to crypto/sha1.c, view
this commit with 'git show -M10'.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250712232329.818226-6-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
crypto/Kconfig
crypto/Makefile
crypto/sha1.c [new file with mode: 0644]
crypto/sha1_generic.c [deleted file]
crypto/testmgr.c
drivers/crypto/img-hash.c