Skip to contentSkip to conversation

crypto: remove aegis128 support

PATCH In review Ard Biesheuvel 3 participants 5 messages Nov 12

Subsystems (6)
x86 Crypto API s390 Arm STM32 +2 more subsystems
lore
Share & tools
lore
#0 lore raw

cover crypto: remove aegis128 support

From: Ard Biesheuvel <[email protected]>

Remove aegis128 support, which has become obsolete.

Cc Antonio Quartulli <[email protected]>
Cc Ondrej Mosnáček <[email protected]>

Ard Biesheuvel (2):
crypto: x86 - remove aegis128 support
crypto: remove aegis128 support

 arch/m68k/configs/amiga_defconfig     |   1 -
 arch/m68k/configs/apollo_defconfig    |   1 -
 arch/m68k/configs/atari_defconfig     |   1 -
 arch/m68k/configs/bvme6000_defconfig  |   1 -
 arch/m68k/configs/hp300_defconfig     |   1 -
 arch/m68k/configs/mac_defconfig       |   1 -
 arch/m68k/configs/multi_defconfig     |   1 -
 arch/m68k/configs/mvme147_defconfig   |   1 -
 arch/m68k/configs/mvme16x_defconfig   |   1 -
 arch/m68k/configs/q40_defconfig       |   1 -
 arch/m68k/configs/sun3_defconfig      |   1 -
 arch/m68k/configs/sun3x_defconfig     |   1 -
 arch/s390/configs/debug_defconfig     |   1 -
 arch/s390/configs/defconfig           |   1 -
 arch/x86/crypto/Kconfig               |  11 -
 arch/x86/crypto/Makefile              |   3 -
 arch/x86/crypto/aegis128-aesni-asm.S  | 602 --------------------
 arch/x86/crypto/aegis128-aesni-glue.c | 286 ----------
 crypto/Kconfig                        |  17 -
 crypto/Makefile                       |  20 -
 crypto/aegis-neon.h                   |  17 -
 crypto/aegis.h                        |  79 ---
 crypto/aegis128-core.c                | 577 -------------------
 crypto/aegis128-neon-inner.c          | 343 -----------
 crypto/aegis128-neon.c                |  60 --
 crypto/tcrypt.c                       |   7 -
 crypto/testmgr.c                      |   6 -
 crypto/testmgr.h                      | 444 ---------------
 28 files changed, 2486 deletions(-)
 delete mode 100644 arch/x86/crypto/aegis128-aesni-asm.S
 delete mode 100644 arch/x86/crypto/aegis128-aesni-glue.c
 delete mode 100644 crypto/aegis-neon.h
 delete mode 100644 crypto/aegis.h
 delete mode 100644 crypto/aegis128-core.c
 delete mode 100644 crypto/aegis128-neon-inner.c
 delete mode 100644 crypto/aegis128-neon.c
Signature · 1 line
2.56.0.567.gdb80ae8cd5-goog
#1 lore raw

PATCH 1/2 crypto: x86 - remove aegis128 support

From: Ard Biesheuvel <[email protected]>

Even the people that are invested in Aegis appear to have lost interest in aegis128: it did win the CAESAR competition but is no longer covered by RFC 10032, which does list some other variants that competed as well.

So let's delete it.

---
 arch/x86/crypto/Kconfig               |  11 -
 arch/x86/crypto/Makefile              |   3 -
 arch/x86/crypto/aegis128-aesni-asm.S  | 602 --------------------
 arch/x86/crypto/aegis128-aesni-glue.c | 286 ----------
 4 files changed, 902 deletions(-)
arch/x86/crypto/Kconfig +0 -11
index 20f5e2a17e45..7988d4aa1d6d 100644
@@ -314,15 +314,4 @@ config CRYPTO_ARIA_GFNI_AVX512_X86_64
 
 	  Processes 64 blocks in parallel.
 
-config CRYPTO_AEGIS128_AESNI_SSE2
-	tristate "AEAD ciphers: AEGIS-128 (AES-NI/SSE4.1)"
-	depends on 64BIT
-	select CRYPTO_AEAD
-	help
-	  AEGIS-128 AEAD algorithm
-
-	  Architecture: x86_64 using:
-	  - AES-NI (AES New Instructions)
-	  - SSE4.1 (Streaming SIMD Extensions 4.1)
-
 endmenu
arch/x86/crypto/Makefile +0 -3
index 09bdea45bc3e..dc1b819c27de 100644
@@ -36,9 +36,6 @@ cast5-avx-x86_64-y := cast5-avx-x86_64-asm_64.o cast5_avx_glue.o
 obj-$(CONFIG_CRYPTO_CAST6_AVX_X86_64) += cast6-avx-x86_64.o
 cast6-avx-x86_64-y := cast6-avx-x86_64-asm_64.o cast6_avx_glue.o
 
