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_SM3
171	tristate
172
173if !KMSAN # avoid false positives from assembly
174if ARM
175source "arch/arm/lib/crypto/Kconfig"
176endif
177if ARM64
178source "arch/arm64/lib/crypto/Kconfig"
179endif
180if MIPS
181source "arch/mips/lib/crypto/Kconfig"
182endif
183if PPC
184source "arch/powerpc/lib/crypto/Kconfig"
185endif
186if RISCV
187source "arch/riscv/lib/crypto/Kconfig"
188endif
189if S390
190source "arch/s390/lib/crypto/Kconfig"
191endif
192if SPARC
193source "arch/sparc/lib/crypto/Kconfig"
194endif
195if X86
196source "arch/x86/lib/crypto/Kconfig"
197endif
198endif
199
200endmenu
201