sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	 linux-riscv@lists.infradead.org, sparclinux@vger.kernel.org,
	 linux-s390@vger.kernel.org, x86@kernel.org,
	 "Jason A . Donenfeld" <Jason@zx2c4.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 02/13] crypto: arm/sha256 - implement library instead of shash
Date: Sat, 26 Apr 2025 11:10:50 +0200	[thread overview]
Message-ID: <CAMj1kXG+stJai+pQqAL7QwZHXV2a-hP4jjQKH7O2cBm1GK2aOA@mail.gmail.com> (raw)
In-Reply-To: <20250426065041.1551914-3-ebiggers@kernel.org>

On Sat, 26 Apr 2025 at 08:51, Eric Biggers <ebiggers@kernel.org> wrote:
>
> From: Eric Biggers <ebiggers@google.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@google.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@kernel.org>

  reply	other threads:[~2025-04-26  9:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-26  6:50 [PATCH 00/13] Architecture-optimized SHA-256 library API Eric Biggers
2025-04-26  6:50 ` [PATCH 01/13] crypto: sha256 - support arch-optimized lib and expose through shash Eric Biggers
2025-04-27  1:06   ` Herbert Xu
2025-04-27  1:12     ` Eric Biggers
2025-04-27  1:17       ` Herbert Xu
2025-04-27  1:50         ` Eric Biggers
2025-04-27  1:52           ` Herbert Xu
2025-04-27  2:05             ` Eric Biggers
2025-04-27  2:08               ` Herbert Xu
2025-04-26  6:50 ` [PATCH 02/13] crypto: arm/sha256 - implement library instead of shash Eric Biggers
2025-04-26  9:10   ` Ard Biesheuvel [this message]
2025-04-26  6:50 ` [PATCH 03/13] crypto: arm64/sha256 - remove obsolete chunking logic Eric Biggers
2025-04-26  9:07   ` Ard Biesheuvel
2025-04-26  6:50 ` [PATCH 04/13] crypto: arm64/sha256 - implement library instead of shash Eric Biggers
2025-04-26  9:07   ` Ard Biesheuvel
2025-04-26  6:50 ` [PATCH 05/13] crypto: mips/sha256 " Eric Biggers
2025-04-26  6:50 ` [PATCH 06/13] crypto: powerpc/sha256 " Eric Biggers
2025-04-26  6:50 ` [PATCH 07/13] crypto: riscv/sha256 " Eric Biggers
2025-04-26  6:50 ` [PATCH 08/13] crypto: s390/sha256 " Eric Biggers
2025-04-26  6:50 ` [PATCH 09/13] crypto: sparc - move opcodes.h into asm directory Eric Biggers
2025-04-26  6:50 ` [PATCH 10/13] crypto: sparc/sha256 - implement library instead of shash Eric Biggers
2025-04-26  6:50 ` [PATCH 11/13] crypto: x86/sha256 " Eric Biggers
2025-04-26 10:50   ` Herbert Xu
2025-04-26 18:03     ` Eric Biggers
2025-04-27  0:18       ` Herbert Xu
2025-04-27  1:02         ` Eric Biggers
2025-04-27  5:21   ` Herbert Xu
2025-04-26  6:50 ` [PATCH 12/13] crypto: sha256 - remove sha256_base.h Eric Biggers
2025-04-26  6:50 ` [PATCH 13/13] crypto: lib/sha256 - improve function prototypes Eric Biggers
2025-04-26 15:17 ` [PATCH 00/13] Architecture-optimized SHA-256 library API Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMj1kXG+stJai+pQqAL7QwZHXV2a-hP4jjQKH7O2cBm1GK2aOA@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=ebiggers@kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).