[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMj1kXG+stJai+pQqAL7QwZHXV2a-hP4jjQKH7O2cBm1GK2aOA@mail.gmail.com>
Date: Sat, 26 Apr 2025 11:10:50 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: Eric Biggers <ebiggers@...nel.org>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mips@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-riscv@...ts.infradead.org, sparclinux@...r.kernel.org,
linux-s390@...r.kernel.org, x86@...nel.org,
"Jason A . Donenfeld" <Jason@...c4.com>, Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 02/13] crypto: arm/sha256 - implement library instead of shash
On Sat, 26 Apr 2025 at 08:51, Eric Biggers <ebiggers@...nel.org> wrote:
>
> From: Eric Biggers <ebiggers@...gle.com>
>
> Instead of providing crypto_shash algorithms for the arch-optimized
> SHA-256 code, instead implement the SHA-256 library. This is much
> simpler, it makes the SHA-256 library functions be arch-optimized, and
> it fixes the longstanding issue where the arch-optimized SHA-256 was
> disabled by default. SHA-256 still remains available through
> crypto_shash, but individual architectures no longer need to handle it.
>
> To merge the scalar, NEON, and CE code all into one module cleanly, add
> !CPU_V7M as a direct dependency of the CE code. Previously, !CPU_V7M
> was only a direct dependency of the scalar and NEON code. The result is
> still the same because CPU_V7M implies !KERNEL_MODE_NEON, so !CPU_V7M
> was already an indirect dependency of the CE code.
>
> To match sha256_blocks_arch(), change the type of the nblocks parameter
> of the assembly functions from int to size_t. The assembly functions
> actually already treated it as size_t.
>
> While renaming the assembly files, also fix the naming quirk where
> "sha2" meant sha256. (SHA-512 is also part of SHA-2.)
>
> Signed-off-by: Eric Biggers <ebiggers@...gle.com>
> ---
> arch/arm/configs/exynos_defconfig | 1 -
> arch/arm/configs/milbeaut_m10v_defconfig | 1 -
> arch/arm/configs/multi_v7_defconfig | 1 -
> arch/arm/configs/omap2plus_defconfig | 1 -
> arch/arm/configs/pxa_defconfig | 1 -
> arch/arm/crypto/Kconfig | 21 ----
> arch/arm/crypto/Makefile | 8 +-
> arch/arm/crypto/sha2-ce-glue.c | 87 --------------
> arch/arm/crypto/sha256_glue.c | 107 ------------------
> arch/arm/crypto/sha256_glue.h | 9 --
> arch/arm/crypto/sha256_neon_glue.c | 75 ------------
> arch/arm/lib/crypto/.gitignore | 1 +
> arch/arm/lib/crypto/Kconfig | 6 +
> arch/arm/lib/crypto/Makefile | 8 +-
> arch/arm/{ => lib}/crypto/sha256-armv4.pl | 0
> .../sha2-ce-core.S => lib/crypto/sha256-ce.S} | 10 +-
> arch/arm/lib/crypto/sha256.c | 64 +++++++++++
> 17 files changed, 84 insertions(+), 317 deletions(-)
> delete mode 100644 arch/arm/crypto/sha2-ce-glue.c
> delete mode 100644 arch/arm/crypto/sha256_glue.c
> delete mode 100644 arch/arm/crypto/sha256_glue.h
> delete mode 100644 arch/arm/crypto/sha256_neon_glue.c
> rename arch/arm/{ => lib}/crypto/sha256-armv4.pl (100%)
> rename arch/arm/{crypto/sha2-ce-core.S => lib/crypto/sha256-ce.S} (91%)
> create mode 100644 arch/arm/lib/crypto/sha256.c
>
Reviewed-by: Ard Biesheuvel <ardb@...nel.org>
Powered by blists - more mailing lists