]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lib/crypto: s390/aes: Migrate optimized code into library
authorEric Biggers <ebiggers@kernel.org>
Mon, 12 Jan 2026 19:20:13 +0000 (11:20 -0800)
committerEric Biggers <ebiggers@kernel.org>
Thu, 15 Jan 2026 22:08:55 +0000 (14:08 -0800)
commit0cab15611e839142f4fd3c8a366acd1f7334b30b
tree8e2fd195499e121bf42f726b5e3b9482f8f5a9e6
parenta4e573db06a4e8c519ec4c42f8e1249a0853367a
lib/crypto: s390/aes: Migrate optimized code into library

Implement aes_preparekey_arch(), aes_encrypt_arch(), and
aes_decrypt_arch() using the CPACF AES instructions.

Then, remove the superseded "aes-s390" crypto_cipher.

The result is that both the AES library and crypto_cipher APIs use the
CPACF AES instructions, whereas previously only crypto_cipher did (and
it wasn't enabled by default, which this commit fixes as well).

Note that this preserves the optimization where the AES key is stored in
raw form rather than expanded form.  CPACF just takes the raw key.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Link: https://lore.kernel.org/r/20260112192035.10427-16-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
arch/s390/crypto/Kconfig
arch/s390/crypto/aes_s390.c
include/crypto/aes.h
lib/crypto/Kconfig
lib/crypto/s390/aes.h [new file with mode: 0644]