linux/arch/s390
Eric Biggers b86ced882b lib/crypto: sha256: Make library API use strongly-typed contexts
Currently the SHA-224 and SHA-256 library functions can be mixed
arbitrarily, even in ways that are incorrect, for example using
sha224_init() and sha256_final().  This is because they operate on the
same structure, sha256_state.

Introduce stronger typing, as I did for SHA-384 and SHA-512.

Also as I did for SHA-384 and SHA-512, use the names *_ctx instead of
*_state.  The *_ctx names have the following small benefits:

- They're shorter.
- They avoid an ambiguity with the compression function state.
- They're consistent with the well-known OpenSSL API.
- Users usually name the variable 'sctx' anyway, which suggests that
  *_ctx would be the more natural name for the actual struct.

Therefore: update the SHA-224 and SHA-256 APIs, implementation, and
calling code accordingly.

In the new structs, also strongly-type the compression function state.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250630160645.3198-7-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2025-07-04 10:18:53 -07:00
..
appldata treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
boot s390/boot: Use strspcy() instead of strcpy() 2025-04-30 11:41:28 +02:00
configs lib/crypto: s390/sha512: Migrate optimized SHA-512 code to library 2025-06-30 09:26:20 -07:00
crypto lib/crypto: s390/sha512: Migrate optimized SHA-512 code to library 2025-06-30 09:26:20 -07:00
hypfs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
include s390/ptrace: Fix pointer dereferencing in regs_get_kernel_stack_nth() 2025-06-17 18:15:25 +02:00
kernel Kbuild updates for v6.16 2025-06-07 10:05:35 -07:00
kvm KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY 2025-06-05 22:02:22 -07:00
lib lib/crypto: s390: Move arch/s390/lib/crypto/ into lib/crypto/ 2025-06-30 09:26:20 -07:00
mm more s390 updates for 6.16 merge window 2025-06-06 18:02:37 -07:00
net s390/bpf: Use kernel's expoline thunks 2025-05-22 08:40:56 -07:00
pci s390 updates for 6.16 merge window 2025-05-26 14:36:05 -07:00
purgatory lib/crypto: sha256: Make library API use strongly-typed contexts 2025-07-04 10:18:53 -07:00
tools s390: Allow to compile with z17 optimizations 2025-04-09 12:12:41 +02:00
Kbuild
Kconfig s390/mm: Select ARCH_WANT_IRQS_OFF_ACTIVATE_MM 2025-04-14 11:23:21 +02:00
Kconfig.debug s390/mm: Add configurable STRICT_MM_TYPECHECKS 2025-03-11 15:27:34 +01:00
Makefile s390: Allow to compile with z17 optimizations 2025-04-09 12:12:41 +02:00
Makefile.postlink kbuild: Create intermediate vmlinux build with relocations preserved 2025-03-17 00:29:50 +09:00