Thread (2 messages) 2 messages, 1 author, 2025-08-11

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

From: Eric Biggers <ebiggers@kernel.org>
Date: 2025-08-11 17:59:14
Also in: linux-crypto

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@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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help