linux/lib/crypto/riscv
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
..
.gitignore lib/crypto: riscv: Add poly1305-core.S to .gitignore 2025-12-14 10:18:22 -08:00
aes-riscv64-zvkned.S lib/crypto: riscv/aes: Migrate optimized code into library 2026-01-12 11:39:58 -08:00
aes.h lib/crypto: riscv/aes: Migrate optimized code into library 2026-01-12 11:39:58 -08:00
chacha-riscv64-zvkb.S lib/crypto: riscv/chacha: Avoid s0/fp register 2025-12-09 15:10:20 -08:00
chacha.h lib/crypto: chacha: Consolidate into single module 2025-08-29 09:50:19 -07:00
poly1305-riscv.pl lib/crypto: riscv/poly1305: Import OpenSSL/CRYPTOGAMS implementation 2025-08-29 09:49:18 -07:00
poly1305.h lib/crypto: riscv/poly1305: Import OpenSSL/CRYPTOGAMS implementation 2025-08-29 09:49:18 -07:00
sha256-riscv64-zvknha_or_zvknhb-zvkb.S lib/crypto: sha256: Propagate sha256_block_state type to implementations 2025-07-04 10:22:57 -07:00
sha256.h lib/crypto: Drop inline from all *_mod_init_arch() functions 2025-08-27 08:15:35 -07:00
sha512-riscv64-zvknhb-zvkb.S lib/crypto: riscv/sha512: Migrate optimized SHA-512 code to library 2025-06-30 09:26:19 -07:00
sha512.h lib/crypto: Drop inline from all *_mod_init_arch() functions 2025-08-27 08:15:35 -07:00