xref: /linux/lib/crypto/Kconfig (revision 70cb6ca58fddb02e269fe743ba75d53d577b5b1c)
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_ARCH_HAVE_LIB_BLAKE2S
32	bool
33	help
34	  Declares whether the architecture provides an arch-specific
35	  accelerated implementation of the Blake2s library interface,
36	  either builtin or as a module.
37
38config CRYPTO_LIB_BLAKE2S_GENERIC
39	def_bool !CRYPTO_ARCH_HAVE_LIB_BLAKE2S
40	help
41	  This symbol can be depended upon by arch implementations of the
42	  Blake2s library interface that require the generic code as a
43	  fallback, e.g., for SIMD implementations. If no arch specific
44	  implementation is enabled, this implementation serves the users
45	  of CRYPTO_LIB_BLAKE2S.
46
47config CRYPTO_ARCH_HAVE_LIB_CHACHA
48	bool
49	help
50	  Declares whether the architecture provides an arch-specific
51	  accelerated implementation of the ChaCha library interface,
52	  either builtin or as a module.
53
54config CRYPTO_LIB_CHACHA_GENERIC
55	tristate
56	default CRYPTO_LIB_CHACHA if !CRYPTO_ARCH_HAVE_LIB_CHACHA
57	select CRYPTO_LIB_UTILS
58	help
59	  This symbol can be selected by arch implementations of the ChaCha
60	  library interface that require the generic code as a fallback, e.g.,
61	  for SIMD implementations. If no arch specific implementation is
62	  enabled, this implementation serves the users of CRYPTO_LIB_CHACHA.
63
64config CRYPTO_LIB_CHACHA
65	tristate
66	help
67	  Enable the ChaCha library interface. This interface may be fulfilled
68	  by either the generic implementation or an arch-specific one, if one
69	  is available and enabled.
70
71config CRYPTO_ARCH_HAVE_LIB_CURVE25519
72	bool
73	help
74	  Declares whether the architecture provides an arch-specific
75	  accelerated implementation of the Curve25519 library interface,
76	  either builtin or as a module.
77
78config CRYPTO_LIB_CURVE25519_GENERIC
79	tristate
80	select CRYPTO_LIB_UTILS
81	help
82	  This symbol can be depended upon by arch implementations of the
83	  Curve25519 library interface that require the generic code as a
84	  fallback, e.g., for SIMD implementations. If no arch specific
85	  implementation is enabled, this implementation serves the users
86	  of CRYPTO_LIB_CURVE25519.
87
88config CRYPTO_LIB_CURVE25519_INTERNAL
89	tristate
90	select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n
91
92config CRYPTO_LIB_CURVE25519
93	tristate
94	select CRYPTO
95	select CRYPTO_LIB_CURVE25519_INTERNAL
96	help
97	  Enable the Curve25519 library interface. This interface may be
98	  fulfilled by either the generic implementation or an arch-specific
99	  one, if one is available and enabled.
100
101config CRYPTO_LIB_DES
102	tristate
103
104config CRYPTO_LIB_POLY1305_RSIZE
105	int
106	default 2 if MIPS
107	default 11 if X86_64
108	default 9 if ARM || ARM64
109	default 1
110
111config CRYPTO_ARCH_HAVE_LIB_POLY1305
112	bool
113	help
114	  Declares whether the architecture provides an arch-specific
115	  accelerated implementation of the Poly1305 library interface,
116	  either builtin or as a module.
117
118config CRYPTO_LIB_POLY1305_GENERIC
119	tristate
120	default CRYPTO_LIB_POLY1305 if !CRYPTO_ARCH_HAVE_LIB_POLY1305
121	help
122	  This symbol can be selected by arch implementations of the Poly1305
123	  library interface that require the generic code as a fallback, e.g.,
124	  for SIMD implementations. If no arch specific implementation is
125	  enabled, this implementation serves the users of CRYPTO_LIB_POLY1305.
126
127config CRYPTO_LIB_POLY1305
128	tristate
129	help
130	  Enable the Poly1305 library interface. This interface may be fulfilled
131	  by either the generic implementation or an arch-specific one, if one
132	  is available and enabled.
133
134config CRYPTO_LIB_CHACHA20POLY1305
135	tristate
136	select CRYPTO_LIB_CHACHA
137	select CRYPTO_LIB_POLY1305
138	select CRYPTO_LIB_UTILS
139
140config CRYPTO_LIB_SHA1
141	tristate
142	help
143	  The SHA-1 library functions.  Select this if your module uses any of
144	  the functions from <crypto/sha1.h>.
145
146config CRYPTO_LIB_SHA1_ARCH
147	bool
148	depends on CRYPTO_LIB_SHA1 && !UML
149	default y if ARM
150
151config CRYPTO_LIB_SHA256
152	tristate
153	help
154	  Enable the SHA-256 library interface. This interface may be fulfilled
155	  by either the generic implementation or an arch-specific one, if one
156	  is available and enabled.
157
158config CRYPTO_LIB_SHA256_ARCH
159	bool
160	depends on CRYPTO_LIB_SHA256 && !UML
161	default y if ARM && !CPU_V7M
162	default y if ARM64
163	default y if MIPS && CPU_CAVIUM_OCTEON
164	default y if PPC && SPE
165	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
166	default y if S390
167	default y if SPARC64
168	default y if X86_64
169
170config CRYPTO_LIB_SHA512
171	tristate
172	help
173	  The SHA-384, SHA-512, HMAC-SHA384, and HMAC-SHA512 library functions.
174	  Select this if your module uses any of these functions from
175	  <crypto/sha2.h>.
176
177config CRYPTO_LIB_SHA512_ARCH
178	bool
179	depends on CRYPTO_LIB_SHA512 && !UML
180	default y if ARM && !CPU_V7M
181	default y if ARM64
182	default y if MIPS && CPU_CAVIUM_OCTEON
183	default y if RISCV && 64BIT && RISCV_ISA_V && TOOLCHAIN_HAS_VECTOR_CRYPTO
184	default y if S390
185	default y if SPARC64
186	default y if X86_64
187
188config CRYPTO_LIB_SM3
189	tristate
190
191if !KMSAN # avoid false positives from assembly
192if ARM
193source "lib/crypto/arm/Kconfig"
194endif
195if ARM64
196source "lib/crypto/arm64/Kconfig"
197endif
198if MIPS
199source "lib/crypto/mips/Kconfig"
200endif
201if PPC
202source "lib/crypto/powerpc/Kconfig"
203endif
204if RISCV
205source "lib/crypto/riscv/Kconfig"
206endif
207if S390
208source "lib/crypto/s390/Kconfig"
209endif
210if X86
211source "lib/crypto/x86/Kconfig"
212endif
213endif
214
215endmenu
216