diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2026-03-18 23:17:13 -0700 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-03-23 16:44:29 -0700 |
| commit | af413d71f09d4dde28277319926c1c3a6ec8b8d4 (patch) | |
| tree | fd196684b58f0b8e3610b9b7e13e03a26a873453 /lib/crypto/Makefile | |
| parent | 73f315c15d6ec1ef33202e7253af90dd44ff4a3b (diff) | |
| download | linux-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/Makefile | 1 |
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 |
