linux/lib/crypto/riscv
Eric Biggers 5f6bbba5e9 lib/crypto: riscv/sm3: Migrate optimized code into library
Instead of exposing the riscv-optimized SM3 code via a riscv-specific
crypto_shash algorithm, instead just implement the sm3_blocks() library
function.  This is much simpler, it makes the SM3 library functions be
riscv-optimized, and it fixes the longstanding issue where the
riscv-optimized SM3 code was disabled by default.  SM3 still remains
available through crypto_shash, but individual architectures no longer
need to handle it.

Tweak the prototype of sm3_transform_zvksh_zvkb() to match what the
library expects, including changing the block count to size_t.
Note that the assembly code already treated it as size_t.

Note: to see the diff from arch/riscv/crypto/sm3-riscv64-glue.c to
lib/crypto/riscv/sm3.h, view this commit with 'git show -M10'.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20260321040935.410034-9-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-03-23 17:50:59 -07: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
gf128hash.h lib/crypto: riscv/ghash: Migrate optimized code into library 2026-03-23 16:44:29 -07:00
ghash-riscv64-zvkg.S lib/crypto: riscv/ghash: Migrate optimized code into library 2026-03-23 16:44:29 -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
sha512.h lib/crypto: Drop inline from all *_mod_init_arch() functions 2025-08-27 08:15:35 -07:00
sm3-riscv64-zvksh-zvkb.S lib/crypto: riscv/sm3: Migrate optimized code into library 2026-03-23 17:50:59 -07:00
sm3.h lib/crypto: riscv/sm3: Migrate optimized code into library 2026-03-23 17:50:59 -07:00