xref: /linux/lib/crypto/Kconfig (revision 5abe8d8efc022cc78b6273d01e4a453242b9f4d8)
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
7844e8241cSEric Biggers	default y if ARM && KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
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
1383d176751SEric Biggersconfig CRYPTO_LIB_POLYVAL
1393d176751SEric Biggers	tristate
1403d176751SEric Biggers	help
1413d176751SEric Biggers	  The POLYVAL library functions.  Select this if your module uses any of
1423d176751SEric Biggers	  the functions from <crypto/polyval.h>.
1433d176751SEric Biggers
1443d176751SEric Biggersconfig CRYPTO_LIB_POLYVAL_ARCH
1453d176751SEric Biggers	bool
1463d176751SEric Biggers	depends on CRYPTO_LIB_POLYVAL && !UML
14737919e23SEric Biggers	default y if ARM64 && KERNEL_MODE_NEON
148*4d8da355SEric Biggers	default y if X86_64
1493d176751SEric Biggers
150ed20078bSArd Biesheuvelconfig CRYPTO_LIB_CHACHA20POLY1305
151edc8e80bSArnd Bergmann	tristate
152ed20078bSArd Biesheuvel	select CRYPTO_LIB_CHACHA
153ed20078bSArd Biesheuvel	select CRYPTO_LIB_POLY1305
15417ec3e71SHerbert Xu	select CRYPTO_LIB_UTILS
155ed20078bSArd Biesheuvel
156ec8f7f48SEric Biggersconfig CRYPTO_LIB_SHA1
157ec8f7f48SEric Biggers	tristate
15890860aefSEric Biggers	help
159d73915fdSEric Biggers	  The SHA-1 and HMAC-SHA1 library functions.  Select this if your module
160d73915fdSEric Biggers	  uses any of the functions from <crypto/sha1.h>.
16190860aefSEric Biggers
16290860aefSEric Biggersconfig CRYPTO_LIB_SHA1_ARCH
16390860aefSEric Biggers	bool
16490860aefSEric Biggers	depends on CRYPTO_LIB_SHA1 && !UML
16570cb6ca5SEric Biggers	default y if ARM
16600d549bbSEric Biggers	default y if ARM64 && KERNEL_MODE_NEON
167b6ac1dacSEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
1686b9ae8cfSEric Biggers	default y if PPC
169377982d5SEric Biggers	default y if S390
170c7510599SEric Biggers	default y if SPARC64
171f3d6cb3dSEric Biggers	default y if X86_64
172ec8f7f48SEric Biggers
173746b2e02SArd Biesheuvelconfig CRYPTO_LIB_SHA256
174746b2e02SArd Biesheuvel	tristate
175950e5c84SEric Biggers	help
176d73915fdSEric Biggers	  The SHA-224, SHA-256, HMAC-SHA224, and HMAC-SHA256 library functions.
177d73915fdSEric Biggers	  Select this if your module uses any of these functions from
178d73915fdSEric Biggers	  <crypto/sha2.h>.
179950e5c84SEric Biggers
180e96cb950SEric Biggersconfig CRYPTO_LIB_SHA256_ARCH
181950e5c84SEric Biggers	bool
182e96cb950SEric Biggers	depends on CRYPTO_LIB_SHA256 && !UML
183e96cb950SEric Biggers	default y if ARM && !CPU_V7M
184e96cb950SEric Biggers	default y if ARM64
185e96cb950SEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
186e96cb950SEric Biggers	default y if PPC && SPE
187e96cb950SEric Biggers	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
188e96cb950SEric Biggers	default y if S390
189e96cb950SEric Biggers	default y if SPARC64
190e96cb950SEric Biggers	default y if X86_64
1912b31277aSTianjia Zhang
192b693c703SEric Biggersconfig CRYPTO_LIB_SHA512
193b693c703SEric Biggers	tristate
194b693c703SEric Biggers	help
19523e8b437SEric Biggers	  The SHA-384, SHA-512, HMAC-SHA384, and HMAC-SHA512 library functions.
19623e8b437SEric Biggers	  Select this if your module uses any of these functions from
19723e8b437SEric Biggers	  <crypto/sha2.h>.
198b693c703SEric Biggers
199b693c703SEric Biggersconfig CRYPTO_LIB_SHA512_ARCH
200b693c703SEric Biggers	bool
201b693c703SEric Biggers	depends on CRYPTO_LIB_SHA512 && !UML
20224c91b62SEric Biggers	default y if ARM && !CPU_V7M
20360e3f1e9SEric Biggers	default y if ARM64
2047117739aSEric Biggers	default y if MIPS && CPU_CAVIUM_OCTEON
205b59059a2SEric Biggers	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
206b7b36608SEric Biggers	default y if S390
20702b35babSEric Biggers	default y if SPARC64
208484c1811SEric Biggers	default y if X86_64
209b693c703SEric Biggers
21005934472SDavid Howellsconfig CRYPTO_LIB_SHA3
21105934472SDavid Howells	tristate
21205934472SDavid Howells	select CRYPTO_LIB_UTILS
21305934472SDavid Howells	help
21405934472SDavid Howells	  The SHA3 library functions.  Select this if your module uses any of
21505934472SDavid Howells	  the functions from <crypto/sha3.h>.
21605934472SDavid Howells
2171e29a750SEric Biggersconfig CRYPTO_LIB_SHA3_ARCH
2181e29a750SEric Biggers	bool
2191e29a750SEric Biggers	depends on CRYPTO_LIB_SHA3 && !UML
2201e29a750SEric Biggers	default y if ARM64 && KERNEL_MODE_NEON
22104171105SEric Biggers	default y if S390
2221e29a750SEric Biggers
223f4065b2fSHerbert Xuconfig CRYPTO_LIB_SM3
224f4065b2fSHerbert Xu	tristate
225f4065b2fSHerbert Xu
2264dcf6cadSEric Biggerssource "lib/crypto/tests/Kconfig"
2274dcf6cadSEric Biggers
228e56e1898SJustin M. Forbesendmenu
229