[PATCH 14/20] crypto: x86/aes - Drop superseded 32-bit build support

From: Eric Biggers

Date: Mon Sep 21 2026 - 01:19:17 EST


Now that the AES-NI and/or VAES accelerated implementations of AES-ECB,
AES-CBC, AES-CBC-CTS, AES-CTR, AES-XCTR, and AES-XTS have been migrated
into the "libaes" module in lib/crypto/ and enabled by default when the
corresponding non-arch-specific options (e.g. CRYPTO_XTS) are enabled,
the traditional "aesni-intel" module only has AES-GCM left.

That functionality is 64-bit only. Therefore, aesni-intel no longer has
any functionality on 32-bit. Stop building it on 32-bit.

Also update the help text to mention the generic options.

To be clear: AES-NI accelerated AES-ECB, AES-CBC, AES-CBC-CTS, and
AES-XTS remain fully supported in 32-bit x86 kernels via libaes.

Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
---
arch/x86/crypto/Kconfig | 7 ++++---
arch/x86/crypto/Makefile | 6 ++----
arch/x86/crypto/aesni-intel_glue.c | 14 --------------
3 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/arch/x86/crypto/Kconfig b/arch/x86/crypto/Kconfig
index d68b31fad508..9cb5176931aa 100644
--- a/arch/x86/crypto/Kconfig
+++ b/arch/x86/crypto/Kconfig
@@ -4,18 +4,19 @@ menu "Accelerated Cryptographic Algorithms for CPU (x86)"

config CRYPTO_AES_NI_INTEL
tristate "Ciphers: AES, modes: GCM (AES-NI/VAES)"
+ depends on 64BIT
select CRYPTO_AEAD
select CRYPTO_LIB_AES
select CRYPTO_LIB_GF128MUL
help
AEAD cipher: AES with GCM

- Architecture: x86 (32-bit and 64-bit) using:
+ Architecture: x86_64 using:
- AES-NI (AES new instructions)
- VAES (Vector AES)

- Some algorithm implementations are supported only in 64-bit builds,
- and some have additional prerequisites such as AVX2 or AVX512.
+ Note: this option no longer provides the accelerated XTS, CBC, CTR,
+ and ECB code. For those just use CRYPTO_XTS, CRYPTO_CBC, etc.

config CRYPTO_BLOWFISH_X86_64
tristate "Ciphers: Blowfish, modes: ECB, CBC"
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index e05d6e2257d4..aba817fe64f5 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -40,10 +40,8 @@ obj-$(CONFIG_CRYPTO_AEGIS128_AESNI_SSE2) += aegis128-aesni.o
aegis128-aesni-y := aegis128-aesni-asm.o aegis128-aesni-glue.o

obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
-aesni-intel-y := aesni-intel_glue.o
-aesni-intel-$(CONFIG_64BIT) += aes-gcm-aesni-x86_64.o \
- aes-gcm-vaes-avx2.o \
- aes-gcm-vaes-avx512.o
+aesni-intel-y := aesni-intel_glue.o aes-gcm-aesni-x86_64.o \
+ aes-gcm-vaes-avx2.o aes-gcm-vaes-avx512.o

obj-$(CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64) += sm4-aesni-avx-x86_64.o
sm4-aesni-avx-x86_64-y := sm4-aesni-avx-asm_64.o sm4_aesni_avx_glue.o
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index 3f86c8997d7d..af52c442361f 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -37,8 +37,6 @@
#include <linux/spinlock.h>
#include <linux/static_call.h>

-#ifdef CONFIG_X86_64
-
/* The common part of the x86_64 AES-GCM key struct */
struct aes_gcm_key {
/* Expanded AES key and the AES key length in bytes */
@@ -845,18 +843,6 @@ static void unregister_avx_algs(void)
unregister_aeads(aes_gcm_algs_vaes_avx2);
unregister_aeads(aes_gcm_algs_vaes_avx512);
}
-#else /* CONFIG_X86_64 */
-static struct aead_alg aes_gcm_algs_aesni[0];
-
-static int __init register_avx_algs(void)
-{
- return 0;
-}
-
-static void unregister_avx_algs(void)
-{
-}
-#endif /* !CONFIG_X86_64 */

static const struct x86_cpu_id aesni_cpu_id[] = {
X86_MATCH_FEATURE(X86_FEATURE_AES, NULL),
--
2.55.0