-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 \
 		 aes-gcm-aesni-x86_64.o \
arch/x86/crypto/aegis128-aesni-asm.S deleted +0 -602

602 lines not on this page · raw message

arch/x86/crypto/aegis128-aesni-glue.c deleted +0 -286

286 lines not on this page · raw message

Signature · 1 line
2.56.0.567.gdb80ae8cd5-goog
#2 lore raw

Re: [PATCH 1/2] crypto: x86 - remove aegis128 support

Quoted 9 lines · Ard Biesheuvel

From: Ard Biesheuvel <[email protected]>

Even the people that are invested in Aegis appear to have lost interest in aegis128: it did win the CAESAR competition but is no longer covered by RFC 10032, which does list some other variants that competed as well.

So let's delete it.

AEGIS-128 might be used by dm-crypt, e.g. if anyone passed '-c aegis128-random' to cryptsetup. I added dm-devel and Milan Broz to Cc to comment on the feasibility of removing it.

But clearly AEGIS-128 is a mistake. It has a hardcoded amount of parallelism that is much too small for current CPUs. That was very clear when I looked into optimizing it with AVX-512: it just does not work, and it uses only a quarter of the CPU's resources.

That's resulted in AES-GCM now being much faster, as well as the people promoting AEGIS having abandoned AEGIS-128 and now advocating entirely for other variants like AEGIS-128X4 instead (despite that unfortunately still having a hardcoded amount of parallelism).

AEGIS-128 doesn't fare super well on the nonce front either, with it not being nonce-misuse-resistant, and its 128-bit nonce being only an incremental upgrade over AES-GCM's 96-bit nonce. (Compare to XChaCha20Poly1305's or XAES-256-GCM's 192-bit nonce, or to AES-GCM-SIV which is nonce-misuse-resistant.)

So yes, this seems to have become yet another odd legacy thing that doesn't really make sense to use. If anyone does use it, it is likely mainly because the kernel's existing, already-highly-optimized XChaCha20Poly1305 code hasn't yet been wired up to dm-crypt, or because they relied on outdated information about AEGIS-128's performance.

- Eric

#3 lore raw

Re: [PATCH 1/2] crypto: x86 - remove aegis128 support

Quoted 7 lines · Eric Biggers
Quoted 6 lines · Ard Biesheuvel

From: Ard Biesheuvel <[email protected]>

Even the people that are invested in Aegis appear to have lost interest in aegis128: it did win the CAESAR competition but is no longer covered by RFC 10032, which does list some other variants that competed as well.

Quoted 7 lines
Quoted 3 lines

So let's delete it.

AEGIS-128 might be used by dm-crypt, e.g. if anyone passed '-c aegis128-random' to cryptsetup. I added dm-devel and Milan Broz to Cc to comment on the feasibility of removing it.

AEGIS was introduced to kernel for dm-crypt to have real AEAD mode, I do not think there is any other user.

At that time, there was nothing better.

Unfortunately, I am afraid it is used in some systems and removing it completely could create issues for users. What you can do is to mark it obsolete and expect it can be phased out later...

...

Quoted 10 lines

But clearly AEGIS-128 is a mistake. It has a hardcoded amount of parallelism that is much too small for current CPUs. That was very clear when I looked into optimizing it with AVX-512: it just does not work, and it uses only a quarter of the CPU's resources.

That's resulted in AES-GCM now being much faster, as well as the people promoting AEGIS having abandoned AEGIS-128 and now advocating entirely for other variants like AEGIS-128X4 instead (despite that unfortunately still having a hardcoded amount of parallelism).

Quoted 5 lines

AEGIS-128 doesn't fare super well on the nonce front either, with it not being nonce-misuse-resistant, and its 128-bit nonce being only an incremental upgrade over AES-GCM's 96-bit nonce. (Compare to XChaCha20Poly1305's or XAES-256-GCM's 192-bit nonce, or to AES-GCM-SIV which is nonce-misuse-resistant.)

AES-GCM is not good replacement due to that 96bit nonce.

I think other modes cannot be used in dm-crypt for AEAD mode, we will need to check what is missing.

Milan

#4 lore raw

PATCH 2/2 crypto: remove aegis128 support

In reply to Ard Biesheuvel

From: Ard Biesheuvel <[email protected]>

