xref: /linux/lib/crypto/Kconfig (revision 39ee3970f26d55b57343da392d45117d7f893205)
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
31*39ee3970SEric Biggers# BLAKE2s support is always built-in, so there's no CRYPTO_LIB_BLAKE2S option.
3266d7fb94SJason A. Donenfeld
33*39ee3970SEric Biggersconfig CRYPTO_LIB_BLAKE2S_ARCH
34*39ee3970SEric Biggers	bool
35*39ee3970SEric Biggers	depends on !UML
36*39ee3970SEric Biggers	default y if ARM
37*39ee3970SEric Biggers	default y if X86_64
3866d7fb94SJason A. Donenfeld
395fb8ef25SArd Biesheuvelconfig CRYPTO_LIB_CHACHA
40edc8e80bSArnd Bergmann	tristate
4113cecc52SEric Biggers	select CRYPTO_LIB_UTILS
425fb8ef25SArd Biesheuvel	help
4313cecc52SEric Biggers	  Enable the ChaCha library interface.  Select this if your module uses
4413cecc52SEric Biggers	  chacha_crypt() or hchacha_block().
4513cecc52SEric Biggers
4613cecc52SEric Biggersconfig CRYPTO_LIB_CHACHA_ARCH
4713cecc52SEric Biggers	bool
4813cecc52SEric Biggers	depends on CRYPTO_LIB_CHACHA && !UML && !KMSAN
4913cecc52SEric Biggers	default y if ARM
5013cecc52SEric Biggers	default y if ARM64 && KERNEL_MODE_NEON
5113cecc52SEric Biggers	default y if MIPS && CPU_MIPS32_R2
5213cecc52SEric Biggers	default y if PPC64 && CPU_LITTLE_ENDIAN && VSX
5313cecc52SEric Biggers	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
5413cecc52SEric Biggers	default y if S390
5513cecc52SEric Biggers	default y if X86_64
565fb8ef25SArd Biesheuvel
570ed42a6fSJason A. Donenfeldconfig CRYPTO_ARCH_HAVE_LIB_CURVE25519
581047e21aSHerbert Xu	bool
590ed42a6fSJason A. Donenfeld	help
600ed42a6fSJason A. Donenfeld	  Declares whether the architecture provides an arch-specific
610ed42a6fSJason A. Donenfeld	  accelerated implementation of the Curve25519 library interface,
620ed42a6fSJason A. Donenfeld	  either builtin or as a module.
630ed42a6fSJason A. Donenfeld
640ed42a6fSJason A. Donenfeldconfig CRYPTO_LIB_CURVE25519_GENERIC
650ed42a6fSJason A. Donenfeld	tristate
6617ec3e71SHerbert Xu	select CRYPTO_LIB_UTILS
670ed42a6fSJason A. Donenfeld	help
680ed42a6fSJason A. Donenfeld	  This symbol can be depended upon by arch implementations of the
690ed42a6fSJason A. Donenfeld	  Curve25519 library interface that require the generic code as a
700ed42a6fSJason A. Donenfeld	  fallback, e.g., for SIMD implementations. If no arch specific
710ed42a6fSJason A. Donenfeld	  implementation is enabled, this implementation serves the users
720ed42a6fSJason A. Donenfeld	  of CRYPTO_LIB_CURVE25519.
730ed42a6fSJason A. Donenfeld
7417ec3e71SHerbert Xuconfig CRYPTO_LIB_CURVE25519_INTERNAL
7517ec3e71SHerbert Xu	tristate
7617ec3e71SHerbert Xu	select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n
7717ec3e71SHerbert Xu
780ed42a6fSJason A. Donenfeldconfig CRYPTO_LIB_CURVE25519
79edc8e80bSArnd Bergmann	tristate
8017ec3e71SHerbert Xu	select CRYPTO
8117ec3e71SHerbert Xu	select CRYPTO_LIB_CURVE25519_INTERNAL
820ed42a6fSJason A. Donenfeld	help
830ed42a6fSJason A. Donenfeld	  Enable the Curve25519 library interface. This interface may be
840ed42a6fSJason A. Donenfeld	  fulfilled by either the generic implementation or an arch-specific
850ed42a6fSJason A. Donenfeld	  one, if one is available and enabled.
860ed42a6fSJason A. Donenfeld
87746b2e02SArd Biesheuvelconfig CRYPTO_LIB_DES
88746b2e02SArd Biesheuvel	tristate
89746b2e02SArd Biesheuvel
90e1644613SEric Biggersconfig CRYPTO_LIB_MD5
91e1644613SEric Biggers	tristate
92e1644613SEric Biggers	help
93e1644613SEric Biggers	  The MD5 and HMAC-MD5 library functions.  Select this if your module
94e1644613SEric Biggers	  uses any of the functions from <crypto/md5.h>.
95e1644613SEric Biggers
96e1644613SEric Biggersconfig CRYPTO_LIB_MD5_ARCH
97e1644613SEric Biggers	bool
98e1644613SEric Biggers	depends on CRYPTO_LIB_MD5 && !UML
99c9e5ac0aSEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
10009371e13SEric Biggers	default y if PPC
101a1848f6eSEric Biggers	default y if SPARC64
102e1644613SEric Biggers
103b646b782SEric Biggersconfig CRYPTO_LIB_POLY1305
104b646b782SEric Biggers	tristate
105b646b782SEric Biggers	help
106b646b782SEric Biggers	  The Poly1305 library functions.  Select this if your module uses any
107b646b782SEric Biggers	  of the functions from <crypto/poly1305.h>.
108b646b782SEric Biggers
109b646b782SEric Biggersconfig CRYPTO_LIB_POLY1305_ARCH
110b646b782SEric Biggers	bool
111b646b782SEric Biggers	depends on CRYPTO_LIB_POLY1305 && !UML
112b646b782SEric Biggers	default y if ARM
113b646b782SEric Biggers	default y if ARM64 && KERNEL_MODE_NEON
114b646b782SEric Biggers	default y if MIPS
115b646b782SEric Biggers	# The PPC64 code needs to be fixed to work in softirq context.
116b646b782SEric Biggers	default y if PPC64 && CPU_LITTLE_ENDIAN && VSX && BROKEN
117bef9c755SZhihang Shao	default y if RISCV
118b646b782SEric Biggers	default y if X86_64
119b646b782SEric Biggers
120b646b782SEric Biggers# This symbol controls the inclusion of the Poly1305 generic code.  This differs
121b646b782SEric Biggers# from most of the other algorithms, which handle the generic code
122b646b782SEric Biggers# "automatically" via __maybe_unused.  This is needed so that the Adiantum code,
123b646b782SEric Biggers# which calls the poly1305_core_*() functions directly, can enable them.
124b646b782SEric Biggersconfig CRYPTO_LIB_POLY1305_GENERIC
125b646b782SEric Biggers	bool
126b646b782SEric Biggers	depends on CRYPTO_LIB_POLY1305
127b646b782SEric Biggers	# Enable if there's no arch impl or the arch impl requires the generic
128b646b782SEric Biggers	# impl as a fallback.  (Or if selected explicitly.)
129b646b782SEric Biggers	default y if !CRYPTO_LIB_POLY1305_ARCH || PPC64
130b646b782SEric Biggers
131a1d93064SArd Biesheuvelconfig CRYPTO_LIB_POLY1305_RSIZE
132a1d93064SArd Biesheuvel	int
133bef9c755SZhihang Shao	default 2 if MIPS || RISCV
134d7d7b853SJason A. Donenfeld	default 11 if X86_64
135a6b803b3SArd Biesheuvel	default 9 if ARM || ARM64
136a1d93064SArd Biesheuvel	default 1
137a1d93064SArd Biesheuvel
138ed20078bSArd Biesheuvelconfig CRYPTO_LIB_CHACHA20POLY1305
139edc8e80bSArnd Bergmann	tristate
140ed20078bSArd Biesheuvel	select CRYPTO_LIB_CHACHA
141ed20078bSArd Biesheuvel	select CRYPTO_LIB_POLY1305
14217ec3e71SHerbert Xu	select CRYPTO_LIB_UTILS
143ed20078bSArd Biesheuvel
144ec8f7f48SEric Biggersconfig CRYPTO_LIB_SHA1
145ec8f7f48SEric Biggers	tristate
14690860aefSEric Biggers	help
147d73915fdSEric Biggers	  The SHA-1 and HMAC-SHA1 library functions.  Select this if your module
148d73915fdSEric Biggers	  uses any of the functions from <crypto/sha1.h>.
14990860aefSEric Biggers
15090860aefSEric Biggersconfig CRYPTO_LIB_SHA1_ARCH
15190860aefSEric Biggers	bool
15290860aefSEric Biggers	depends on CRYPTO_LIB_SHA1 && !UML
15370cb6ca5SEric Biggers	default y if ARM
15400d549bbSEric Biggers	default y if ARM64 && KERNEL_MODE_NEON
155b6ac1dacSEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
1566b9ae8cfSEric Biggers	default y if PPC
157377982d5SEric Biggers	default y if S390
158c7510599SEric Biggers	default y if SPARC64
159f3d6cb3dSEric Biggers	default y if X86_64
160ec8f7f48SEric Biggers
161746b2e02SArd Biesheuvelconfig CRYPTO_LIB_SHA256
162746b2e02SArd Biesheuvel	tristate
163950e5c84SEric Biggers	help
164d73915fdSEric Biggers	  The SHA-224, SHA-256, HMAC-SHA224, and HMAC-SHA256 library functions.
165d73915fdSEric Biggers	  Select this if your module uses any of these functions from
166d73915fdSEric Biggers	  <crypto/sha2.h>.
167950e5c84SEric Biggers
168e96cb950SEric Biggersconfig CRYPTO_LIB_SHA256_ARCH
169950e5c84SEric Biggers	bool
170e96cb950SEric Biggers	depends on CRYPTO_LIB_SHA256 && !UML
171e96cb950SEric Biggers	default y if ARM && !CPU_V7M
172e96cb950SEric Biggers	default y if ARM64
173e96cb950SEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
174e96cb950SEric Biggers	default y if PPC && SPE
175e96cb950SEric Biggers	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
176e96cb950SEric Biggers	default y if S390
177e96cb950SEric Biggers	default y if SPARC64
178e96cb950SEric Biggers	default y if X86_64
1792b31277aSTianjia Zhang
180b693c703SEric Biggersconfig CRYPTO_LIB_SHA512
181b693c703SEric Biggers	tristate
182b693c703SEric Biggers	help
18323e8b437SEric Biggers	  The SHA-384, SHA-512, HMAC-SHA384, and HMAC-SHA512 library functions.
18423e8b437SEric Biggers	  Select this if your module uses any of these functions from
18523e8b437SEric Biggers	  <crypto/sha2.h>.
186b693c703SEric Biggers
187b693c703SEric Biggersconfig CRYPTO_LIB_SHA512_ARCH
188b693c703SEric Biggers	bool
189b693c703SEric Biggers	depends on CRYPTO_LIB_SHA512 && !UML
19024c91b62SEric Biggers	default y if ARM && !CPU_V7M
19160e3f1e9SEric Biggers	default y if ARM64
1927117739aSEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
193b59059a2SEric Biggers	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
194b7b36608SEric Biggers	default y if S390
19502b35babSEric Biggers	default y if SPARC64
196484c1811SEric Biggers	default y if X86_64
197b693c703SEric Biggers
198f4065b2fSHerbert Xuconfig CRYPTO_LIB_SM3
199f4065b2fSHerbert Xu	tristate
200f4065b2fSHerbert Xu
2014dcf6cadSEric Biggerssource "lib/crypto/tests/Kconfig"
2024dcf6cadSEric Biggers
203e56e1898SJustin M. Forbesendmenu
204