linux/arch/riscv/crypto
Eric Biggers a4e573db06 lib/crypto: riscv/aes: Migrate optimized code into library
Move the aes_encrypt_zvkned() and aes_decrypt_zvkned() assembly
functions into lib/crypto/, wire them up to the AES library API, and
remove the "aes-riscv64-zvkned" crypto_cipher algorithm.

To make this possible, change the prototypes of these functions to
take (rndkeys, key_len) instead of a pointer to crypto_aes_ctx, and
change the RISC-V AES-XTS code to implement tweak encryption using the
AES library instead of directly calling aes_encrypt_zvkned().

The result is that both the AES library and crypto_cipher APIs use
RISC-V's AES instructions, whereas previously only crypto_cipher did
(and it wasn't enabled by default, which this commit fixes as well).

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20260112192035.10427-15-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-01-12 11:39:58 -08:00
..
Kconfig lib/crypto: riscv/aes: Migrate optimized code into library 2026-01-12 11:39:58 -08:00
Makefile lib/crypto: riscv/sha512: Migrate optimized SHA-512 code to library 2025-06-30 09:26:19 -07:00
aes-macros.S lib/crypto: riscv/aes: Migrate optimized code into library 2026-01-12 11:39:58 -08:00
aes-riscv64-glue.c lib/crypto: riscv/aes: Migrate optimized code into library 2026-01-12 11:39:58 -08:00
aes-riscv64-zvkned-zvbb-zvkg.S crypto: riscv - add vector crypto accelerated AES-{ECB,CBC,CTR,XTS} 2024-01-22 17:55:18 -08:00
aes-riscv64-zvkned-zvkb.S crypto: riscv - add vector crypto accelerated AES-{ECB,CBC,CTR,XTS} 2024-01-22 17:55:18 -08:00
aes-riscv64-zvkned.S lib/crypto: riscv/aes: Migrate optimized code into library 2026-01-12 11:39:58 -08:00
ghash-riscv64-glue.c crypto: riscv/ghash - Use API partial block handling 2025-04-23 11:33:47 +08:00
ghash-riscv64-zvkg.S crypto: riscv - add vector crypto accelerated GHASH 2024-01-22 17:55:20 -08:00
sm3-riscv64-glue.c crypto: riscv/sm3 - Use API partial block handling 2025-04-23 15:52:47 +08:00
sm3-riscv64-zvksh-zvkb.S crypto: riscv - Use SYM_FUNC_START for functions only called directly 2025-04-25 10:46:05 +08:00
sm4-riscv64-glue.c crypto: riscv - add vector crypto accelerated SM4 2024-01-22 17:55:24 -08:00
sm4-riscv64-zvksed-zvkb.S crypto: riscv - add vector crypto accelerated SM4 2024-01-22 17:55:24 -08:00