xref: /linux/arch/arm/crypto/Kconfig (revision 1862eb007367f9e4cfd52d0406742de337b28ebf)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2652ccae5SArd Biesheuvel
3652ccae5SArd Biesheuvelmenuconfig ARM_CRYPTO
4652ccae5SArd Biesheuvel	bool "ARM Accelerated Cryptographic Algorithms"
5652ccae5SArd Biesheuvel	depends on ARM
6652ccae5SArd Biesheuvel	help
7652ccae5SArd Biesheuvel	  Say Y here to choose from a selection of cryptographic algorithms
8652ccae5SArd Biesheuvel	  implemented using ARM specific CPU features or instructions.
9652ccae5SArd Biesheuvel
10652ccae5SArd Biesheuvelif ARM_CRYPTO
11652ccae5SArd Biesheuvel
12652ccae5SArd Biesheuvelconfig CRYPTO_SHA1_ARM
13652ccae5SArd Biesheuvel	tristate "SHA1 digest algorithm (ARM-asm)"
14652ccae5SArd Biesheuvel	select CRYPTO_SHA1
15652ccae5SArd Biesheuvel	select CRYPTO_HASH
16652ccae5SArd Biesheuvel	help
17652ccae5SArd Biesheuvel	  SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
18652ccae5SArd Biesheuvel	  using optimized ARM assembler.
19652ccae5SArd Biesheuvel
20652ccae5SArd Biesheuvelconfig CRYPTO_SHA1_ARM_NEON
21652ccae5SArd Biesheuvel	tristate "SHA1 digest algorithm (ARM NEON)"
22652ccae5SArd Biesheuvel	depends on KERNEL_MODE_NEON
23652ccae5SArd Biesheuvel	select CRYPTO_SHA1_ARM
24652ccae5SArd Biesheuvel	select CRYPTO_SHA1
25652ccae5SArd Biesheuvel	select CRYPTO_HASH
26652ccae5SArd Biesheuvel	help
27652ccae5SArd Biesheuvel	  SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
28652ccae5SArd Biesheuvel	  using optimized ARM NEON assembly, when NEON instructions are
29652ccae5SArd Biesheuvel	  available.
30652ccae5SArd Biesheuvel
31864cbeedSArd Biesheuvelconfig CRYPTO_SHA1_ARM_CE
32864cbeedSArd Biesheuvel	tristate "SHA1 digest algorithm (ARM v8 Crypto Extensions)"
335429ef62SWill Deacon	depends on KERNEL_MODE_NEON
34864cbeedSArd Biesheuvel	select CRYPTO_SHA1_ARM
35864cbeedSArd Biesheuvel	select CRYPTO_HASH
36864cbeedSArd Biesheuvel	help
37864cbeedSArd Biesheuvel	  SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
38864cbeedSArd Biesheuvel	  using special ARMv8 Crypto Extensions.
39864cbeedSArd Biesheuvel
40006d0624SArd Biesheuvelconfig CRYPTO_SHA2_ARM_CE
41006d0624SArd Biesheuvel	tristate "SHA-224/256 digest algorithm (ARM v8 Crypto Extensions)"
425429ef62SWill Deacon	depends on KERNEL_MODE_NEON
439205b949SArd Biesheuvel	select CRYPTO_SHA256_ARM
44006d0624SArd Biesheuvel	select CRYPTO_HASH
45006d0624SArd Biesheuvel	help
46006d0624SArd Biesheuvel	  SHA-256 secure hash standard (DFIPS 180-2) implemented
47006d0624SArd Biesheuvel	  using special ARMv8 Crypto Extensions.
48006d0624SArd Biesheuvel
49f2f770d7SSami Tolvanenconfig CRYPTO_SHA256_ARM
50f2f770d7SSami Tolvanen	tristate "SHA-224/256 digest algorithm (ARM-asm and NEON)"
51f2f770d7SSami Tolvanen	select CRYPTO_HASH
52b48321deSArnd Bergmann	depends on !CPU_V7M
53f2f770d7SSami Tolvanen	help
54f2f770d7SSami Tolvanen	  SHA-256 secure hash standard (DFIPS 180-2) implemented
55f2f770d7SSami Tolvanen	  using optimized ARM assembler and NEON, when available.
56f2f770d7SSami Tolvanen
57c80ae7caSArd Biesheuvelconfig CRYPTO_SHA512_ARM
58c80ae7caSArd Biesheuvel	tristate "SHA-384/512 digest algorithm (ARM-asm and NEON)"
59652ccae5SArd Biesheuvel	select CRYPTO_HASH
60c80ae7caSArd Biesheuvel	depends on !CPU_V7M
61652ccae5SArd Biesheuvel	help
62652ccae5SArd Biesheuvel	  SHA-512 secure hash standard (DFIPS 180-2) implemented
63c80ae7caSArd Biesheuvel	  using optimized ARM assembler and NEON, when available.
64652ccae5SArd Biesheuvel
655172d322SEric Biggersconfig CRYPTO_BLAKE2S_ARM
665172d322SEric Biggers	tristate "BLAKE2s digest algorithm (ARM)"
675172d322SEric Biggers	select CRYPTO_ARCH_HAVE_LIB_BLAKE2S
685172d322SEric Biggers	help
695172d322SEric Biggers	  BLAKE2s digest algorithm optimized with ARM scalar instructions.  This
705172d322SEric Biggers	  is faster than the generic implementations of BLAKE2s and BLAKE2b, but
715172d322SEric Biggers	  slower than the NEON implementation of BLAKE2b.  (There is no NEON
725172d322SEric Biggers	  implementation of BLAKE2s, since NEON doesn't really help with it.)
735172d322SEric Biggers
74*1862eb00SEric Biggersconfig CRYPTO_BLAKE2B_NEON
75*1862eb00SEric Biggers	tristate "BLAKE2b digest algorithm (ARM NEON)"
76*1862eb00SEric Biggers	depends on KERNEL_MODE_NEON
77*1862eb00SEric Biggers	select CRYPTO_BLAKE2B
78*1862eb00SEric Biggers	help
79*1862eb00SEric Biggers	  BLAKE2b digest algorithm optimized with ARM NEON instructions.
80*1862eb00SEric Biggers	  On ARM processors that have NEON support but not the ARMv8
81*1862eb00SEric Biggers	  Crypto Extensions, typically this BLAKE2b implementation is
82*1862eb00SEric Biggers	  much faster than SHA-2 and slightly faster than SHA-1.
83*1862eb00SEric Biggers
84652ccae5SArd Biesheuvelconfig CRYPTO_AES_ARM
8581edb426SArd Biesheuvel	tristate "Scalar AES cipher for ARM"
86652ccae5SArd Biesheuvel	select CRYPTO_ALGAPI
87652ccae5SArd Biesheuvel	select CRYPTO_AES
88652ccae5SArd Biesheuvel	help
89652ccae5SArd Biesheuvel	  Use optimized AES assembler routines for ARM platforms.
90652ccae5SArd Biesheuvel
91913a3aa0SEric Biggers	  On ARM processors without the Crypto Extensions, this is the
92913a3aa0SEric Biggers	  fastest AES implementation for single blocks.  For multiple
93913a3aa0SEric Biggers	  blocks, the NEON bit-sliced implementation is usually faster.
94913a3aa0SEric Biggers
95913a3aa0SEric Biggers	  This implementation may be vulnerable to cache timing attacks,
96913a3aa0SEric Biggers	  since it uses lookup tables.  However, as countermeasures it
97913a3aa0SEric Biggers	  disables IRQs and preloads the tables; it is hoped this makes
98913a3aa0SEric Biggers	  such attacks very difficult.
99913a3aa0SEric Biggers
100652ccae5SArd Biesheuvelconfig CRYPTO_AES_ARM_BS
101652ccae5SArd Biesheuvel	tristate "Bit sliced AES using NEON instructions"
102652ccae5SArd Biesheuvel	depends on KERNEL_MODE_NEON
103b95bba5dSEric Biggers	select CRYPTO_SKCIPHER
104aa6e2d2bSArd Biesheuvel	select CRYPTO_LIB_AES
1056fdf436fSHerbert Xu	select CRYPTO_SIMD
106652ccae5SArd Biesheuvel	help
107652ccae5SArd Biesheuvel	  Use a faster and more secure NEON based implementation of AES in CBC,
108652ccae5SArd Biesheuvel	  CTR and XTS modes
109652ccae5SArd Biesheuvel
110652ccae5SArd Biesheuvel	  Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode
111652ccae5SArd Biesheuvel	  and for XTS mode encryption, CBC and XTS mode decryption speedup is
112652ccae5SArd Biesheuvel	  around 25%. (CBC encryption speed is not affected by this driver.)
113652ccae5SArd Biesheuvel	  This implementation does not rely on any lookup tables so it is
114652ccae5SArd Biesheuvel	  believed to be invulnerable to cache timing attacks.
115652ccae5SArd Biesheuvel
11686464859SArd Biesheuvelconfig CRYPTO_AES_ARM_CE
11786464859SArd Biesheuvel	tristate "Accelerated AES using ARMv8 Crypto Extensions"
1185429ef62SWill Deacon	depends on KERNEL_MODE_NEON
119b95bba5dSEric Biggers	select CRYPTO_SKCIPHER
120f703964fSArd Biesheuvel	select CRYPTO_LIB_AES
121585b5fa6SHerbert Xu	select CRYPTO_SIMD
12286464859SArd Biesheuvel	help
12386464859SArd Biesheuvel	  Use an implementation of AES in CBC, CTR and XTS modes that uses
12486464859SArd Biesheuvel	  ARMv8 Crypto Extensions
12586464859SArd Biesheuvel
126f1e866b1SArd Biesheuvelconfig CRYPTO_GHASH_ARM_CE
1273759ee05SArd Biesheuvel	tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions"
1285429ef62SWill Deacon	depends on KERNEL_MODE_NEON
129f1e866b1SArd Biesheuvel	select CRYPTO_HASH
130f1e866b1SArd Biesheuvel	select CRYPTO_CRYPTD
13100227e3aSArd Biesheuvel	select CRYPTO_GF128MUL
132f1e866b1SArd Biesheuvel	help
133f1e866b1SArd Biesheuvel	  Use an implementation of GHASH (used by the GCM AEAD chaining mode)
134f1e866b1SArd Biesheuvel	  that uses the 64x64 to 128 bit polynomial multiplication (vmull.p64)
1353759ee05SArd Biesheuvel	  that is part of the ARMv8 Crypto Extensions, or a slower variant that
1363759ee05SArd Biesheuvel	  uses the vmull.p8 instruction that is part of the basic NEON ISA.
137f1e866b1SArd Biesheuvel
1381d481f1cSArd Biesheuvelconfig CRYPTO_CRCT10DIF_ARM_CE
1391d481f1cSArd Biesheuvel	tristate "CRCT10DIF digest algorithm using PMULL instructions"
1405429ef62SWill Deacon	depends on KERNEL_MODE_NEON
141b4d0c0aaSArd Biesheuvel	depends on CRC_T10DIF
1421d481f1cSArd Biesheuvel	select CRYPTO_HASH
1431d481f1cSArd Biesheuvel
144d0a3431aSArd Biesheuvelconfig CRYPTO_CRC32_ARM_CE
145d0a3431aSArd Biesheuvel	tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions"
1465429ef62SWill Deacon	depends on KERNEL_MODE_NEON
147b4d0c0aaSArd Biesheuvel	depends on CRC32
148d0a3431aSArd Biesheuvel	select CRYPTO_HASH
149d0a3431aSArd Biesheuvel
150afaf712eSArd Biesheuvelconfig CRYPTO_CHACHA20_NEON
151b36d8c09SArd Biesheuvel	tristate "NEON and scalar accelerated ChaCha stream cipher algorithms"
152b95bba5dSEric Biggers	select CRYPTO_SKCIPHER
153a44a3430SArd Biesheuvel	select CRYPTO_ARCH_HAVE_LIB_CHACHA
154afaf712eSArd Biesheuvel
155a6b803b3SArd Biesheuvelconfig CRYPTO_POLY1305_ARM
156a6b803b3SArd Biesheuvel	tristate "Accelerated scalar and SIMD Poly1305 hash implementations"
157a6b803b3SArd Biesheuvel	select CRYPTO_HASH
158a6b803b3SArd Biesheuvel	select CRYPTO_ARCH_HAVE_LIB_POLY1305
159652ccae5SArd Biesheuvel
16016aae359SEric Biggersconfig CRYPTO_NHPOLY1305_NEON
16116aae359SEric Biggers	tristate "NEON accelerated NHPoly1305 hash function (for Adiantum)"
16216aae359SEric Biggers	depends on KERNEL_MODE_NEON
16316aae359SEric Biggers	select CRYPTO_NHPOLY1305
16416aae359SEric Biggers
165d8f1308aSJason A. Donenfeldconfig CRYPTO_CURVE25519_NEON
166d8f1308aSJason A. Donenfeld	tristate "NEON accelerated Curve25519 scalar multiplication library"
167d8f1308aSJason A. Donenfeld	depends on KERNEL_MODE_NEON
168d8f1308aSJason A. Donenfeld	select CRYPTO_LIB_CURVE25519_GENERIC
169d8f1308aSJason A. Donenfeld	select CRYPTO_ARCH_HAVE_LIB_CURVE25519
170d8f1308aSJason A. Donenfeld
171652ccae5SArd Biesheuvelendif
172