xref: /kernel/linux/linux-6.6/arch/arm/crypto/Kconfig (revision 62306a36)
162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci
362306a36Sopenharmony_cimenu "Accelerated Cryptographic Algorithms for CPU (arm)"
462306a36Sopenharmony_ci
562306a36Sopenharmony_ciconfig CRYPTO_CURVE25519_NEON
662306a36Sopenharmony_ci	tristate "Public key crypto: Curve25519 (NEON)"
762306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
862306a36Sopenharmony_ci	select CRYPTO_LIB_CURVE25519_GENERIC
962306a36Sopenharmony_ci	select CRYPTO_ARCH_HAVE_LIB_CURVE25519
1062306a36Sopenharmony_ci	help
1162306a36Sopenharmony_ci	  Curve25519 algorithm
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci	  Architecture: arm with
1462306a36Sopenharmony_ci	  - NEON (Advanced SIMD) extensions
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciconfig CRYPTO_GHASH_ARM_CE
1762306a36Sopenharmony_ci	tristate "Hash functions: GHASH (PMULL/NEON/ARMv8 Crypto Extensions)"
1862306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
1962306a36Sopenharmony_ci	select CRYPTO_AEAD
2062306a36Sopenharmony_ci	select CRYPTO_HASH
2162306a36Sopenharmony_ci	select CRYPTO_CRYPTD
2262306a36Sopenharmony_ci	select CRYPTO_LIB_AES
2362306a36Sopenharmony_ci	select CRYPTO_LIB_GF128MUL
2462306a36Sopenharmony_ci	help
2562306a36Sopenharmony_ci	  GCM GHASH function (NIST SP800-38D)
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci	  Architecture: arm using
2862306a36Sopenharmony_ci	  - PMULL (Polynomial Multiply Long) instructions
2962306a36Sopenharmony_ci	  - NEON (Advanced SIMD) extensions
3062306a36Sopenharmony_ci	  - ARMv8 Crypto Extensions
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci	  Use an implementation of GHASH (used by the GCM AEAD chaining mode)
3362306a36Sopenharmony_ci	  that uses the 64x64 to 128 bit polynomial multiplication (vmull.p64)
3462306a36Sopenharmony_ci	  that is part of the ARMv8 Crypto Extensions, or a slower variant that
3562306a36Sopenharmony_ci	  uses the vmull.p8 instruction that is part of the basic NEON ISA.
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ciconfig CRYPTO_NHPOLY1305_NEON
3862306a36Sopenharmony_ci	tristate "Hash functions: NHPoly1305 (NEON)"
3962306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
4062306a36Sopenharmony_ci	select CRYPTO_NHPOLY1305
4162306a36Sopenharmony_ci	help
4262306a36Sopenharmony_ci	  NHPoly1305 hash function (Adiantum)
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci	  Architecture: arm using:
4562306a36Sopenharmony_ci	  - NEON (Advanced SIMD) extensions
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ciconfig CRYPTO_POLY1305_ARM
4862306a36Sopenharmony_ci	tristate "Hash functions: Poly1305 (NEON)"
4962306a36Sopenharmony_ci	select CRYPTO_HASH
5062306a36Sopenharmony_ci	select CRYPTO_ARCH_HAVE_LIB_POLY1305
5162306a36Sopenharmony_ci	help
5262306a36Sopenharmony_ci	  Poly1305 authenticator algorithm (RFC7539)
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci	  Architecture: arm optionally using
5562306a36Sopenharmony_ci	  - NEON (Advanced SIMD) extensions
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ciconfig CRYPTO_BLAKE2S_ARM
5862306a36Sopenharmony_ci	bool "Hash functions: BLAKE2s"
5962306a36Sopenharmony_ci	select CRYPTO_ARCH_HAVE_LIB_BLAKE2S
6062306a36Sopenharmony_ci	help
6162306a36Sopenharmony_ci	  BLAKE2s cryptographic hash function (RFC 7693)
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci	  Architecture: arm
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci	  This is faster than the generic implementations of BLAKE2s and
6662306a36Sopenharmony_ci	  BLAKE2b, but slower than the NEON implementation of BLAKE2b.
6762306a36Sopenharmony_ci	  There is no NEON implementation of BLAKE2s, since NEON doesn't
6862306a36Sopenharmony_ci	  really help with it.
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ciconfig CRYPTO_BLAKE2B_NEON
7162306a36Sopenharmony_ci	tristate "Hash functions: BLAKE2b (NEON)"
7262306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
7362306a36Sopenharmony_ci	select CRYPTO_BLAKE2B
7462306a36Sopenharmony_ci	help
7562306a36Sopenharmony_ci	  BLAKE2b cryptographic hash function (RFC 7693)
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci	  Architecture: arm using
7862306a36Sopenharmony_ci	  - NEON (Advanced SIMD) extensions
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci	  BLAKE2b digest algorithm optimized with ARM NEON instructions.
8162306a36Sopenharmony_ci	  On ARM processors that have NEON support but not the ARMv8
8262306a36Sopenharmony_ci	  Crypto Extensions, typically this BLAKE2b implementation is
8362306a36Sopenharmony_ci	  much faster than the SHA-2 family and slightly faster than
8462306a36Sopenharmony_ci	  SHA-1.
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ciconfig CRYPTO_SHA1_ARM
8762306a36Sopenharmony_ci	tristate "Hash functions: SHA-1"
8862306a36Sopenharmony_ci	select CRYPTO_SHA1
8962306a36Sopenharmony_ci	select CRYPTO_HASH
9062306a36Sopenharmony_ci	help
9162306a36Sopenharmony_ci	  SHA-1 secure hash algorithm (FIPS 180)
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci	  Architecture: arm
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ciconfig CRYPTO_SHA1_ARM_NEON
9662306a36Sopenharmony_ci	tristate "Hash functions: SHA-1 (NEON)"
9762306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
9862306a36Sopenharmony_ci	select CRYPTO_SHA1_ARM
9962306a36Sopenharmony_ci	select CRYPTO_SHA1
10062306a36Sopenharmony_ci	select CRYPTO_HASH
10162306a36Sopenharmony_ci	help
10262306a36Sopenharmony_ci	  SHA-1 secure hash algorithm (FIPS 180)
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci	  Architecture: arm using
10562306a36Sopenharmony_ci	  - NEON (Advanced SIMD) extensions
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ciconfig CRYPTO_SHA1_ARM_CE
10862306a36Sopenharmony_ci	tristate "Hash functions: SHA-1 (ARMv8 Crypto Extensions)"
10962306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
11062306a36Sopenharmony_ci	select CRYPTO_SHA1_ARM
11162306a36Sopenharmony_ci	select CRYPTO_HASH
11262306a36Sopenharmony_ci	help
11362306a36Sopenharmony_ci	  SHA-1 secure hash algorithm (FIPS 180)
11462306a36Sopenharmony_ci
11562306a36Sopenharmony_ci	  Architecture: arm using ARMv8 Crypto Extensions
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ciconfig CRYPTO_SHA2_ARM_CE
11862306a36Sopenharmony_ci	tristate "Hash functions: SHA-224 and SHA-256 (ARMv8 Crypto Extensions)"
11962306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
12062306a36Sopenharmony_ci	select CRYPTO_SHA256_ARM
12162306a36Sopenharmony_ci	select CRYPTO_HASH
12262306a36Sopenharmony_ci	help
12362306a36Sopenharmony_ci	  SHA-224 and SHA-256 secure hash algorithms (FIPS 180)
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci	  Architecture: arm using
12662306a36Sopenharmony_ci	  - ARMv8 Crypto Extensions
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ciconfig CRYPTO_SHA256_ARM
12962306a36Sopenharmony_ci	tristate "Hash functions: SHA-224 and SHA-256 (NEON)"
13062306a36Sopenharmony_ci	select CRYPTO_HASH
13162306a36Sopenharmony_ci	depends on !CPU_V7M
13262306a36Sopenharmony_ci	help
13362306a36Sopenharmony_ci	  SHA-224 and SHA-256 secure hash algorithms (FIPS 180)
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci	  Architecture: arm using
13662306a36Sopenharmony_ci	  - NEON (Advanced SIMD) extensions
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ciconfig CRYPTO_SHA512_ARM
13962306a36Sopenharmony_ci	tristate "Hash functions: SHA-384 and SHA-512 (NEON)"
14062306a36Sopenharmony_ci	select CRYPTO_HASH
14162306a36Sopenharmony_ci	depends on !CPU_V7M
14262306a36Sopenharmony_ci	help
14362306a36Sopenharmony_ci	  SHA-384 and SHA-512 secure hash algorithms (FIPS 180)
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ci	  Architecture: arm using
14662306a36Sopenharmony_ci	  - NEON (Advanced SIMD) extensions
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_ciconfig CRYPTO_AES_ARM
14962306a36Sopenharmony_ci	tristate "Ciphers: AES"
15062306a36Sopenharmony_ci	select CRYPTO_ALGAPI
15162306a36Sopenharmony_ci	select CRYPTO_AES
15262306a36Sopenharmony_ci	help
15362306a36Sopenharmony_ci	  Block ciphers: AES cipher algorithms (FIPS-197)
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci	  Architecture: arm
15662306a36Sopenharmony_ci
15762306a36Sopenharmony_ci	  On ARM processors without the Crypto Extensions, this is the
15862306a36Sopenharmony_ci	  fastest AES implementation for single blocks.  For multiple
15962306a36Sopenharmony_ci	  blocks, the NEON bit-sliced implementation is usually faster.
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci	  This implementation may be vulnerable to cache timing attacks,
16262306a36Sopenharmony_ci	  since it uses lookup tables.  However, as countermeasures it
16362306a36Sopenharmony_ci	  disables IRQs and preloads the tables; it is hoped this makes
16462306a36Sopenharmony_ci	  such attacks very difficult.
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ciconfig CRYPTO_AES_ARM_BS
16762306a36Sopenharmony_ci	tristate "Ciphers: AES, modes: ECB/CBC/CTR/XTS (bit-sliced NEON)"
16862306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
16962306a36Sopenharmony_ci	select CRYPTO_SKCIPHER
17062306a36Sopenharmony_ci	select CRYPTO_LIB_AES
17162306a36Sopenharmony_ci	select CRYPTO_AES
17262306a36Sopenharmony_ci	select CRYPTO_CBC
17362306a36Sopenharmony_ci	select CRYPTO_SIMD
17462306a36Sopenharmony_ci	help
17562306a36Sopenharmony_ci	  Length-preserving ciphers: AES cipher algorithms (FIPS-197)
17662306a36Sopenharmony_ci	  with block cipher modes:
17762306a36Sopenharmony_ci	   - ECB (Electronic Codebook) mode (NIST SP800-38A)
17862306a36Sopenharmony_ci	   - CBC (Cipher Block Chaining) mode (NIST SP800-38A)
17962306a36Sopenharmony_ci	   - CTR (Counter) mode (NIST SP800-38A)
18062306a36Sopenharmony_ci	   - XTS (XOR Encrypt XOR with ciphertext stealing) mode (NIST SP800-38E
18162306a36Sopenharmony_ci	     and IEEE 1619)
18262306a36Sopenharmony_ci
18362306a36Sopenharmony_ci	  Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode
18462306a36Sopenharmony_ci	  and for XTS mode encryption, CBC and XTS mode decryption speedup is
18562306a36Sopenharmony_ci	  around 25%. (CBC encryption speed is not affected by this driver.)
18662306a36Sopenharmony_ci	  This implementation does not rely on any lookup tables so it is
18762306a36Sopenharmony_ci	  believed to be invulnerable to cache timing attacks.
18862306a36Sopenharmony_ci
18962306a36Sopenharmony_ciconfig CRYPTO_AES_ARM_CE
19062306a36Sopenharmony_ci	tristate "Ciphers: AES, modes: ECB/CBC/CTS/CTR/XTS (ARMv8 Crypto Extensions)"
19162306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
19262306a36Sopenharmony_ci	select CRYPTO_SKCIPHER
19362306a36Sopenharmony_ci	select CRYPTO_LIB_AES
19462306a36Sopenharmony_ci	select CRYPTO_SIMD
19562306a36Sopenharmony_ci	help
19662306a36Sopenharmony_ci	  Length-preserving ciphers: AES cipher algorithms (FIPS-197)
19762306a36Sopenharmony_ci	   with block cipher modes:
19862306a36Sopenharmony_ci	   - ECB (Electronic Codebook) mode (NIST SP800-38A)
19962306a36Sopenharmony_ci	   - CBC (Cipher Block Chaining) mode (NIST SP800-38A)
20062306a36Sopenharmony_ci	   - CTR (Counter) mode (NIST SP800-38A)
20162306a36Sopenharmony_ci	   - CTS (Cipher Text Stealing) mode (NIST SP800-38A)
20262306a36Sopenharmony_ci	   - XTS (XOR Encrypt XOR with ciphertext stealing) mode (NIST SP800-38E
20362306a36Sopenharmony_ci	     and IEEE 1619)
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ci	  Architecture: arm using:
20662306a36Sopenharmony_ci	  - ARMv8 Crypto Extensions
20762306a36Sopenharmony_ci
20862306a36Sopenharmony_ciconfig CRYPTO_CHACHA20_NEON
20962306a36Sopenharmony_ci	tristate "Ciphers: ChaCha20, XChaCha20, XChaCha12 (NEON)"
21062306a36Sopenharmony_ci	select CRYPTO_SKCIPHER
21162306a36Sopenharmony_ci	select CRYPTO_ARCH_HAVE_LIB_CHACHA
21262306a36Sopenharmony_ci	help
21362306a36Sopenharmony_ci	  Length-preserving ciphers: ChaCha20, XChaCha20, and XChaCha12
21462306a36Sopenharmony_ci	  stream cipher algorithms
21562306a36Sopenharmony_ci
21662306a36Sopenharmony_ci	  Architecture: arm using:
21762306a36Sopenharmony_ci	  - NEON (Advanced SIMD) extensions
21862306a36Sopenharmony_ci
21962306a36Sopenharmony_ciconfig CRYPTO_CRC32_ARM_CE
22062306a36Sopenharmony_ci	tristate "CRC32C and CRC32"
22162306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
22262306a36Sopenharmony_ci	depends on CRC32
22362306a36Sopenharmony_ci	select CRYPTO_HASH
22462306a36Sopenharmony_ci	help
22562306a36Sopenharmony_ci	  CRC32c CRC algorithm with the iSCSI polynomial (RFC 3385 and RFC 3720)
22662306a36Sopenharmony_ci	  and CRC32 CRC algorithm (IEEE 802.3)
22762306a36Sopenharmony_ci
22862306a36Sopenharmony_ci	  Architecture: arm using:
22962306a36Sopenharmony_ci	  - CRC and/or PMULL instructions
23062306a36Sopenharmony_ci
23162306a36Sopenharmony_ci	  Drivers: crc32-arm-ce and crc32c-arm-ce
23262306a36Sopenharmony_ci
23362306a36Sopenharmony_ciconfig CRYPTO_CRCT10DIF_ARM_CE
23462306a36Sopenharmony_ci	tristate "CRCT10DIF"
23562306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
23662306a36Sopenharmony_ci	depends on CRC_T10DIF
23762306a36Sopenharmony_ci	select CRYPTO_HASH
23862306a36Sopenharmony_ci	help
23962306a36Sopenharmony_ci	  CRC16 CRC algorithm used for the T10 (SCSI) Data Integrity Field (DIF)
24062306a36Sopenharmony_ci
24162306a36Sopenharmony_ci	  Architecture: arm using:
24262306a36Sopenharmony_ci	  - PMULL (Polynomial Multiply Long) instructions
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_ciendmenu
24562306a36Sopenharmony_ci
246