xref: /linux/lib/crypto/Kconfig (revision 1e29a750572a25200fcea995d91e5f6448f340c0)
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
3123a16c95SEric Biggersconfig CRYPTO_LIB_BLAKE2B
3223a16c95SEric Biggers	tristate
3323a16c95SEric Biggers	help
3423a16c95SEric Biggers	  The BLAKE2b library functions.  Select this if your module uses any of
3523a16c95SEric Biggers	  the functions from <crypto/blake2b.h>.
3623a16c95SEric Biggers
3723a16c95SEric Biggersconfig CRYPTO_LIB_BLAKE2B_ARCH
3823a16c95SEric Biggers	bool
3923a16c95SEric Biggers	depends on CRYPTO_LIB_BLAKE2B && !UML
40ba6617bdSEric Biggers	default y if ARM && KERNEL_MODE_NEON
4123a16c95SEric Biggers
4239ee3970SEric Biggers# BLAKE2s support is always built-in, so there's no CRYPTO_LIB_BLAKE2S option.
4366d7fb94SJason A. Donenfeld
4439ee3970SEric Biggersconfig CRYPTO_LIB_BLAKE2S_ARCH
4539ee3970SEric Biggers	bool
4639ee3970SEric Biggers	depends on !UML
4739ee3970SEric Biggers	default y if ARM
4839ee3970SEric Biggers	default y if X86_64
4966d7fb94SJason A. Donenfeld
505fb8ef25SArd Biesheuvelconfig CRYPTO_LIB_CHACHA
51edc8e80bSArnd Bergmann	tristate
5213cecc52SEric Biggers	select CRYPTO_LIB_UTILS
535fb8ef25SArd Biesheuvel	help
5413cecc52SEric Biggers	  Enable the ChaCha library interface.  Select this if your module uses
5513cecc52SEric Biggers	  chacha_crypt() or hchacha_block().
5613cecc52SEric Biggers
5713cecc52SEric Biggersconfig CRYPTO_LIB_CHACHA_ARCH
5813cecc52SEric Biggers	bool
5913cecc52SEric Biggers	depends on CRYPTO_LIB_CHACHA && !UML && !KMSAN
6013cecc52SEric Biggers	default y if ARM
6113cecc52SEric Biggers	default y if ARM64 && KERNEL_MODE_NEON
6213cecc52SEric Biggers	default y if MIPS && CPU_MIPS32_R2
6313cecc52SEric Biggers	default y if PPC64 && CPU_LITTLE_ENDIAN && VSX
6413cecc52SEric Biggers	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
6513cecc52SEric Biggers	default y if S390
6613cecc52SEric Biggers	default y if X86_64
675fb8ef25SArd Biesheuvel
6868546e56SEric Biggersconfig CRYPTO_LIB_CURVE25519
690ed42a6fSJason A. Donenfeld	tristate
7017ec3e71SHerbert Xu	select CRYPTO_LIB_UTILS
710ed42a6fSJason A. Donenfeld	help
7268546e56SEric Biggers	  The Curve25519 library functions.  Select this if your module uses any
7368546e56SEric Biggers	  of the functions from <crypto/curve25519.h>.
740ed42a6fSJason A. Donenfeld
7568546e56SEric Biggersconfig CRYPTO_LIB_CURVE25519_ARCH
7668546e56SEric Biggers	bool
7768546e56SEric Biggers	depends on CRYPTO_LIB_CURVE25519 && !UML && !KMSAN
7868546e56SEric Biggers	default y if ARM && KERNEL_MODE_NEON
7968546e56SEric Biggers	default y if PPC64 && CPU_LITTLE_ENDIAN
8068546e56SEric Biggers	default y if X86_64
8117ec3e71SHerbert Xu
8268546e56SEric Biggersconfig CRYPTO_LIB_CURVE25519_GENERIC
8368546e56SEric Biggers	bool
8468546e56SEric Biggers	depends on CRYPTO_LIB_CURVE25519
8568546e56SEric Biggers	default y if !CRYPTO_LIB_CURVE25519_ARCH || ARM || X86_64
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
1111af424b1SEric Biggers	depends on CRYPTO_LIB_POLY1305 && !UML && !KMSAN
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
19805934472SDavid Howellsconfig CRYPTO_LIB_SHA3
19905934472SDavid Howells	tristate
20005934472SDavid Howells	select CRYPTO_LIB_UTILS
20105934472SDavid Howells	help
20205934472SDavid Howells	  The SHA3 library functions.  Select this if your module uses any of
20305934472SDavid Howells	  the functions from <crypto/sha3.h>.
20405934472SDavid Howells
205*1e29a750SEric Biggersconfig CRYPTO_LIB_SHA3_ARCH
206*1e29a750SEric Biggers	bool
207*1e29a750SEric Biggers	depends on CRYPTO_LIB_SHA3 && !UML
208*1e29a750SEric Biggers	default y if ARM64 && KERNEL_MODE_NEON
209*1e29a750SEric Biggers
210f4065b2fSHerbert Xuconfig CRYPTO_LIB_SM3
211f4065b2fSHerbert Xu	tristate
212f4065b2fSHerbert Xu
2134dcf6cadSEric Biggerssource "lib/crypto/tests/Kconfig"
2144dcf6cadSEric Biggers
215e56e1898SJustin M. Forbesendmenu
216