xref: /linux/lib/crypto/Kconfig (revision 7fc2cd2e4b398c57c9cf961cfea05eadbf34c05c)
1# SPDX-License-Identifier: GPL-2.0
2
3menu "Crypto library routines"
4
5config CRYPTO_HASH_INFO
6	bool
7
8config CRYPTO_LIB_UTILS
9	tristate
10
11config CRYPTO_LIB_AES
12	tristate
13
14config CRYPTO_LIB_AESCFB
15	tristate
16	select CRYPTO_LIB_AES
17	select CRYPTO_LIB_UTILS
18
19config CRYPTO_LIB_AESGCM
20	tristate
21	select CRYPTO_LIB_AES
22	select CRYPTO_LIB_GF128MUL
23	select CRYPTO_LIB_UTILS
24
25config CRYPTO_LIB_ARC4
26	tristate
27
28config CRYPTO_LIB_GF128MUL
29	tristate
30
31config CRYPTO_LIB_BLAKE2B
32	tristate
33	help
34	  The BLAKE2b library functions.  Select this if your module uses any of
35	  the functions from <crypto/blake2b.h>.
36
37config CRYPTO_LIB_BLAKE2B_ARCH
38	bool
39	depends on CRYPTO_LIB_BLAKE2B && !UML
40	default y if ARM && KERNEL_MODE_NEON
41
42# BLAKE2s support is always built-in, so there's no CRYPTO_LIB_BLAKE2S option.
43
44config CRYPTO_LIB_BLAKE2S_ARCH
45	bool
46	depends on !UML
47	default y if ARM
48	default y if X86_64
49
50config CRYPTO_LIB_CHACHA
51	tristate
52	select CRYPTO_LIB_UTILS
53	help
54	  Enable the ChaCha library interface.  Select this if your module uses
55	  chacha_crypt() or hchacha_block().
56
57config CRYPTO_LIB_CHACHA_ARCH
58	bool
59	depends on CRYPTO_LIB_CHACHA && !UML && !KMSAN
60	default y if ARM
61	default y if ARM64 && KERNEL_MODE_NEON
62	default y if MIPS && CPU_MIPS32_R2
63	default y if PPC64 && CPU_LITTLE_ENDIAN && VSX
64	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
65	default y if S390
66	default y if X86_64
67
68config CRYPTO_LIB_CURVE25519
69	tristate
70	select CRYPTO_LIB_UTILS
71	help
72	  The Curve25519 library functions.  Select this if your module uses any
73	  of the functions from <crypto/curve25519.h>.
74
75config CRYPTO_LIB_CURVE25519_ARCH
76	bool
77	depends on CRYPTO_LIB_CURVE25519 && !UML && !KMSAN
78	default y if ARM && KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
79	default y if PPC64 && CPU_LITTLE_ENDIAN
80	default y if X86_64
81
82config CRYPTO_LIB_CURVE25519_GENERIC
83	bool
84	depends on CRYPTO_LIB_CURVE25519
85	default y if !CRYPTO_LIB_CURVE25519_ARCH || ARM || X86_64
86
87config CRYPTO_LIB_DES
88	tristate
89
90config CRYPTO_LIB_MD5
91	tristate
92	help
93	  The MD5 and HMAC-MD5 library functions.  Select this if your module
94	  uses any of the functions from <crypto/md5.h>.
95
96config CRYPTO_LIB_MD5_ARCH
97	bool
98	depends on CRYPTO_LIB_MD5 && !UML
99	default y if MIPS && CPU_CAVIUM_OCTEON
100	default y if PPC
101	default y if SPARC64
102
103config CRYPTO_LIB_POLY1305
104	tristate
105	help
106	  The Poly1305 library functions.  Select this if your module uses any
107	  of the functions from <crypto/poly1305.h>.
108
109config CRYPTO_LIB_POLY1305_ARCH
110	bool
111	depends on CRYPTO_LIB_POLY1305 && !UML && !KMSAN
112	default y if ARM
113	default y if ARM64 && KERNEL_MODE_NEON
114	default y if MIPS
115	# The PPC64 code needs to be fixed to work in softirq context.
116	default y if PPC64 && CPU_LITTLE_ENDIAN && VSX && BROKEN
117	default y if RISCV
118	default y if X86_64
119
120# This symbol controls the inclusion of the Poly1305 generic code.  This differs
121# from most of the other algorithms, which handle the generic code
122# "automatically" via __maybe_unused.  This is needed so that the Adiantum code,
123# which calls the poly1305_core_*() functions directly, can enable them.
124config CRYPTO_LIB_POLY1305_GENERIC
125	bool
126	depends on CRYPTO_LIB_POLY1305
127	# Enable if there's no arch impl or the arch impl requires the generic
128	# impl as a fallback.  (Or if selected explicitly.)
129	default y if !CRYPTO_LIB_POLY1305_ARCH || PPC64
130
131config CRYPTO_LIB_POLY1305_RSIZE
132	int
133	default 2 if MIPS || RISCV
134	default 11 if X86_64
135	default 9 if ARM || ARM64
136	default 1
137
138config CRYPTO_LIB_POLYVAL
139	tristate
140	help
141	  The POLYVAL library functions.  Select this if your module uses any of
142	  the functions from <crypto/polyval.h>.
143
144config CRYPTO_LIB_POLYVAL_ARCH
145	bool
146	depends on CRYPTO_LIB_POLYVAL && !UML
147	default y if ARM64 && KERNEL_MODE_NEON
148	default y if X86_64
149
150config CRYPTO_LIB_CHACHA20POLY1305
151	tristate
152	select CRYPTO_LIB_CHACHA
153	select CRYPTO_LIB_POLY1305
154	select CRYPTO_LIB_UTILS
155
156config CRYPTO_LIB_SHA1
157	tristate
158	help
159	  The SHA-1 and HMAC-SHA1 library functions.  Select this if your module
160	  uses any of the functions from <crypto/sha1.h>.
161
162config CRYPTO_LIB_SHA1_ARCH
163	bool
164	depends on CRYPTO_LIB_SHA1 && !UML
165	default y if ARM
166	default y if ARM64 && KERNEL_MODE_NEON
167	default y if MIPS && CPU_CAVIUM_OCTEON
168	default y if PPC
169	default y if S390
170	default y if SPARC64
171	default y if X86_64
172
173config CRYPTO_LIB_SHA256
174	tristate
175	help
176	  The SHA-224, SHA-256, HMAC-SHA224, and HMAC-SHA256 library functions.
177	  Select this if your module uses any of these functions from
178	  <crypto/sha2.h>.
179
180config CRYPTO_LIB_SHA256_ARCH
181	bool
182	depends on CRYPTO_LIB_SHA256 && !UML
183	default y if ARM && !CPU_V7M
184	default y if ARM64
185	default y if MIPS && CPU_CAVIUM_OCTEON
186	default y if PPC && SPE
187	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
188	default y if S390
189	default y if SPARC64
190	default y if X86_64
191
192config CRYPTO_LIB_SHA512
193	tristate
194	help
195	  The SHA-384, SHA-512, HMAC-SHA384, and HMAC-SHA512 library functions.
196	  Select this if your module uses any of these functions from
197	  <crypto/sha2.h>.
198
199config CRYPTO_LIB_SHA512_ARCH
200	bool
201	depends on CRYPTO_LIB_SHA512 && !UML
202	default y if ARM && !CPU_V7M
203	default y if ARM64
204	default y if MIPS && CPU_CAVIUM_OCTEON
205	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
206	default y if S390
207	default y if SPARC64
208	default y if X86_64
209
210config CRYPTO_LIB_SHA3
211	tristate
212	select CRYPTO_LIB_UTILS
213	help
214	  The SHA3 library functions.  Select this if your module uses any of
215	  the functions from <crypto/sha3.h>.
216
217config CRYPTO_LIB_SHA3_ARCH
218	bool
219	depends on CRYPTO_LIB_SHA3 && !UML
220	default y if ARM64 && KERNEL_MODE_NEON
221	default y if S390
222
223config CRYPTO_LIB_SM3
224	tristate
225
226source "lib/crypto/tests/Kconfig"
227
228endmenu
229