[PATCH] lib/crypto: sha256: Use underlying functions instead of crypto_simd_usable()

Eric Biggers ebiggers at kernel.org
Mon Aug 11 10:58:12 PDT 2025


On Thu, Jul 31, 2025 at 03:35:10PM -0700, Eric Biggers wrote:
> Since sha256_kunit tests the fallback code paths without using
> crypto_simd_disabled_for_test, make the SHA-256 code just use the
> underlying may_use_simd() and irq_fpu_usable() functions directly
> instead of crypto_simd_usable().  This eliminates an unnecessary layer.
> 
> While doing this, also add likely() annotations, and fix a minor
> inconsistency where the static keys in the sha256.h files were in a
> different place than in the corresponding sha1.h and sha512.h files.
> 
> Signed-off-by: Eric Biggers <ebiggers at kernel.org>
> ---
>  lib/crypto/arm/sha256.h   | 10 +++++-----
>  lib/crypto/arm64/sha256.h | 10 +++++-----
>  lib/crypto/riscv/sha256.h |  8 ++++----
>  lib/crypto/x86/sha256.h   |  3 +--
>  4 files changed, 15 insertions(+), 16 deletions(-)

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next

- Eric



More information about the linux-arm-kernel mailing list