linux/arch
Eric Biggers e96cb9507f lib/crypto: sha256: Consolidate into single module
Consolidate the CPU-based SHA-256 code into a single module, following
what I did with SHA-512:

- Each arch now provides a header file lib/crypto/$(SRCARCH)/sha256.h,
  replacing lib/crypto/$(SRCARCH)/sha256.c.  The header defines
  sha256_blocks() and optionally sha256_mod_init_arch().  It is included
  by lib/crypto/sha256.c, and thus the code gets built into the single
  libsha256 module, with proper inlining and dead code elimination.

- sha256_blocks_generic() is moved from lib/crypto/sha256-generic.c into
  lib/crypto/sha256.c.  It's now a static function marked with
  __maybe_unused, so the compiler automatically eliminates it in any
  cases where it's not used.

- Whether arch-optimized SHA-256 is buildable is now controlled
  centrally by lib/crypto/Kconfig instead of by
  lib/crypto/$(SRCARCH)/Kconfig.  The conditions for enabling it remain
  the same as before, and it remains enabled by default.

- Any additional arch-specific translation units for the optimized
  SHA-256 code (such as assembly files) are now compiled by
  lib/crypto/Makefile instead of lib/crypto/$(SRCARCH)/Makefile.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250630160645.3198-13-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2025-07-04 10:23:11 -07:00
..
alpha mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
arc ARC fixes for 6.16 2025-06-12 08:17:56 -07:00
arm lib/crypto: arm: Move arch/arm/lib/crypto/ into lib/crypto/ 2025-06-30 09:26:20 -07:00
arm64 lib/crypto: arm64: Move arch/arm64/lib/crypto/ into lib/crypto/ 2025-06-30 09:26:20 -07:00
csky mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
hexagon mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
loongarch LoongArch: KVM: Disable updating of "num_cpu" and "feature" 2025-06-27 18:27:44 +08:00
m68k mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
microblaze mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
mips lib/crypto: sha256: Consolidate into single module 2025-07-04 10:23:11 -07:00
nios2 mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
openrisc mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
parisc mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
powerpc lib/crypto: powerpc: Move arch/powerpc/lib/crypto/ into lib/crypto/ 2025-06-30 09:26:20 -07:00
riscv lib/crypto: sha256: Make library API use strongly-typed contexts 2025-07-04 10:18:53 -07:00
s390 lib/crypto: sha256: Make library API use strongly-typed contexts 2025-07-04 10:18:53 -07:00
sh mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
sparc lib/crypto: sparc: Move arch/sparc/lib/crypto/ into lib/crypto/ 2025-06-30 09:26:20 -07:00
um um: vector: Reduce stack usage in vector_eth_configure() 2025-06-25 09:28:17 +02:00
x86 lib/crypto: sha256: Make library API use strongly-typed contexts 2025-07-04 10:18:53 -07:00
xtensa mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
.gitignore
Kconfig