Even the people that are invested in Aegis appear to have lost interest in aegis128: it did win the CAESAR competition but is no longer covered by RFC 10032, which does list some other variants that competed as well.

So let's delete it.

---
 arch/m68k/configs/amiga_defconfig    |   1 -
 arch/m68k/configs/apollo_defconfig   |   1 -
 arch/m68k/configs/atari_defconfig    |   1 -
 arch/m68k/configs/bvme6000_defconfig |   1 -
 arch/m68k/configs/hp300_defconfig    |   1 -
 arch/m68k/configs/mac_defconfig      |   1 -
 arch/m68k/configs/multi_defconfig    |   1 -
 arch/m68k/configs/mvme147_defconfig  |   1 -
 arch/m68k/configs/mvme16x_defconfig  |   1 -
 arch/m68k/configs/q40_defconfig      |   1 -
 arch/m68k/configs/sun3_defconfig     |   1 -
 arch/m68k/configs/sun3x_defconfig    |   1 -
 arch/s390/configs/debug_defconfig    |   1 -
 arch/s390/configs/defconfig          |   1 -
 crypto/Kconfig                       |  17 -
 crypto/Makefile                      |  20 -
 crypto/aegis-neon.h                  |  17 -
 crypto/aegis.h                       |  79 ---
 crypto/aegis128-core.c               | 577 --------------------
 crypto/aegis128-neon-inner.c         | 343 ------------
 crypto/aegis128-neon.c               |  60 --
 crypto/tcrypt.c                      |   7 -
 crypto/testmgr.c                     |   6 -
 crypto/testmgr.h                     | 444 ---------------
 24 files changed, 1584 deletions(-)
arch/m68k/configs/amiga_defconfig +0 -1
index e2d474e8cb8f..787defb894dd 100644
@@ -531,7 +531,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/apollo_defconfig +0 -1
index 77669e31bb5a..8b8cea4643ed 100644
@@ -485,7 +485,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/atari_defconfig +0 -1
index 43ed1e317ae2..c36793ed8d49 100644
@@ -510,7 +510,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/bvme6000_defconfig +0 -1
index 44c1a2228d5f..53bc0e1dcf8c 100644
@@ -477,7 +477,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/hp300_defconfig +0 -1
index 7ab25377bfe8..9412fc91a831 100644
@@ -487,7 +487,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/mac_defconfig +0 -1
index 13f642884a94..1e092dd7c1f7 100644
@@ -506,7 +506,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/multi_defconfig +0 -1
index 1bbd2aa653c0..fbfbd3644626 100644
@@ -596,7 +596,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/mvme147_defconfig +0 -1
index 3bfc36faf8d5..6209dacde6f4 100644
@@ -477,7 +477,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/mvme16x_defconfig +0 -1
index 41ceed87c78a..a937c428d2d5 100644
@@ -478,7 +478,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/q40_defconfig +0 -1
index af4b5c6e4655..fb2c07c194ae 100644
@@ -496,7 +496,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/sun3_defconfig +0 -1
index 1140951fefe7..7ba77810a688 100644
@@ -475,7 +475,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/m68k/configs/sun3x_defconfig +0 -1
index bc9358e71ee0..0810c9fb3daf 100644
@@ -475,7 +475,6 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_RMD160=m
arch/s390/configs/debug_defconfig +0 -1
index d44674b63715..2a1b312a04d2 100644
@@ -805,7 +805,6 @@ CONFIG_CRYPTO_ADIANTUM=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_GCM=y
 CONFIG_CRYPTO_SEQIV=y
 CONFIG_CRYPTO_MD4=m
arch/s390/configs/defconfig +0 -1
index e00e252d4694..94d4646999b3 100644
@@ -789,7 +789,6 @@ CONFIG_CRYPTO_ADIANTUM=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_HCTR2=m
 CONFIG_CRYPTO_LRW=m
-CONFIG_CRYPTO_AEGIS128=m
 CONFIG_CRYPTO_GCM=y
 CONFIG_CRYPTO_SEQIV=y
 CONFIG_CRYPTO_MD4=m
crypto/Kconfig +0 -17
index 981d5dc422d4..7bb06b817d55 100644
@@ -743,23 +743,6 @@ endmenu
 
 menu "AEAD (authenticated encryption with associated data) ciphers"
 
