xref: /linux/lib/crypto/Kconfig (revision 469acaa12502e05eefd439693361fe4b851a4fd5)
1# SPDX-License-Identifier: GPL-2.0
2
3menu "Crypto library routines"
4
5config CRYPTO_LIB_UTILS
6	tristate
7
8config CRYPTO_LIB_AES
9	tristate
10
11config CRYPTO_LIB_AESCFB
12	tristate
13	select CRYPTO_LIB_AES
14	select CRYPTO_LIB_UTILS
15
16config CRYPTO_LIB_AESGCM
17	tristate
18	select CRYPTO_LIB_AES
19	select CRYPTO_LIB_GF128MUL
20	select CRYPTO_LIB_UTILS
21
22config CRYPTO_LIB_ARC4
23	tristate
24
25config CRYPTO_LIB_GF128MUL
26	tristate
27
28config CRYPTO_ARCH_HAVE_LIB_BLAKE2S
29	bool
30	help
31	  Declares whether the architecture provides an arch-specific
32	  accelerated implementation of the Blake2s library interface,
33	  either builtin or as a module.
34
35config CRYPTO_LIB_BLAKE2S_GENERIC
36	def_bool !CRYPTO_ARCH_HAVE_LIB_BLAKE2S
37	help
38	  This symbol can be depended upon by arch implementations of the
39	  Blake2s library interface that require the generic code as a
40	  fallback, e.g., for SIMD implementations. If no arch specific
41	  implementation is enabled, this implementation serves the users
42	  of CRYPTO_LIB_BLAKE2S.
43
44config CRYPTO_ARCH_HAVE_LIB_CHACHA
45	bool
46	help
47	  Declares whether the architecture provides an arch-specific
48	  accelerated implementation of the ChaCha library interface,
49	  either builtin or as a module.
50
51config CRYPTO_LIB_CHACHA_GENERIC
52	tristate
53	default CRYPTO_LIB_CHACHA if !CRYPTO_ARCH_HAVE_LIB_CHACHA
54	select CRYPTO_LIB_UTILS
55	help
56	  This symbol can be selected by arch implementations of the ChaCha
57	  library interface that require the generic code as a fallback, e.g.,
58	  for SIMD implementations. If no arch specific implementation is
59	  enabled, this implementation serves the users of CRYPTO_LIB_CHACHA.
60
61config CRYPTO_LIB_CHACHA
62	tristate
63	help
64	  Enable the ChaCha library interface. This interface may be fulfilled
65	  by either the generic implementation or an arch-specific one, if one
66	  is available and enabled.
67
68config CRYPTO_ARCH_HAVE_LIB_CURVE25519
69	bool
70	help
71	  Declares whether the architecture provides an arch-specific
72	  accelerated implementation of the Curve25519 library interface,
73	  either builtin or as a module.
74
75config CRYPTO_LIB_CURVE25519_GENERIC
76	tristate
77	select CRYPTO_LIB_UTILS
78	help
79	  This symbol can be depended upon by arch implementations of the
80	  Curve25519 library interface that require the generic code as a
81	  fallback, e.g., for SIMD implementations. If no arch specific
82	  implementation is enabled, this implementation serves the users
83	  of CRYPTO_LIB_CURVE25519.
84
85config CRYPTO_LIB_CURVE25519_INTERNAL
86	tristate
87	select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n
88
89config CRYPTO_LIB_CURVE25519
90	tristate
91	select CRYPTO
92	select CRYPTO_LIB_CURVE25519_INTERNAL
93	help
94	  Enable the Curve25519 library interface. This interface may be
95	  fulfilled by either the generic implementation or an arch-specific
96	  one, if one is available and enabled.
97
98config CRYPTO_LIB_DES
99	tristate
100
101config CRYPTO_LIB_POLY1305_RSIZE
102	int
103	default 2 if MIPS
104	default 11 if X86_64
105	default 9 if ARM || ARM64
106	default 1
107
108config CRYPTO_ARCH_HAVE_LIB_POLY1305
109	bool
110	help
111	  Declares whether the architecture provides an arch-specific
112	  accelerated implementation of the Poly1305 library interface,
113	  either builtin or as a module.
114
115config CRYPTO_LIB_POLY1305_GENERIC
116	tristate
117	default CRYPTO_LIB_POLY1305 if !CRYPTO_ARCH_HAVE_LIB_POLY1305
118	help
119	  This symbol can be selected by arch implementations of the Poly1305
120	  library interface that require the generic code as a fallback, e.g.,
121	  for SIMD implementations. If no arch specific implementation is
122	  enabled, this implementation serves the users of CRYPTO_LIB_POLY1305.
123
124config CRYPTO_LIB_POLY1305
125	tristate
126	help
127	  Enable the Poly1305 library interface. This interface may be fulfilled
128	  by either the generic implementation or an arch-specific one, if one
129	  is available and enabled.
130
131config CRYPTO_LIB_CHACHA20POLY1305
132	tristate
133	select CRYPTO_LIB_CHACHA
134	select CRYPTO_LIB_POLY1305
135	select CRYPTO_LIB_UTILS
136
137config CRYPTO_LIB_SHA1
138	tristate
139
140config CRYPTO_LIB_SHA256
141	tristate
142	help
143	  Enable the SHA-256 library interface. This interface may be fulfilled
144	  by either the generic implementation or an arch-specific one, if one
145	  is available and enabled.
146
147config CRYPTO_ARCH_HAVE_LIB_SHA256
148	bool
149	help
150	  Declares whether the architecture provides an arch-specific
151	  accelerated implementation of the SHA-256 library interface.
152
153config CRYPTO_ARCH_HAVE_LIB_SHA256_SIMD
154	bool
155	help
156	  Declares whether the architecture provides an arch-specific
157	  accelerated implementation of the SHA-256 library interface
158	  that is SIMD-based and therefore not usable in hardirq
159	  context.
160
161config CRYPTO_LIB_SHA256_GENERIC
162	tristate
163	default CRYPTO_LIB_SHA256 if !CRYPTO_ARCH_HAVE_LIB_SHA256
164	help
165	  This symbol can be selected by arch implementations of the SHA-256
166	  library interface that require the generic code as a fallback, e.g.,
167	  for SIMD implementations. If no arch specific implementation is
168	  enabled, this implementation serves the users of CRYPTO_LIB_SHA256.
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
181config CRYPTO_LIB_SM3
182	tristate
183
184if !KMSAN # avoid false positives from assembly
185if ARM
186source "arch/arm/lib/crypto/Kconfig"
187endif
188if ARM64
189source "arch/arm64/lib/crypto/Kconfig"
190endif
191if MIPS
192source "arch/mips/lib/crypto/Kconfig"
193endif
194if PPC
195source "arch/powerpc/lib/crypto/Kconfig"
196endif
197if RISCV
198source "arch/riscv/lib/crypto/Kconfig"
199endif
200if S390
201source "arch/s390/lib/crypto/Kconfig"
202endif
203if SPARC
204source "arch/sparc/lib/crypto/Kconfig"
205endif
206if X86
207source "arch/x86/lib/crypto/Kconfig"
208endif
209endif
210
211endmenu
212