]> git.ipfire.org Git - thirdparty/linux.git/commit
lib/crypto: arm/sha1: Migrate optimized code into library
authorEric Biggers <ebiggers@kernel.org>
Sat, 12 Jul 2025 23:22:58 +0000 (16:22 -0700)
committerEric Biggers <ebiggers@kernel.org>
Mon, 14 Jul 2025 18:11:29 +0000 (11:11 -0700)
commit70cb6ca58fddb02e269fe743ba75d53d577b5b1c
treefc0f7e08c047a35fbf765981731a6b24cb9fc652
parentb10a74abcfc5c61afc63a567c457038be57eeb6e
lib/crypto: arm/sha1: Migrate optimized code into library

Instead of exposing the arm-optimized SHA-1 code via arm-specific
crypto_shash algorithms, instead just implement the sha1_blocks()
library function.  This is much simpler, it makes the SHA-1 library
functions be arm-optimized, and it fixes the longstanding issue where
the arm-optimized SHA-1 code was disabled by default.  SHA-1 still
remains available through crypto_shash, but individual architectures no
longer need to handle it.

To match sha1_blocks(), change the type of the nblocks parameter of the
assembly functions from int to size_t.  The assembly functions actually
already treated it as size_t.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250712232329.818226-8-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
16 files changed:
arch/arm/configs/exynos_defconfig
arch/arm/configs/milbeaut_m10v_defconfig
arch/arm/configs/multi_v7_defconfig
arch/arm/configs/omap2plus_defconfig
arch/arm/configs/pxa_defconfig
arch/arm/crypto/Kconfig
arch/arm/crypto/Makefile
arch/arm/crypto/sha1-ce-glue.c [deleted file]
arch/arm/crypto/sha1_glue.c [deleted file]
arch/arm/crypto/sha1_neon_glue.c [deleted file]
lib/crypto/Kconfig
lib/crypto/Makefile
lib/crypto/arm/sha1-armv4-large.S [moved from arch/arm/crypto/sha1-armv4-large.S with 100% similarity]
lib/crypto/arm/sha1-armv7-neon.S [moved from arch/arm/crypto/sha1-armv7-neon.S with 98% similarity]
lib/crypto/arm/sha1-ce-core.S [moved from arch/arm/crypto/sha1-ce-core.S with 96% similarity]
lib/crypto/arm/sha1.h [new file with mode: 0644]