xref: /linux/lib/crypto/Kconfig (revision 539436435fbe3954f98325f5ffee0b0c4057aaad)
1# SPDX-License-Identifier: GPL-2.0
2
3config CRYPTO_HASH_INFO
4	bool
5
6config CRYPTO_LIB_UTILS
7	tristate
8
9config CRYPTO_LIB_AES
10	tristate
11	# Select dependencies of modes that are part of libaes.
12	select CRYPTO_LIB_GF128HASH if CRYPTO_LIB_AES_GCM != n
13	select CRYPTO_LIB_UTILS
14
15config CRYPTO_LIB_AES_ARCH
16	bool
17	depends on CRYPTO_LIB_AES && !UML && !KMSAN
18	default y if ARM
19	default y if ARM64
20	default y if PPC && (SPE || (PPC64 && VSX))
21	default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
22		     RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
23	default y if S390
24	default y if SPARC64
25	default y if X86
26
27config CRYPTO_LIB_AESCFB
28	tristate
29	select CRYPTO_LIB_AES
30	select CRYPTO_LIB_UTILS
31
32config CRYPTO_LIB_AES_CBC
33	tristate
34	select CRYPTO_LIB_AES
35	help
36	  The AES-CBC and AES-CBC-CTS library functions.
37
38config CRYPTO_LIB_AES_CBC_MACS
39	tristate
40	select CRYPTO_LIB_AES
41	help
42	  The AES-CMAC, AES-XCBC-MAC, and AES-CBC-MAC library functions.  Select
43	  this if your module uses any of the functions from
44	  <crypto/aes-cbc-macs.h>.
45
46config CRYPTO_LIB_AES_CCM
47	tristate
48	select CRYPTO_LIB_AES
49	select CRYPTO_LIB_AES_CBC_MACS
50	select CRYPTO_LIB_AES_CTR
51	help
52	  The AES-CCM library functions.
53
54config CRYPTO_LIB_AES_CTR
55	tristate
56	select CRYPTO_LIB_AES
57	help
58	  The AES-CTR and AES-XCTR library functions.
59
60config CRYPTO_LIB_AES_ECB
61	tristate
62	select CRYPTO_LIB_AES
63	help
64	  The AES-ECB library functions.
65
66config CRYPTO_LIB_AES_GCM
67	tristate
68	select CRYPTO_LIB_AES
69	select CRYPTO_LIB_AES_CTR
70	help
71	  The AES-GCM library functions.
72
73config CRYPTO_LIB_AES_XTS
74	tristate
75	select CRYPTO_LIB_AES
76	help
77	  The AES-XTS library functions.
78
79config CRYPTO_LIB_ARC4
80	tristate
81
82config CRYPTO_LIB_GF128MUL
83	tristate
84
85config CRYPTO_LIB_BLAKE2B
86	tristate
87	help
88	  The BLAKE2b library functions.  Select this if your module uses any of
89	  the functions from <crypto/blake2b.h>.
90
91config CRYPTO_LIB_BLAKE2B_ARCH
92	bool
93	depends on CRYPTO_LIB_BLAKE2B && !UML
94	default y if ARM && KERNEL_MODE_NEON
95
96# BLAKE2s support is always built-in, so there's no CRYPTO_LIB_BLAKE2S option.
97
98config CRYPTO_LIB_BLAKE2S_ARCH
99	bool
100	depends on !UML
101	default y if ARM
102	default y if X86_64
103
104config CRYPTO_LIB_CHACHA
105	tristate
106	select CRYPTO_LIB_UTILS
107	help
108	  Enable the ChaCha library interface.  Select this if your module uses
109	  chacha_crypt() or hchacha_block().
110
111config CRYPTO_LIB_CHACHA_ARCH
112	bool
113	depends on CRYPTO_LIB_CHACHA && !UML && !KMSAN
114	default y if ARM
115	default y if ARM64
116	default y if MIPS && CPU_MIPS32_R2
117	default y if PPC64 && CPU_LITTLE_ENDIAN && VSX
118	default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
119		     RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
120	default y if S390
121	default y if X86_64
122
123config CRYPTO_LIB_CURVE25519
124	tristate
125	select CRYPTO_LIB_UTILS
126	help
127	  The Curve25519 library functions.  Select this if your module uses any
128	  of the functions from <crypto/curve25519.h>.
129
130config CRYPTO_LIB_CURVE25519_ARCH
131	bool
132	depends on CRYPTO_LIB_CURVE25519 && !UML && !KMSAN
133	default y if ARM && KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
134	default y if PPC64 && CPU_LITTLE_ENDIAN
135	default y if X86_64
136
137config CRYPTO_LIB_CURVE25519_GENERIC
138	bool
139	depends on CRYPTO_LIB_CURVE25519
140	default y if !CRYPTO_LIB_CURVE25519_ARCH || ARM || X86_64
141
142config CRYPTO_LIB_DES
143	tristate
144
145config CRYPTO_LIB_GF128HASH
146	tristate
147	help
148	  The GHASH and POLYVAL library functions.  Select this if your module
149	  uses any of the functions from <crypto/gf128hash.h>.
150
151config CRYPTO_LIB_GF128HASH_ARCH
152	bool
153	depends on CRYPTO_LIB_GF128HASH && !UML
154	default y if ARM && KERNEL_MODE_NEON
155	default y if ARM64
156	default y if PPC64 && VSX
157	default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
158		     RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
159	default y if S390
160	default y if X86_64
161
162config CRYPTO_LIB_MD5
163	tristate
164	help
165	  The MD5 and HMAC-MD5 library functions.  Select this if your module
166	  uses any of the functions from <crypto/md5.h>.
167
168config CRYPTO_LIB_MLDSA
169	tristate
170	select CRYPTO_LIB_SHA3
171	help
172	  The ML-DSA library functions.  Select this if your module uses any of
173	  the functions from <crypto/mldsa.h>.
174
175config CRYPTO_LIB_NH
176	tristate
177	help
178	  Implementation of the NH almost-universal hash function, specifically
179	  the variant of NH used in Adiantum.
180
181config CRYPTO_LIB_NH_ARCH
182	bool
183	depends on CRYPTO_LIB_NH && !UML && !KMSAN
184	default y if ARM && KERNEL_MODE_NEON
185	default y if ARM64
186	default y if X86_64
187
188config CRYPTO_LIB_POLY1305
189	tristate
190	help
191	  The Poly1305 library functions.  Select this if your module uses any
192	  of the functions from <crypto/poly1305.h>.
193
194config CRYPTO_LIB_POLY1305_ARCH
195	bool
196	depends on CRYPTO_LIB_POLY1305 && !UML && !KMSAN
197	default y if ARM
198	default y if ARM64
199	default y if MIPS
200	default y if RISCV
201	default y if X86_64
202
203# This symbol controls the inclusion of the Poly1305 generic code.  This differs
204# from most of the other algorithms, which handle the generic code
205# "automatically" via __maybe_unused.  This is needed so that the Adiantum code,
206# which calls the poly1305_core_*() functions directly, can enable them.
207config CRYPTO_LIB_POLY1305_GENERIC
208	bool
209	depends on CRYPTO_LIB_POLY1305
210	default y if !CRYPTO_LIB_POLY1305_ARCH
211
212config CRYPTO_LIB_POLY1305_RSIZE
213	int
214	default 2 if MIPS || RISCV
215	default 11 if X86_64
216	default 9 if ARM || ARM64
217	default 1
218
219config CRYPTO_LIB_CHACHA20POLY1305
220	tristate
221	select CRYPTO_LIB_CHACHA
222	select CRYPTO_LIB_POLY1305
223	select CRYPTO_LIB_UTILS
224
225config CRYPTO_LIB_SHA1
226	tristate
227	help
228	  The SHA-1 and HMAC-SHA1 library functions.  Select this if your module
229	  uses any of the functions from <crypto/sha1.h>.
230
231config CRYPTO_LIB_SHA1_ARCH
232	bool
233	depends on CRYPTO_LIB_SHA1 && !UML
234	default y if ARM
235	default y if ARM64
236	default y if MIPS && CPU_CAVIUM_OCTEON && CPU_BIG_ENDIAN
237	default y if PPC
238	default y if S390
239	default y if SPARC64
240	default y if X86_64
241
242config CRYPTO_LIB_SHA256
243	tristate
244	help
245	  The SHA-224, SHA-256, HMAC-SHA224, and HMAC-SHA256 library functions.
246	  Select this if your module uses any of these functions from
247	  <crypto/sha2.h>.
248
249config CRYPTO_LIB_SHA256_ARCH
250	bool
251	depends on CRYPTO_LIB_SHA256 && !UML
252	default y if ARM && !CPU_V7M
253	default y if ARM64
254	default y if MIPS && CPU_CAVIUM_OCTEON && CPU_BIG_ENDIAN
255	default y if PPC && SPE
256	default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
257		     RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
258	default y if S390
259	default y if SPARC64
260	default y if X86_64
261
262config CRYPTO_LIB_SHA512
263	tristate
264	help
265	  The SHA-384, SHA-512, HMAC-SHA384, and HMAC-SHA512 library functions.
266	  Select this if your module uses any of these functions from
267	  <crypto/sha2.h>.
268
269config CRYPTO_LIB_SHA512_ARCH
270	bool
271	depends on CRYPTO_LIB_SHA512 && !UML
272	default y if ARM && !CPU_V7M
273	default y if ARM64
274	default y if MIPS && CPU_CAVIUM_OCTEON && CPU_BIG_ENDIAN
275	default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
276		     RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
277	default y if S390
278	default y if SPARC64
279	default y if X86_64
280
281config CRYPTO_LIB_SHA3
282	tristate
283	select CRYPTO_LIB_UTILS
284	help
285	  The SHA3 library functions.  Select this if your module uses any of
286	  the functions from <crypto/sha3.h>.
287
288config CRYPTO_LIB_SHA3_ARCH
289	bool
290	depends on CRYPTO_LIB_SHA3 && !UML
291	default y if ARM64
292	default y if S390
293
294config CRYPTO_LIB_SM3
295	tristate
296	help
297	  The SM3 library functions.  Select this if your module uses any of the
298	  functions from <crypto/sm3.h>.
299
300config CRYPTO_LIB_SM3_ARCH
301	bool
302	depends on CRYPTO_LIB_SM3 && !UML
303	default y if ARM64
304	default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
305		     RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
306	default y if X86_64
307