xref: /linux/lib/crypto/Kconfig (revision c9e5ac0ab9d1235f1a91852ec3d3c5c5f3e8ba0e)
1746b2e02SArd Biesheuvel# SPDX-License-Identifier: GPL-2.0
2746b2e02SArd Biesheuvel
3e56e1898SJustin M. Forbesmenu "Crypto library routines"
4e56e1898SJustin M. Forbes
5aacb37f5SEric Biggersconfig CRYPTO_HASH_INFO
6aacb37f5SEric Biggers	bool
7aacb37f5SEric Biggers
87033b937SEric Biggersconfig CRYPTO_LIB_UTILS
97033b937SEric Biggers	tristate
107033b937SEric Biggers
11746b2e02SArd Biesheuvelconfig CRYPTO_LIB_AES
12746b2e02SArd Biesheuvel	tristate
13746b2e02SArd Biesheuvel
14f1354404SArd Biesheuvelconfig CRYPTO_LIB_AESCFB
15f1354404SArd Biesheuvel	tristate
16f1354404SArd Biesheuvel	select CRYPTO_LIB_AES
17f1354404SArd Biesheuvel	select CRYPTO_LIB_UTILS
18f1354404SArd Biesheuvel
19520af5daSArd Biesheuvelconfig CRYPTO_LIB_AESGCM
20520af5daSArd Biesheuvel	tristate
21520af5daSArd Biesheuvel	select CRYPTO_LIB_AES
22520af5daSArd Biesheuvel	select CRYPTO_LIB_GF128MUL
23520af5daSArd Biesheuvel	select CRYPTO_LIB_UTILS
24520af5daSArd Biesheuvel
25746b2e02SArd Biesheuvelconfig CRYPTO_LIB_ARC4
26746b2e02SArd Biesheuvel	tristate
27746b2e02SArd Biesheuvel
2861c581a4SArd Biesheuvelconfig CRYPTO_LIB_GF128MUL
2961c581a4SArd Biesheuvel	tristate
3061c581a4SArd Biesheuvel
3166d7fb94SJason A. Donenfeldconfig CRYPTO_ARCH_HAVE_LIB_BLAKE2S
326048fdccSJason A. Donenfeld	bool
3366d7fb94SJason A. Donenfeld	help
3466d7fb94SJason A. Donenfeld	  Declares whether the architecture provides an arch-specific
3566d7fb94SJason A. Donenfeld	  accelerated implementation of the Blake2s library interface,
3666d7fb94SJason A. Donenfeld	  either builtin or as a module.
3766d7fb94SJason A. Donenfeld
3866d7fb94SJason A. Donenfeldconfig CRYPTO_LIB_BLAKE2S_GENERIC
396048fdccSJason A. Donenfeld	def_bool !CRYPTO_ARCH_HAVE_LIB_BLAKE2S
4066d7fb94SJason A. Donenfeld	help
4166d7fb94SJason A. Donenfeld	  This symbol can be depended upon by arch implementations of the
4266d7fb94SJason A. Donenfeld	  Blake2s library interface that require the generic code as a
4366d7fb94SJason A. Donenfeld	  fallback, e.g., for SIMD implementations. If no arch specific
4466d7fb94SJason A. Donenfeld	  implementation is enabled, this implementation serves the users
4566d7fb94SJason A. Donenfeld	  of CRYPTO_LIB_BLAKE2S.
4666d7fb94SJason A. Donenfeld
475fb8ef25SArd Biesheuvelconfig CRYPTO_ARCH_HAVE_LIB_CHACHA
481047e21aSHerbert Xu	bool
495fb8ef25SArd Biesheuvel	help
505fb8ef25SArd Biesheuvel	  Declares whether the architecture provides an arch-specific
515fb8ef25SArd Biesheuvel	  accelerated implementation of the ChaCha library interface,
525fb8ef25SArd Biesheuvel	  either builtin or as a module.
535fb8ef25SArd Biesheuvel
545fb8ef25SArd Biesheuvelconfig CRYPTO_LIB_CHACHA_GENERIC
555fb8ef25SArd Biesheuvel	tristate
56879f4754SEric Biggers	default CRYPTO_LIB_CHACHA if !CRYPTO_ARCH_HAVE_LIB_CHACHA
576e78ad0bSEric Biggers	select CRYPTO_LIB_UTILS
585fb8ef25SArd Biesheuvel	help
59879f4754SEric Biggers	  This symbol can be selected by arch implementations of the ChaCha
60879f4754SEric Biggers	  library interface that require the generic code as a fallback, e.g.,
61879f4754SEric Biggers	  for SIMD implementations. If no arch specific implementation is
62879f4754SEric Biggers	  enabled, this implementation serves the users of CRYPTO_LIB_CHACHA.
6317ec3e71SHerbert Xu
645fb8ef25SArd Biesheuvelconfig CRYPTO_LIB_CHACHA
65edc8e80bSArnd Bergmann	tristate
665fb8ef25SArd Biesheuvel	help
675fb8ef25SArd Biesheuvel	  Enable the ChaCha library interface. This interface may be fulfilled
685fb8ef25SArd Biesheuvel	  by either the generic implementation or an arch-specific one, if one
695fb8ef25SArd Biesheuvel	  is available and enabled.
705fb8ef25SArd Biesheuvel
710ed42a6fSJason A. Donenfeldconfig CRYPTO_ARCH_HAVE_LIB_CURVE25519
721047e21aSHerbert Xu	bool
730ed42a6fSJason A. Donenfeld	help
740ed42a6fSJason A. Donenfeld	  Declares whether the architecture provides an arch-specific
750ed42a6fSJason A. Donenfeld	  accelerated implementation of the Curve25519 library interface,
760ed42a6fSJason A. Donenfeld	  either builtin or as a module.
770ed42a6fSJason A. Donenfeld
780ed42a6fSJason A. Donenfeldconfig CRYPTO_LIB_CURVE25519_GENERIC
790ed42a6fSJason A. Donenfeld	tristate
8017ec3e71SHerbert Xu	select CRYPTO_LIB_UTILS
810ed42a6fSJason A. Donenfeld	help
820ed42a6fSJason A. Donenfeld	  This symbol can be depended upon by arch implementations of the
830ed42a6fSJason A. Donenfeld	  Curve25519 library interface that require the generic code as a
840ed42a6fSJason A. Donenfeld	  fallback, e.g., for SIMD implementations. If no arch specific
850ed42a6fSJason A. Donenfeld	  implementation is enabled, this implementation serves the users
860ed42a6fSJason A. Donenfeld	  of CRYPTO_LIB_CURVE25519.
870ed42a6fSJason A. Donenfeld
8817ec3e71SHerbert Xuconfig CRYPTO_LIB_CURVE25519_INTERNAL
8917ec3e71SHerbert Xu	tristate
9017ec3e71SHerbert Xu	select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n
9117ec3e71SHerbert Xu
920ed42a6fSJason A. Donenfeldconfig CRYPTO_LIB_CURVE25519
93edc8e80bSArnd Bergmann	tristate
9417ec3e71SHerbert Xu	select CRYPTO
9517ec3e71SHerbert Xu	select CRYPTO_LIB_CURVE25519_INTERNAL
960ed42a6fSJason A. Donenfeld	help
970ed42a6fSJason A. Donenfeld	  Enable the Curve25519 library interface. This interface may be
980ed42a6fSJason A. Donenfeld	  fulfilled by either the generic implementation or an arch-specific
990ed42a6fSJason A. Donenfeld	  one, if one is available and enabled.
1000ed42a6fSJason A. Donenfeld
101746b2e02SArd Biesheuvelconfig CRYPTO_LIB_DES
102746b2e02SArd Biesheuvel	tristate
103746b2e02SArd Biesheuvel
104e1644613SEric Biggersconfig CRYPTO_LIB_MD5
105e1644613SEric Biggers	tristate
106e1644613SEric Biggers	help
107e1644613SEric Biggers	  The MD5 and HMAC-MD5 library functions.  Select this if your module
108e1644613SEric Biggers	  uses any of the functions from <crypto/md5.h>.
109e1644613SEric Biggers
110e1644613SEric Biggersconfig CRYPTO_LIB_MD5_ARCH
111e1644613SEric Biggers	bool
112e1644613SEric Biggers	depends on CRYPTO_LIB_MD5 && !UML
113*c9e5ac0aSEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
114e1644613SEric Biggers
115a1d93064SArd Biesheuvelconfig CRYPTO_LIB_POLY1305_RSIZE
116a1d93064SArd Biesheuvel	int
117a11d055eSArd Biesheuvel	default 2 if MIPS
118d7d7b853SJason A. Donenfeld	default 11 if X86_64
119a6b803b3SArd Biesheuvel	default 9 if ARM || ARM64
120a1d93064SArd Biesheuvel	default 1
121a1d93064SArd Biesheuvel
122a1d93064SArd Biesheuvelconfig CRYPTO_ARCH_HAVE_LIB_POLY1305
1231047e21aSHerbert Xu	bool
124a1d93064SArd Biesheuvel	help
125a1d93064SArd Biesheuvel	  Declares whether the architecture provides an arch-specific
126a1d93064SArd Biesheuvel	  accelerated implementation of the Poly1305 library interface,
127a1d93064SArd Biesheuvel	  either builtin or as a module.
128a1d93064SArd Biesheuvel
12948ea8c6eSArd Biesheuvelconfig CRYPTO_LIB_POLY1305_GENERIC
13048ea8c6eSArd Biesheuvel	tristate
131af9ce627SEric Biggers	default CRYPTO_LIB_POLY1305 if !CRYPTO_ARCH_HAVE_LIB_POLY1305
132a1d93064SArd Biesheuvel	help
133af9ce627SEric Biggers	  This symbol can be selected by arch implementations of the Poly1305
134af9ce627SEric Biggers	  library interface that require the generic code as a fallback, e.g.,
135af9ce627SEric Biggers	  for SIMD implementations. If no arch specific implementation is
136af9ce627SEric Biggers	  enabled, this implementation serves the users of CRYPTO_LIB_POLY1305.
13717ec3e71SHerbert Xu
138a1d93064SArd Biesheuvelconfig CRYPTO_LIB_POLY1305
139edc8e80bSArnd Bergmann	tristate
140a1d93064SArd Biesheuvel	help
141a1d93064SArd Biesheuvel	  Enable the Poly1305 library interface. This interface may be fulfilled
142a1d93064SArd Biesheuvel	  by either the generic implementation or an arch-specific one, if one
143a1d93064SArd Biesheuvel	  is available and enabled.
14448ea8c6eSArd Biesheuvel
145ed20078bSArd Biesheuvelconfig CRYPTO_LIB_CHACHA20POLY1305
146edc8e80bSArnd Bergmann	tristate
147ed20078bSArd Biesheuvel	select CRYPTO_LIB_CHACHA
148ed20078bSArd Biesheuvel	select CRYPTO_LIB_POLY1305
14917ec3e71SHerbert Xu	select CRYPTO_LIB_UTILS
150ed20078bSArd Biesheuvel
151ec8f7f48SEric Biggersconfig CRYPTO_LIB_SHA1
152ec8f7f48SEric Biggers	tristate
15390860aefSEric Biggers	help
154d73915fdSEric Biggers	  The SHA-1 and HMAC-SHA1 library functions.  Select this if your module
155d73915fdSEric Biggers	  uses any of the functions from <crypto/sha1.h>.
15690860aefSEric Biggers
15790860aefSEric Biggersconfig CRYPTO_LIB_SHA1_ARCH
15890860aefSEric Biggers	bool
15990860aefSEric Biggers	depends on CRYPTO_LIB_SHA1 && !UML
16070cb6ca5SEric Biggers	default y if ARM
16100d549bbSEric Biggers	default y if ARM64 && KERNEL_MODE_NEON
162b6ac1dacSEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
1636b9ae8cfSEric Biggers	default y if PPC
164377982d5SEric Biggers	default y if S390
165c7510599SEric Biggers	default y if SPARC64
166f3d6cb3dSEric Biggers	default y if X86_64
167ec8f7f48SEric Biggers
168746b2e02SArd Biesheuvelconfig CRYPTO_LIB_SHA256
169746b2e02SArd Biesheuvel	tristate
170950e5c84SEric Biggers	help
171d73915fdSEric Biggers	  The SHA-224, SHA-256, HMAC-SHA224, and HMAC-SHA256 library functions.
172d73915fdSEric Biggers	  Select this if your module uses any of these functions from
173d73915fdSEric Biggers	  <crypto/sha2.h>.
174950e5c84SEric Biggers
175e96cb950SEric Biggersconfig CRYPTO_LIB_SHA256_ARCH
176950e5c84SEric Biggers	bool
177e96cb950SEric Biggers	depends on CRYPTO_LIB_SHA256 && !UML
178e96cb950SEric Biggers	default y if ARM && !CPU_V7M
179e96cb950SEric Biggers	default y if ARM64
180e96cb950SEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
181e96cb950SEric Biggers	default y if PPC && SPE
182e96cb950SEric Biggers	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
183e96cb950SEric Biggers	default y if S390
184e96cb950SEric Biggers	default y if SPARC64
185e96cb950SEric Biggers	default y if X86_64
1862b31277aSTianjia Zhang
187b693c703SEric Biggersconfig CRYPTO_LIB_SHA512
188b693c703SEric Biggers	tristate
189b693c703SEric Biggers	help
19023e8b437SEric Biggers	  The SHA-384, SHA-512, HMAC-SHA384, and HMAC-SHA512 library functions.
19123e8b437SEric Biggers	  Select this if your module uses any of these functions from
19223e8b437SEric Biggers	  <crypto/sha2.h>.
193b693c703SEric Biggers
194b693c703SEric Biggersconfig CRYPTO_LIB_SHA512_ARCH
195b693c703SEric Biggers	bool
196b693c703SEric Biggers	depends on CRYPTO_LIB_SHA512 && !UML
19724c91b62SEric Biggers	default y if ARM && !CPU_V7M
19860e3f1e9SEric Biggers	default y if ARM64
1997117739aSEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
200b59059a2SEric Biggers	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
201b7b36608SEric Biggers	default y if S390
20202b35babSEric Biggers	default y if SPARC64
203484c1811SEric Biggers	default y if X86_64
204b693c703SEric Biggers
205f4065b2fSHerbert Xuconfig CRYPTO_LIB_SM3
206f4065b2fSHerbert Xu	tristate
207f4065b2fSHerbert Xu
2084dcf6cadSEric Biggerssource "lib/crypto/tests/Kconfig"
2094dcf6cadSEric Biggers
210714656a8SEric Biggersif !KMSAN # avoid false positives from assembly
211714656a8SEric Biggersif ARM
2124a32e5dcSEric Biggerssource "lib/crypto/arm/Kconfig"
213714656a8SEric Biggersendif
214cc16e228SEric Biggersif ARM64
21561f86c70SEric Biggerssource "lib/crypto/arm64/Kconfig"
216cc16e228SEric Biggersendif
217939a54acSEric Biggersif MIPS
2187e54e993SEric Biggerssource "lib/crypto/mips/Kconfig"
219939a54acSEric Biggersendif
220f9f86c03SEric Biggersif PPC
221676d45abSEric Biggerssource "lib/crypto/powerpc/Kconfig"
222f9f86c03SEric Biggersendif
223d604877cSEric Biggersif RISCV
224daed4fcfSEric Biggerssource "lib/crypto/riscv/Kconfig"
225d604877cSEric Biggersendif
2263ea91323SEric Biggersif S390
227b8456f7aSEric Biggerssource "lib/crypto/s390/Kconfig"
2283ea91323SEric Biggersendif
229c7c18c94SEric Biggersif X86
23074750aa7SEric Biggerssource "lib/crypto/x86/Kconfig"
231c7c18c94SEric Biggersendif
232714656a8SEric Biggersendif
233714656a8SEric Biggers
234e56e1898SJustin M. Forbesendmenu
235