[PATCH 00/12] SM3 library
Eric Biggers
ebiggers at kernel.org
Tue Mar 24 16:27:20 PDT 2026
On Fri, Mar 20, 2026 at 09:09:23PM -0700, Eric Biggers wrote:
> This series is targeting libcrypto-next. It can also be retrieved from:
>
> git fetch https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git sm3-lib-v1
>
> This series cleans up the kernel's existing SM3 hashing code:
>
> - First, it updates lib/crypto/sm3.c to implement the full SM3 instead
> of just SM3's compression function.
>
> - Next, it adds a KUnit test suite for the new library API.
>
> - Next, it replaces the "sm3-generic" crypto_shash with a wrapper around
> the new library API.
>
> - Finally, it accelerates the API using the existing SM3 assembly code
> for arm64, riscv, and x86. The architecture-specific crypto_shash
> glue code for SM3 is no longer needed and is removed.
>
> This should look quite boring. It's the same cleanup that I've already
> done for the other hash functions.
>
> Note: I don't recommend using SM3. There also don't appear to be any
> immediate candidate users of the SM3 library other than crypto_shash.
>
> Still, this seems like the clear way to go. It's simpler, and it gets
> the hash algorithms integrated in a consistent way. We won't have to
> keep track of two quite different ways of doing things. With KUnit the
> code becomes much easier to test and benchmark, as well.
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next
- Eric
More information about the linux-riscv
mailing list