-config CRYPTO_AEGIS128
-	tristate "AEGIS-128"
-	select CRYPTO_AEAD
-	select CRYPTO_LIB_AES  # for AES S-box tables
-	help
-	  AEGIS-128 AEAD algorithm
-
-config CRYPTO_AEGIS128_SIMD
-	bool "AEGIS-128 (arm NEON, arm64 NEON)"
-	depends on CRYPTO_AEGIS128 && ((ARM || ARM64) && KERNEL_MODE_NEON)
-	default y
-	help
-	  AEGIS-128 AEAD algorithm
-
-	  Architecture: arm or arm64 using:
-	  - NEON (Advanced SIMD) extension
-
 config CRYPTO_CHACHA20POLY1305
 	tristate "ChaCha20-Poly1305"
 	select CRYPTO_CHACHA20
crypto/Makefile +0 -20
index 33bb5ad595e8..4db99bba1048 100644
@@ -96,26 +96,6 @@ obj-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o
 obj-$(CONFIG_CRYPTO_GCM) += gcm.o
 obj-$(CONFIG_CRYPTO_CCM) += ccm.o
 obj-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o
-obj-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o
-aegis128-y := aegis128-core.o
-
-CFLAGS_aegis128-neon-inner.o += $(CC_FLAGS_FPU)
-CFLAGS_REMOVE_aegis128-neon-inner.o += $(CC_FLAGS_NO_FPU)
-ifeq ($(ARCH),arm)
-CFLAGS_aegis128-neon-inner.o += -march=armv8-a -mfpu=crypto-neon-fp-armv8
-aegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o
-endif
-ifeq ($(ARCH),arm64)
-aegis128-cflags-y := -mcpu=generic+crypto
-aegis128-cflags-$(CONFIG_CC_IS_GCC) += -ffixed-q16 -ffixed-q17 -ffixed-q18 \
-				       -ffixed-q19 -ffixed-q20 -ffixed-q21 \
-				       -ffixed-q22 -ffixed-q23 -ffixed-q24 \
-				       -ffixed-q25 -ffixed-q26 -ffixed-q27 \
-				       -ffixed-q28 -ffixed-q29 -ffixed-q30 \
-				       -ffixed-q31
-CFLAGS_aegis128-neon-inner.o += $(aegis128-cflags-y)
-aegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o
-endif
 
 obj-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o
 obj-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o
crypto/aegis-neon.h deleted +0 -17
deleted file mode 100644
index 61e5614b45de..000000000000
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#ifndef _AEGIS_NEON_H
-#define _AEGIS_NEON_H
-
-void crypto_aegis128_init_neon(void *state, const void *key, const void *iv);
-void crypto_aegis128_update_neon(void *state, const void *msg);
-void crypto_aegis128_encrypt_chunk_neon(void *state, void *dst, const void *src,
-					unsigned int size);
-void crypto_aegis128_decrypt_chunk_neon(void *state, void *dst, const void *src,
-					unsigned int size);
-int crypto_aegis128_final_neon(void *state, void *tag_xor,
-			       unsigned int assoclen,
-			       unsigned int cryptlen,
-			       unsigned int authsize);
-
-#endif
crypto/aegis.h deleted +0 -79

79 lines not on this page · raw message

crypto/aegis128-core.c deleted +0 -577

577 lines not on this page · raw message

crypto/aegis128-neon-inner.c deleted +0 -343

343 lines not on this page · raw message

crypto/aegis128-neon.c deleted +0 -60

60 lines not on this page · raw message

crypto/tcrypt.c +0 -7
index e6834bdde9b9..7820fe01cd3a 100644
@@ -2138,13 +2138,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
 				  speed_template_16_24_32);
 		break;
 
-	case 221:
-		test_aead_speed("aegis128", ENCRYPT, sec,
-				NULL, 0, 16, 8, speed_template_16);
-		test_aead_speed("aegis128", DECRYPT, sec,
-				NULL, 0, 16, 8, speed_template_16);
-		break;
-
 	case 222:
 		test_aead_speed("gcm(sm4)", ENCRYPT, sec,
 				NULL, 0, 16, 8, speed_template_16);
crypto/testmgr.c +0 -6
index 9419d61d0602..ce6f3171626c 100644
@@ -4062,12 +4062,6 @@ static const struct alg_test_desc alg_test_descs[] = {
 		.suite = {
 			.cipher = __VECS(adiantum_xchacha20_aes_tv_template)
 		},
-	}, {
-		.alg = "aegis128",
-		.test = alg_test_aead,
-		.suite = {
-			.aead = __VECS(aegis128_tv_template)
-		}
 	}, {
 		.alg = "authenc(hmac(md5),cbc(aes))",
 		.generic_driver = "authenc(hmac-md5-lib,cbc(aes-lib))",
crypto/testmgr.h +0 -444

450 lines not on this page · raw message

Signature · 1 line
2.56.0.567.gdb80ae8cd5-goog