summaryrefslogtreecommitdiff
path: root/lib/crypto/Makefile
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@kernel.org>2026-03-18 23:17:13 -0700
committerEric Biggers <ebiggers@kernel.org>2026-03-23 16:44:29 -0700
commitaf413d71f09d4dde28277319926c1c3a6ec8b8d4 (patch)
treefd196684b58f0b8e3610b9b7e13e03a26a873453 /lib/crypto/Makefile
parent73f315c15d6ec1ef33202e7253af90dd44ff4a3b (diff)
downloadlinux-next-af413d71f09d4dde28277319926c1c3a6ec8b8d4.tar.gz
linux-next-af413d71f09d4dde28277319926c1c3a6ec8b8d4.zip
lib/crypto: riscv/ghash: Migrate optimized code into library
Remove the "ghash-riscv64-zvkg" crypto_shash algorithm. Move the corresponding assembly code into lib/crypto/, modify it to take the length in blocks instead of bytes, and wire it up to the GHASH library. This makes the GHASH library be optimized with the RISC-V Vector Cryptography Extension. It also greatly reduces the amount of riscv-specific glue code that is needed, and it fixes the issue where this optimized GHASH code was disabled by default. Note that this RISC-V code has multiple opportunities for improvement, such as adding more parallelism, providing an optimized multiplication function, and directly supporting POLYVAL. But for now, this commit simply tweaks ghash_zvkg() slightly to make it compatible with the library, then wires it up to ghash_blocks_arch(). ghash_preparekey_arch() is also implemented to store the copy of the raw key needed by the vghsh.vv instruction. Acked-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20260319061723.1140720-13-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'lib/crypto/Makefile')
-rw-r--r--lib/crypto/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile
index 8a9084188778..8950509833af 100644
--- a/lib/crypto/Makefile
+++ b/lib/crypto/Makefile
@@ -173,6 +173,7 @@ targets += powerpc/ghashp8-ppc.S
OBJECT_FILES_NON_STANDARD_powerpc/ghashp8-ppc.o := y
endif
+libgf128hash-$(CONFIG_RISCV) += riscv/ghash-riscv64-zvkg.o
libgf128hash-$(CONFIG_X86) += x86/polyval-pclmul-avx.o
endif # CONFIG_CRYPTO_LIB_GF128HASH_ARCH