xref: /linux/crypto/Kconfig (revision 02c974294c740bfb747ec64933e12148eb3d99e1)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Generic algorithms support
4#
5config XOR_BLOCKS
6	tristate
7
8#
9# async_tx api: hardware offloaded memory transfer/transform support
10#
11source "crypto/async_tx/Kconfig"
12
13#
14# Cryptographic API Configuration
15#
16menuconfig CRYPTO
17	tristate "Cryptographic API"
18	select CRYPTO_LIB_UTILS
19	help
20	  This option provides the core Cryptographic API.
21
22if CRYPTO
23
24menu "Crypto core or helper"
25
26config CRYPTO_FIPS
27	bool "FIPS 200 compliance"
28	depends on (CRYPTO_ANSI_CPRNG || CRYPTO_DRBG) && !CRYPTO_MANAGER_DISABLE_TESTS
29	depends on (MODULE_SIG || !MODULES)
30	help
31	  This option enables the fips boot option which is
32	  required if you want the system to operate in a FIPS 200
33	  certification.  You should say no unless you know what
34	  this is.
35
36config CRYPTO_FIPS_NAME
37	string "FIPS Module Name"
38	default "Linux Kernel Cryptographic API"
39	depends on CRYPTO_FIPS
40	help
41	  This option sets the FIPS Module name reported by the Crypto API via
42	  the /proc/sys/crypto/fips_name file.
43
44config CRYPTO_FIPS_CUSTOM_VERSION
45	bool "Use Custom FIPS Module Version"
46	depends on CRYPTO_FIPS
47	default n
48
49config CRYPTO_FIPS_VERSION
50	string "FIPS Module Version"
51	default "(none)"
52	depends on CRYPTO_FIPS_CUSTOM_VERSION
53	help
54	  This option provides the ability to override the FIPS Module Version.
55	  By default the KERNELRELEASE value is used.
56
57config CRYPTO_ALGAPI
58	tristate
59	select CRYPTO_ALGAPI2
60	help
61	  This option provides the API for cryptographic algorithms.
62
63config CRYPTO_ALGAPI2
64	tristate
65
66config CRYPTO_AEAD
67	tristate
68	select CRYPTO_AEAD2
69	select CRYPTO_ALGAPI
70
71config CRYPTO_AEAD2
72	tristate
73	select CRYPTO_ALGAPI2
74
75config CRYPTO_SIG
76	tristate
77	select CRYPTO_SIG2
78	select CRYPTO_ALGAPI
79
80config CRYPTO_SIG2
81	tristate
82	select CRYPTO_ALGAPI2
83
84config CRYPTO_SKCIPHER
85	tristate
86	select CRYPTO_SKCIPHER2
87	select CRYPTO_ALGAPI
88	select CRYPTO_ECB
89
90config CRYPTO_SKCIPHER2
91	tristate
92	select CRYPTO_ALGAPI2
93
94config CRYPTO_HASH
95	tristate
96	select CRYPTO_HASH2
97	select CRYPTO_ALGAPI
98
99config CRYPTO_HASH2
100	tristate
101	select CRYPTO_ALGAPI2
102
103config CRYPTO_RNG
104	tristate
105	select CRYPTO_RNG2
106	select CRYPTO_ALGAPI
107
108config CRYPTO_RNG2
109	tristate
110	select CRYPTO_ALGAPI2
111
112config CRYPTO_RNG_DEFAULT
113	tristate
114	select CRYPTO_DRBG_MENU
115
116config CRYPTO_AKCIPHER2
117	tristate
118	select CRYPTO_ALGAPI2
119
120config CRYPTO_AKCIPHER
121	tristate
122	select CRYPTO_AKCIPHER2
123	select CRYPTO_ALGAPI
124
125config CRYPTO_KPP2
126	tristate
127	select CRYPTO_ALGAPI2
128
129config CRYPTO_KPP
130	tristate
131	select CRYPTO_ALGAPI
132	select CRYPTO_KPP2
133
134config CRYPTO_ACOMP2
135	tristate
136	select CRYPTO_ALGAPI2
137	select SGL_ALLOC
138
139config CRYPTO_ACOMP
140	tristate
141	select CRYPTO_ALGAPI
142	select CRYPTO_ACOMP2
143
144config CRYPTO_MANAGER
145	tristate "Cryptographic algorithm manager"
146	select CRYPTO_MANAGER2
147	help
148	  Create default cryptographic template instantiations such as
149	  cbc(aes).
150
151config CRYPTO_MANAGER2
152	def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
153	select CRYPTO_ACOMP2
154	select CRYPTO_AEAD2
155	select CRYPTO_AKCIPHER2
156	select CRYPTO_SIG2
157	select CRYPTO_HASH2
158	select CRYPTO_KPP2
159	select CRYPTO_RNG2
160	select CRYPTO_SKCIPHER2
161
162config CRYPTO_USER
163	tristate "Userspace cryptographic algorithm configuration"
164	depends on NET
165	select CRYPTO_MANAGER
166	help
167	  Userspace configuration for cryptographic instantiations such as
168	  cbc(aes).
169
170config CRYPTO_MANAGER_DISABLE_TESTS
171	bool "Disable run-time self tests"
172	default y
173	help
174	  Disable run-time self tests that normally take place at
175	  algorithm registration.
176
177config CRYPTO_MANAGER_EXTRA_TESTS
178	bool "Enable extra run-time crypto self tests"
179	depends on DEBUG_KERNEL && !CRYPTO_MANAGER_DISABLE_TESTS && CRYPTO_MANAGER
180	help
181	  Enable extra run-time self tests of registered crypto algorithms,
182	  including randomized fuzz tests.
183
184	  This is intended for developer use only, as these tests take much
185	  longer to run than the normal self tests.
186
187config CRYPTO_NULL
188	tristate "Null algorithms"
189	select CRYPTO_NULL2
190	help
191	  These are 'Null' algorithms, used by IPsec, which do nothing.
192
193config CRYPTO_NULL2
194	tristate
195	select CRYPTO_ALGAPI2
196	select CRYPTO_SKCIPHER2
197	select CRYPTO_HASH2
198
199config CRYPTO_PCRYPT
200	tristate "Parallel crypto engine"
201	depends on SMP
202	select PADATA
203	select CRYPTO_MANAGER
204	select CRYPTO_AEAD
205	help
206	  This converts an arbitrary crypto algorithm into a parallel
207	  algorithm that executes in kernel threads.
208
209config CRYPTO_CRYPTD
210	tristate "Software async crypto daemon"
211	select CRYPTO_SKCIPHER
212	select CRYPTO_HASH
213	select CRYPTO_MANAGER
214	help
215	  This is a generic software asynchronous crypto daemon that
216	  converts an arbitrary synchronous software crypto algorithm
217	  into an asynchronous algorithm that executes in a kernel thread.
218
219config CRYPTO_AUTHENC
220	tristate "Authenc support"
221	select CRYPTO_AEAD
222	select CRYPTO_SKCIPHER
223	select CRYPTO_MANAGER
224	select CRYPTO_HASH
225	select CRYPTO_NULL
226	help
227	  Authenc: Combined mode wrapper for IPsec.
228
229	  This is required for IPSec ESP (XFRM_ESP).
230
231config CRYPTO_KRB5ENC
232	tristate "Kerberos 5 combined hash+cipher support"
233	select CRYPTO_AEAD
234	select CRYPTO_SKCIPHER
235	select CRYPTO_MANAGER
236	select CRYPTO_HASH
237	select CRYPTO_NULL
238	help
239	  Combined hash and cipher support for Kerberos 5 RFC3961 simplified
240	  profile.  This is required for Kerberos 5-style encryption, used by
241	  sunrpc/NFS and rxrpc/AFS.
242
243config CRYPTO_TEST
244	tristate "Testing module"
245	depends on m || EXPERT
246	select CRYPTO_MANAGER
247	help
248	  Quick & dirty crypto test module.
249
250config CRYPTO_SIMD
251	tristate
252	select CRYPTO_CRYPTD
253
254config CRYPTO_ENGINE
255	tristate
256
257endmenu
258
259menu "Public-key cryptography"
260
261config CRYPTO_RSA
262	tristate "RSA (Rivest-Shamir-Adleman)"
263	select CRYPTO_AKCIPHER
264	select CRYPTO_MANAGER
265	select CRYPTO_SIG
266	select MPILIB
267	select ASN1
268	help
269	  RSA (Rivest-Shamir-Adleman) public key algorithm (RFC8017)
270
271config CRYPTO_DH
272	tristate "DH (Diffie-Hellman)"
273	select CRYPTO_KPP
274	select MPILIB
275	help
276	  DH (Diffie-Hellman) key exchange algorithm
277
278config CRYPTO_DH_RFC7919_GROUPS
279	bool "RFC 7919 FFDHE groups"
280	depends on CRYPTO_DH
281	select CRYPTO_RNG_DEFAULT
282	help
283	  FFDHE (Finite-Field-based Diffie-Hellman Ephemeral) groups
284	  defined in RFC7919.
285
286	  Support these finite-field groups in DH key exchanges:
287	  - ffdhe2048, ffdhe3072, ffdhe4096, ffdhe6144, ffdhe8192
288
289	  If unsure, say N.
290
291config CRYPTO_ECC
292	tristate
293	select CRYPTO_RNG_DEFAULT
294
295config CRYPTO_ECDH
296	tristate "ECDH (Elliptic Curve Diffie-Hellman)"
297	select CRYPTO_ECC
298	select CRYPTO_KPP
299	help
300	  ECDH (Elliptic Curve Diffie-Hellman) key exchange algorithm
301	  using curves P-192, P-256, and P-384 (FIPS 186)
302
303config CRYPTO_ECDSA
304	tristate "ECDSA (Elliptic Curve Digital Signature Algorithm)"
305	select CRYPTO_ECC
306	select CRYPTO_SIG
307	select ASN1
308	help
309	  ECDSA (Elliptic Curve Digital Signature Algorithm) (FIPS 186,
310	  ISO/IEC 14888-3)
311	  using curves P-192, P-256, P-384 and P-521
312
313	  Only signature verification is implemented.
314
315config CRYPTO_ECRDSA
316	tristate "EC-RDSA (Elliptic Curve Russian Digital Signature Algorithm)"
317	select CRYPTO_ECC
318	select CRYPTO_SIG
319	select CRYPTO_STREEBOG
320	select OID_REGISTRY
321	select ASN1
322	help
323	  Elliptic Curve Russian Digital Signature Algorithm (GOST R 34.10-2012,
324	  RFC 7091, ISO/IEC 14888-3)
325
326	  One of the Russian cryptographic standard algorithms (called GOST
327	  algorithms). Only signature verification is implemented.
328
329config CRYPTO_CURVE25519
330	tristate "Curve25519"
331	select CRYPTO_KPP
332	select CRYPTO_LIB_CURVE25519_GENERIC
333	select CRYPTO_LIB_CURVE25519_INTERNAL
334	help
335	  Curve25519 elliptic curve (RFC7748)
336
337endmenu
338
339menu "Block ciphers"
340
341config CRYPTO_AES
342	tristate "AES (Advanced Encryption Standard)"
343	select CRYPTO_ALGAPI
344	select CRYPTO_LIB_AES
345	help
346	  AES cipher algorithms (Rijndael)(FIPS-197, ISO/IEC 18033-3)
347
348	  Rijndael appears to be consistently a very good performer in
349	  both hardware and software across a wide range of computing
350	  environments regardless of its use in feedback or non-feedback
351	  modes. Its key setup time is excellent, and its key agility is
352	  good. Rijndael's very low memory requirements make it very well
353	  suited for restricted-space environments, in which it also
354	  demonstrates excellent performance. Rijndael's operations are
355	  among the easiest to defend against power and timing attacks.
356
357	  The AES specifies three key sizes: 128, 192 and 256 bits
358
359config CRYPTO_AES_TI
360	tristate "AES (Advanced Encryption Standard) (fixed time)"
361	select CRYPTO_ALGAPI
362	select CRYPTO_LIB_AES
363	help
364	  AES cipher algorithms (Rijndael)(FIPS-197, ISO/IEC 18033-3)
365
366	  This is a generic implementation of AES that attempts to eliminate
367	  data dependent latencies as much as possible without affecting
368	  performance too much. It is intended for use by the generic CCM
369	  and GCM drivers, and other CTR or CMAC/XCBC based modes that rely
370	  solely on encryption (although decryption is supported as well, but
371	  with a more dramatic performance hit)
372
373	  Instead of using 16 lookup tables of 1 KB each, (8 for encryption and
374	  8 for decryption), this implementation only uses just two S-boxes of
375	  256 bytes each, and attempts to eliminate data dependent latencies by
376	  prefetching the entire table into the cache at the start of each
377	  block. Interrupts are also disabled to avoid races where cachelines
378	  are evicted when the CPU is interrupted to do something else.
379
380config CRYPTO_ANUBIS
381	tristate "Anubis"
382	depends on CRYPTO_USER_API_ENABLE_OBSOLETE
383	select CRYPTO_ALGAPI
384	help
385	  Anubis cipher algorithm
386
387	  Anubis is a variable key length cipher which can use keys from
388	  128 bits to 320 bits in length.  It was evaluated as a entrant
389	  in the NESSIE competition.
390
391	  See https://web.archive.org/web/20160606112246/http://www.larc.usp.br/~pbarreto/AnubisPage.html
392	  for further information.
393
394config CRYPTO_ARIA
395	tristate "ARIA"
396	select CRYPTO_ALGAPI
397	help
398	  ARIA cipher algorithm (RFC5794)
399
400	  ARIA is a standard encryption algorithm of the Republic of Korea.
401	  The ARIA specifies three key sizes and rounds.
402	  128-bit: 12 rounds.
403	  192-bit: 14 rounds.
404	  256-bit: 16 rounds.
405
406	  See:
407	  https://seed.kisa.or.kr/kisa/algorithm/EgovAriaInfo.do
408
409config CRYPTO_BLOWFISH
410	tristate "Blowfish"
411	select CRYPTO_ALGAPI
412	select CRYPTO_BLOWFISH_COMMON
413	help
414	  Blowfish cipher algorithm, by Bruce Schneier
415
416	  This is a variable key length cipher which can use keys from 32
417	  bits to 448 bits in length.  It's fast, simple and specifically
418	  designed for use on "large microprocessors".
419
420	  See https://www.schneier.com/blowfish.html for further information.
421
422config CRYPTO_BLOWFISH_COMMON
423	tristate
424	help
425	  Common parts of the Blowfish cipher algorithm shared by the
426	  generic c and the assembler implementations.
427
428config CRYPTO_CAMELLIA
429	tristate "Camellia"
430	select CRYPTO_ALGAPI
431	help
432	  Camellia cipher algorithms (ISO/IEC 18033-3)
433
434	  Camellia is a symmetric key block cipher developed jointly
435	  at NTT and Mitsubishi Electric Corporation.
436
437	  The Camellia specifies three key sizes: 128, 192 and 256 bits.
438
439	  See https://info.isl.ntt.co.jp/crypt/eng/camellia/ for further information.
440
441config CRYPTO_CAST_COMMON
442	tristate
443	help
444	  Common parts of the CAST cipher algorithms shared by the
445	  generic c and the assembler implementations.
446
447config CRYPTO_CAST5
448	tristate "CAST5 (CAST-128)"
449	select CRYPTO_ALGAPI
450	select CRYPTO_CAST_COMMON
451	help
452	  CAST5 (CAST-128) cipher algorithm (RFC2144, ISO/IEC 18033-3)
453
454config CRYPTO_CAST6
455	tristate "CAST6 (CAST-256)"
456	select CRYPTO_ALGAPI
457	select CRYPTO_CAST_COMMON
458	help
459	  CAST6 (CAST-256) encryption algorithm (RFC2612)
460
461config CRYPTO_DES
462	tristate "DES and Triple DES EDE"
463	select CRYPTO_ALGAPI
464	select CRYPTO_LIB_DES
465	help
466	  DES (Data Encryption Standard)(FIPS 46-2, ISO/IEC 18033-3) and
467	  Triple DES EDE (Encrypt/Decrypt/Encrypt) (FIPS 46-3, ISO/IEC 18033-3)
468	  cipher algorithms
469
470config CRYPTO_FCRYPT
471	tristate "FCrypt"
472	select CRYPTO_ALGAPI
473	select CRYPTO_SKCIPHER
474	help
475	  FCrypt algorithm used by RxRPC
476
477	  See https://ota.polyonymo.us/fcrypt-paper.txt
478
479config CRYPTO_KHAZAD
480	tristate "Khazad"
481	depends on CRYPTO_USER_API_ENABLE_OBSOLETE
482	select CRYPTO_ALGAPI
483	help
484	  Khazad cipher algorithm
485
486	  Khazad was a finalist in the initial NESSIE competition.  It is
487	  an algorithm optimized for 64-bit processors with good performance
488	  on 32-bit processors.  Khazad uses an 128 bit key size.
489
490	  See https://web.archive.org/web/20171011071731/http://www.larc.usp.br/~pbarreto/KhazadPage.html
491	  for further information.
492
493config CRYPTO_SEED
494	tristate "SEED"
495	depends on CRYPTO_USER_API_ENABLE_OBSOLETE
496	select CRYPTO_ALGAPI
497	help
498	  SEED cipher algorithm (RFC4269, ISO/IEC 18033-3)
499
500	  SEED is a 128-bit symmetric key block cipher that has been
501	  developed by KISA (Korea Information Security Agency) as a
502	  national standard encryption algorithm of the Republic of Korea.
503	  It is a 16 round block cipher with the key size of 128 bit.
504
505	  See https://seed.kisa.or.kr/kisa/algorithm/EgovSeedInfo.do
506	  for further information.
507
508config CRYPTO_SERPENT
509	tristate "Serpent"
510	select CRYPTO_ALGAPI
511	help
512	  Serpent cipher algorithm, by Anderson, Biham & Knudsen
513
514	  Keys are allowed to be from 0 to 256 bits in length, in steps
515	  of 8 bits.
516
517	  See https://www.cl.cam.ac.uk/~rja14/serpent.html for further information.
518
519config CRYPTO_SM4
520	tristate
521
522config CRYPTO_SM4_GENERIC
523	tristate "SM4 (ShangMi 4)"
524	select CRYPTO_ALGAPI
525	select CRYPTO_SM4
526	help
527	  SM4 cipher algorithms (OSCCA GB/T 32907-2016,
528	  ISO/IEC 18033-3:2010/Amd 1:2021)
529
530	  SM4 (GBT.32907-2016) is a cryptographic standard issued by the
531	  Organization of State Commercial Administration of China (OSCCA)
532	  as an authorized cryptographic algorithms for the use within China.
533
534	  SMS4 was originally created for use in protecting wireless
535	  networks, and is mandated in the Chinese National Standard for
536	  Wireless LAN WAPI (Wired Authentication and Privacy Infrastructure)
537	  (GB.15629.11-2003).
538
539	  The latest SM4 standard (GBT.32907-2016) was proposed by OSCCA and
540	  standardized through TC 260 of the Standardization Administration
541	  of the People's Republic of China (SAC).
542
543	  The input, output, and key of SMS4 are each 128 bits.
544
545	  See https://eprint.iacr.org/2008/329.pdf for further information.
546
547	  If unsure, say N.
548
549config CRYPTO_TEA
550	tristate "TEA, XTEA and XETA"
551	depends on CRYPTO_USER_API_ENABLE_OBSOLETE
552	select CRYPTO_ALGAPI
553	help
554	  TEA (Tiny Encryption Algorithm) cipher algorithms
555
556	  Tiny Encryption Algorithm is a simple cipher that uses
557	  many rounds for security.  It is very fast and uses
558	  little memory.
559
560	  Xtendend Tiny Encryption Algorithm is a modification to
561	  the TEA algorithm to address a potential key weakness
562	  in the TEA algorithm.
563
564	  Xtendend Encryption Tiny Algorithm is a mis-implementation
565	  of the XTEA algorithm for compatibility purposes.
566
567config CRYPTO_TWOFISH
568	tristate "Twofish"
569	select CRYPTO_ALGAPI
570	select CRYPTO_TWOFISH_COMMON
571	help
572	  Twofish cipher algorithm
573
574	  Twofish was submitted as an AES (Advanced Encryption Standard)
575	  candidate cipher by researchers at CounterPane Systems.  It is a
576	  16 round block cipher supporting key sizes of 128, 192, and 256
577	  bits.
578
579	  See https://www.schneier.com/twofish.html for further information.
580
581config CRYPTO_TWOFISH_COMMON
582	tristate
583	help
584	  Common parts of the Twofish cipher algorithm shared by the
585	  generic c and the assembler implementations.
586
587endmenu
588
589menu "Length-preserving ciphers and modes"
590
591config CRYPTO_ADIANTUM
592	tristate "Adiantum"
593	select CRYPTO_CHACHA20
594	select CRYPTO_LIB_POLY1305_GENERIC
595	select CRYPTO_NHPOLY1305
596	select CRYPTO_MANAGER
597	help
598	  Adiantum tweakable, length-preserving encryption mode
599
600	  Designed for fast and secure disk encryption, especially on
601	  CPUs without dedicated crypto instructions.  It encrypts
602	  each sector using the XChaCha12 stream cipher, two passes of
603	  an ε-almost-∆-universal hash function, and an invocation of
604	  the AES-256 block cipher on a single 16-byte block.  On CPUs
605	  without AES instructions, Adiantum is much faster than
606	  AES-XTS.
607
608	  Adiantum's security is provably reducible to that of its
609	  underlying stream and block ciphers, subject to a security
610	  bound.  Unlike XTS, Adiantum is a true wide-block encryption
611	  mode, so it actually provides an even stronger notion of
612	  security than XTS, subject to the security bound.
613
614	  If unsure, say N.
615
616config CRYPTO_ARC4
617	tristate "ARC4 (Alleged Rivest Cipher 4)"
618	depends on CRYPTO_USER_API_ENABLE_OBSOLETE
619	select CRYPTO_SKCIPHER
620	select CRYPTO_LIB_ARC4
621	help
622	  ARC4 cipher algorithm
623
624	  ARC4 is a stream cipher using keys ranging from 8 bits to 2048
625	  bits in length.  This algorithm is required for driver-based
626	  WEP, but it should not be for other purposes because of the
627	  weakness of the algorithm.
628
629config CRYPTO_CHACHA20
630	tristate "ChaCha"
631	select CRYPTO_LIB_CHACHA_GENERIC
632	select CRYPTO_LIB_CHACHA_INTERNAL
633	select CRYPTO_SKCIPHER
634	help
635	  The ChaCha20, XChaCha20, and XChaCha12 stream cipher algorithms
636
637	  ChaCha20 is a 256-bit high-speed stream cipher designed by Daniel J.
638	  Bernstein and further specified in RFC7539 for use in IETF protocols.
639	  This is the portable C implementation of ChaCha20.  See
640	  https://cr.yp.to/chacha/chacha-20080128.pdf for further information.
641
642	  XChaCha20 is the application of the XSalsa20 construction to ChaCha20
643	  rather than to Salsa20.  XChaCha20 extends ChaCha20's nonce length
644	  from 64 bits (or 96 bits using the RFC7539 convention) to 192 bits,
645	  while provably retaining ChaCha20's security.  See
646	  https://cr.yp.to/snuffle/xsalsa-20081128.pdf for further information.
647
648	  XChaCha12 is XChaCha20 reduced to 12 rounds, with correspondingly
649	  reduced security margin but increased performance.  It can be needed
650	  in some performance-sensitive scenarios.
651
652config CRYPTO_CBC
653	tristate "CBC (Cipher Block Chaining)"
654	select CRYPTO_SKCIPHER
655	select CRYPTO_MANAGER
656	help
657	  CBC (Cipher Block Chaining) mode (NIST SP800-38A)
658
659	  This block cipher mode is required for IPSec ESP (XFRM_ESP).
660
661config CRYPTO_CTR
662	tristate "CTR (Counter)"
663	select CRYPTO_SKCIPHER
664	select CRYPTO_MANAGER
665	help
666	  CTR (Counter) mode (NIST SP800-38A)
667
668config CRYPTO_CTS
669	tristate "CTS (Cipher Text Stealing)"
670	select CRYPTO_SKCIPHER
671	select CRYPTO_MANAGER
672	help
673	  CBC-CS3 variant of CTS (Cipher Text Stealing) (NIST
674	  Addendum to SP800-38A (October 2010))
675
676	  This mode is required for Kerberos gss mechanism support
677	  for AES encryption.
678
679config CRYPTO_ECB
680	tristate "ECB (Electronic Codebook)"
681	select CRYPTO_SKCIPHER2
682	select CRYPTO_MANAGER
683	help
684	  ECB (Electronic Codebook) mode (NIST SP800-38A)
685
686config CRYPTO_HCTR2
687	tristate "HCTR2"
688	select CRYPTO_XCTR
689	select CRYPTO_POLYVAL
690	select CRYPTO_MANAGER
691	help
692	  HCTR2 length-preserving encryption mode
693
694	  A mode for storage encryption that is efficient on processors with
695	  instructions to accelerate AES and carryless multiplication, e.g.
696	  x86 processors with AES-NI and CLMUL, and ARM processors with the
697	  ARMv8 crypto extensions.
698
699	  See https://eprint.iacr.org/2021/1441
700
701config CRYPTO_LRW
702	tristate "LRW (Liskov Rivest Wagner)"
703	select CRYPTO_LIB_GF128MUL
704	select CRYPTO_SKCIPHER
705	select CRYPTO_MANAGER
706	select CRYPTO_ECB
707	help
708	  LRW (Liskov Rivest Wagner) mode
709
710	  A tweakable, non malleable, non movable
711	  narrow block cipher mode for dm-crypt.  Use it with cipher
712	  specification string aes-lrw-benbi, the key must be 256, 320 or 384.
713	  The first 128, 192 or 256 bits in the key are used for AES and the
714	  rest is used to tie each cipher block to its logical position.
715
716	  See https://people.csail.mit.edu/rivest/pubs/LRW02.pdf
717
718config CRYPTO_PCBC
719	tristate "PCBC (Propagating Cipher Block Chaining)"
720	select CRYPTO_SKCIPHER
721	select CRYPTO_MANAGER
722	help
723	  PCBC (Propagating Cipher Block Chaining) mode
724
725	  This block cipher mode is required for RxRPC.
726
727config CRYPTO_XCTR
728	tristate
729	select CRYPTO_SKCIPHER
730	select CRYPTO_MANAGER
731	help
732	  XCTR (XOR Counter) mode for HCTR2
733
734	  This blockcipher mode is a variant of CTR mode using XORs and little-endian
735	  addition rather than big-endian arithmetic.
736
737	  XCTR mode is used to implement HCTR2.
738
739config CRYPTO_XTS
740	tristate "XTS (XOR Encrypt XOR with ciphertext stealing)"
741	select CRYPTO_SKCIPHER
742	select CRYPTO_MANAGER
743	select CRYPTO_ECB
744	help
745	  XTS (XOR Encrypt XOR with ciphertext stealing) mode (NIST SP800-38E
746	  and IEEE 1619)
747
748	  Use with aes-xts-plain, key size 256, 384 or 512 bits. This
749	  implementation currently can't handle a sectorsize which is not a
750	  multiple of 16 bytes.
751
752config CRYPTO_NHPOLY1305
753	tristate
754	select CRYPTO_HASH
755	select CRYPTO_LIB_POLY1305_GENERIC
756
757endmenu
758
759menu "AEAD (authenticated encryption with associated data) ciphers"
760
761config CRYPTO_AEGIS128
762	tristate "AEGIS-128"
763	select CRYPTO_AEAD
764	select CRYPTO_AES  # for AES S-box tables
765	help
766	  AEGIS-128 AEAD algorithm
767
768config CRYPTO_AEGIS128_SIMD
769	bool "AEGIS-128 (arm NEON, arm64 NEON)"
770	depends on CRYPTO_AEGIS128 && ((ARM || ARM64) && KERNEL_MODE_NEON)
771	default y
772	help
773	  AEGIS-128 AEAD algorithm
774
775	  Architecture: arm or arm64 using:
776	  - NEON (Advanced SIMD) extension
777
778config CRYPTO_CHACHA20POLY1305
779	tristate "ChaCha20-Poly1305"
780	select CRYPTO_CHACHA20
781	select CRYPTO_POLY1305
782	select CRYPTO_AEAD
783	select CRYPTO_MANAGER
784	help
785	  ChaCha20 stream cipher and Poly1305 authenticator combined
786	  mode (RFC8439)
787
788config CRYPTO_CCM
789	tristate "CCM (Counter with Cipher Block Chaining-MAC)"
790	select CRYPTO_CTR
791	select CRYPTO_HASH
792	select CRYPTO_AEAD
793	select CRYPTO_MANAGER
794	help
795	  CCM (Counter with Cipher Block Chaining-Message Authentication Code)
796	  authenticated encryption mode (NIST SP800-38C)
797
798config CRYPTO_GCM
799	tristate "GCM (Galois/Counter Mode) and GMAC (GCM MAC)"
800	select CRYPTO_CTR
801	select CRYPTO_AEAD
802	select CRYPTO_GHASH
803	select CRYPTO_NULL
804	select CRYPTO_MANAGER
805	help
806	  GCM (Galois/Counter Mode) authenticated encryption mode and GMAC
807	  (GCM Message Authentication Code) (NIST SP800-38D)
808
809	  This is required for IPSec ESP (XFRM_ESP).
810
811config CRYPTO_GENIV
812	tristate
813	select CRYPTO_AEAD
814	select CRYPTO_NULL
815	select CRYPTO_MANAGER
816	select CRYPTO_RNG_DEFAULT
817
818config CRYPTO_SEQIV
819	tristate "Sequence Number IV Generator"
820	select CRYPTO_GENIV
821	help
822	  Sequence Number IV generator
823
824	  This IV generator generates an IV based on a sequence number by
825	  xoring it with a salt.  This algorithm is mainly useful for CTR.
826
827	  This is required for IPsec ESP (XFRM_ESP).
828
829config CRYPTO_ECHAINIV
830	tristate "Encrypted Chain IV Generator"
831	select CRYPTO_GENIV
832	help
833	  Encrypted Chain IV generator
834
835	  This IV generator generates an IV based on the encryption of
836	  a sequence number xored with a salt.  This is the default
837	  algorithm for CBC.
838
839config CRYPTO_ESSIV
840	tristate "Encrypted Salt-Sector IV Generator"
841	select CRYPTO_AUTHENC
842	help
843	  Encrypted Salt-Sector IV generator
844
845	  This IV generator is used in some cases by fscrypt and/or
846	  dm-crypt. It uses the hash of the block encryption key as the
847	  symmetric key for a block encryption pass applied to the input
848	  IV, making low entropy IV sources more suitable for block
849	  encryption.
850
851	  This driver implements a crypto API template that can be
852	  instantiated either as an skcipher or as an AEAD (depending on the
853	  type of the first template argument), and which defers encryption
854	  and decryption requests to the encapsulated cipher after applying
855	  ESSIV to the input IV. Note that in the AEAD case, it is assumed
856	  that the keys are presented in the same format used by the authenc
857	  template, and that the IV appears at the end of the authenticated
858	  associated data (AAD) region (which is how dm-crypt uses it.)
859
860	  Note that the use of ESSIV is not recommended for new deployments,
861	  and so this only needs to be enabled when interoperability with
862	  existing encrypted volumes of filesystems is required, or when
863	  building for a particular system that requires it (e.g., when
864	  the SoC in question has accelerated CBC but not XTS, making CBC
865	  combined with ESSIV the only feasible mode for h/w accelerated
866	  block encryption)
867
868endmenu
869
870menu "Hashes, digests, and MACs"
871
872config CRYPTO_BLAKE2B
873	tristate "BLAKE2b"
874	select CRYPTO_HASH
875	help
876	  BLAKE2b cryptographic hash function (RFC 7693)
877
878	  BLAKE2b is optimized for 64-bit platforms and can produce digests
879	  of any size between 1 and 64 bytes. The keyed hash is also implemented.
880
881	  This module provides the following algorithms:
882	  - blake2b-160
883	  - blake2b-256
884	  - blake2b-384
885	  - blake2b-512
886
887	  Used by the btrfs filesystem.
888
889	  See https://blake2.net for further information.
890
891config CRYPTO_CMAC
892	tristate "CMAC (Cipher-based MAC)"
893	select CRYPTO_HASH
894	select CRYPTO_MANAGER
895	help
896	  CMAC (Cipher-based Message Authentication Code) authentication
897	  mode (NIST SP800-38B and IETF RFC4493)
898
899config CRYPTO_GHASH
900	tristate "GHASH"
901	select CRYPTO_HASH
902	select CRYPTO_LIB_GF128MUL
903	help
904	  GCM GHASH function (NIST SP800-38D)
905
906config CRYPTO_HMAC
907	tristate "HMAC (Keyed-Hash MAC)"
908	select CRYPTO_HASH
909	select CRYPTO_MANAGER
910	help
911	  HMAC (Keyed-Hash Message Authentication Code) (FIPS 198 and
912	  RFC2104)
913
914	  This is required for IPsec AH (XFRM_AH) and IPsec ESP (XFRM_ESP).
915
916config CRYPTO_MD4
917	tristate "MD4"
918	select CRYPTO_HASH
919	help
920	  MD4 message digest algorithm (RFC1320)
921
922config CRYPTO_MD5
923	tristate "MD5"
924	select CRYPTO_HASH
925	help
926	  MD5 message digest algorithm (RFC1321)
927
928config CRYPTO_MICHAEL_MIC
929	tristate "Michael MIC"
930	select CRYPTO_HASH
931	help
932	  Michael MIC (Message Integrity Code) (IEEE 802.11i)
933
934	  Defined by the IEEE 802.11i TKIP (Temporal Key Integrity Protocol),
935	  known as WPA (Wif-Fi Protected Access).
936
937	  This algorithm is required for TKIP, but it should not be used for
938	  other purposes because of the weakness of the algorithm.
939
940config CRYPTO_POLYVAL
941	tristate
942	select CRYPTO_HASH
943	select CRYPTO_LIB_GF128MUL
944	help
945	  POLYVAL hash function for HCTR2
946
947	  This is used in HCTR2.  It is not a general-purpose
948	  cryptographic hash function.
949
950config CRYPTO_POLY1305
951	tristate "Poly1305"
952	select CRYPTO_HASH
953	select CRYPTO_LIB_POLY1305_GENERIC
954	select CRYPTO_LIB_POLY1305_INTERNAL
955	help
956	  Poly1305 authenticator algorithm (RFC7539)
957
958	  Poly1305 is an authenticator algorithm designed by Daniel J. Bernstein.
959	  It is used for the ChaCha20-Poly1305 AEAD, specified in RFC7539 for use
960	  in IETF protocols. This is the portable C implementation of Poly1305.
961
962config CRYPTO_RMD160
963	tristate "RIPEMD-160"
964	select CRYPTO_HASH
965	help
966	  RIPEMD-160 hash function (ISO/IEC 10118-3)
967
968	  RIPEMD-160 is a 160-bit cryptographic hash function. It is intended
969	  to be used as a secure replacement for the 128-bit hash functions
970	  MD4, MD5 and its predecessor RIPEMD
971	  (not to be confused with RIPEMD-128).
972
973	  Its speed is comparable to SHA-1 and there are no known attacks
974	  against RIPEMD-160.
975
976	  Developed by Hans Dobbertin, Antoon Bosselaers and Bart Preneel.
977	  See https://homes.esat.kuleuven.be/~bosselae/ripemd160.html
978	  for further information.
979
980config CRYPTO_SHA1
981	tristate "SHA-1"
982	select CRYPTO_HASH
983	select CRYPTO_LIB_SHA1
984	help
985	  SHA-1 secure hash algorithm (FIPS 180, ISO/IEC 10118-3)
986
987config CRYPTO_SHA256
988	tristate "SHA-224 and SHA-256"
989	select CRYPTO_HASH
990	select CRYPTO_LIB_SHA256
991	help
992	  SHA-224 and SHA-256 secure hash algorithms (FIPS 180, ISO/IEC 10118-3)
993
994	  This is required for IPsec AH (XFRM_AH) and IPsec ESP (XFRM_ESP).
995	  Used by the btrfs filesystem, Ceph, NFS, and SMB.
996
997config CRYPTO_SHA512
998	tristate "SHA-384 and SHA-512"
999	select CRYPTO_HASH
1000	help
1001	  SHA-384 and SHA-512 secure hash algorithms (FIPS 180, ISO/IEC 10118-3)
1002
1003config CRYPTO_SHA3
1004	tristate "SHA-3"
1005	select CRYPTO_HASH
1006	help
1007	  SHA-3 secure hash algorithms (FIPS 202, ISO/IEC 10118-3)
1008
1009config CRYPTO_SM3
1010	tristate
1011
1012config CRYPTO_SM3_GENERIC
1013	tristate "SM3 (ShangMi 3)"
1014	select CRYPTO_HASH
1015	select CRYPTO_SM3
1016	help
1017	  SM3 (ShangMi 3) secure hash function (OSCCA GM/T 0004-2012, ISO/IEC 10118-3)
1018
1019	  This is part of the Chinese Commercial Cryptography suite.
1020
1021	  References:
1022	  http://www.oscca.gov.cn/UpFile/20101222141857786.pdf
1023	  https://datatracker.ietf.org/doc/html/draft-shen-sm3-hash
1024
1025config CRYPTO_STREEBOG
1026	tristate "Streebog"
1027	select CRYPTO_HASH
1028	help
1029	  Streebog Hash Function (GOST R 34.11-2012, RFC 6986, ISO/IEC 10118-3)
1030
1031	  This is one of the Russian cryptographic standard algorithms (called
1032	  GOST algorithms). This setting enables two hash algorithms with
1033	  256 and 512 bits output.
1034
1035	  References:
1036	  https://tc26.ru/upload/iblock/fed/feddbb4d26b685903faa2ba11aea43f6.pdf
1037	  https://tools.ietf.org/html/rfc6986
1038
1039config CRYPTO_WP512
1040	tristate "Whirlpool"
1041	select CRYPTO_HASH
1042	help
1043	  Whirlpool hash function (ISO/IEC 10118-3)
1044
1045	  512, 384 and 256-bit hashes.
1046
1047	  Whirlpool-512 is part of the NESSIE cryptographic primitives.
1048
1049	  See https://web.archive.org/web/20171129084214/http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html
1050	  for further information.
1051
1052config CRYPTO_XCBC
1053	tristate "XCBC-MAC (Extended Cipher Block Chaining MAC)"
1054	select CRYPTO_HASH
1055	select CRYPTO_MANAGER
1056	help
1057	  XCBC-MAC (Extended Cipher Block Chaining Message Authentication
1058	  Code) (RFC3566)
1059
1060config CRYPTO_XXHASH
1061	tristate "xxHash"
1062	select CRYPTO_HASH
1063	select XXHASH
1064	help
1065	  xxHash non-cryptographic hash algorithm
1066
1067	  Extremely fast, working at speeds close to RAM limits.
1068
1069	  Used by the btrfs filesystem.
1070
1071endmenu
1072
1073menu "CRCs (cyclic redundancy checks)"
1074
1075config CRYPTO_CRC32C
1076	tristate "CRC32c"
1077	select CRYPTO_HASH
1078	select CRC32
1079	help
1080	  CRC32c CRC algorithm with the iSCSI polynomial (RFC 3385 and RFC 3720)
1081
1082	  A 32-bit CRC (cyclic redundancy check) with a polynomial defined
1083	  by G. Castagnoli, S. Braeuer and M. Herrman in "Optimization of Cyclic
1084	  Redundancy-Check Codes with 24 and 32 Parity Bits", IEEE Transactions
1085	  on Communications, Vol. 41, No. 6, June 1993, selected for use with
1086	  iSCSI.
1087
1088	  Used by btrfs, ext4, jbd2, NVMeoF/TCP, and iSCSI.
1089
1090config CRYPTO_CRC32
1091	tristate "CRC32"
1092	select CRYPTO_HASH
1093	select CRC32
1094	help
1095	  CRC32 CRC algorithm (IEEE 802.3)
1096
1097	  Used by RoCEv2 and f2fs.
1098
1099config CRYPTO_CRCT10DIF
1100	tristate "CRCT10DIF"
1101	select CRYPTO_HASH
1102	select CRC_T10DIF
1103	help
1104	  CRC16 CRC algorithm used for the T10 (SCSI) Data Integrity Field (DIF)
1105
1106	  CRC algorithm used by the SCSI Block Commands standard.
1107
1108config CRYPTO_CRC64_ROCKSOFT
1109	tristate "CRC64 based on Rocksoft Model algorithm"
1110	depends on CRC64
1111	select CRYPTO_HASH
1112	help
1113	  CRC64 CRC algorithm based on the Rocksoft Model CRC Algorithm
1114
1115	  Used by the NVMe implementation of T10 DIF (BLK_DEV_INTEGRITY)
1116
1117	  See https://zlib.net/crc_v3.txt
1118
1119endmenu
1120
1121menu "Compression"
1122
1123config CRYPTO_DEFLATE
1124	tristate "Deflate"
1125	select CRYPTO_ALGAPI
1126	select CRYPTO_ACOMP2
1127	select ZLIB_INFLATE
1128	select ZLIB_DEFLATE
1129	help
1130	  Deflate compression algorithm (RFC1951)
1131
1132	  Used by IPSec with the IPCOMP protocol (RFC3173, RFC2394)
1133
1134config CRYPTO_LZO
1135	tristate "LZO"
1136	select CRYPTO_ALGAPI
1137	select CRYPTO_ACOMP2
1138	select LZO_COMPRESS
1139	select LZO_DECOMPRESS
1140	help
1141	  LZO compression algorithm
1142
1143	  See https://www.oberhumer.com/opensource/lzo/ for further information.
1144
1145config CRYPTO_842
1146	tristate "842"
1147	select CRYPTO_ALGAPI
1148	select CRYPTO_ACOMP2
1149	select 842_COMPRESS
1150	select 842_DECOMPRESS
1151	help
1152	  842 compression algorithm by IBM
1153
1154	  See https://github.com/plauth/lib842 for further information.
1155
1156config CRYPTO_LZ4
1157	tristate "LZ4"
1158	select CRYPTO_ALGAPI
1159	select CRYPTO_ACOMP2
1160	select LZ4_COMPRESS
1161	select LZ4_DECOMPRESS
1162	help
1163	  LZ4 compression algorithm
1164
1165	  See https://github.com/lz4/lz4 for further information.
1166
1167config CRYPTO_LZ4HC
1168	tristate "LZ4HC"
1169	select CRYPTO_ALGAPI
1170	select CRYPTO_ACOMP2
1171	select LZ4HC_COMPRESS
1172	select LZ4_DECOMPRESS
1173	help
1174	  LZ4 high compression mode algorithm
1175
1176	  See https://github.com/lz4/lz4 for further information.
1177
1178config CRYPTO_ZSTD
1179	tristate "Zstd"
1180	select CRYPTO_ALGAPI
1181	select CRYPTO_ACOMP2
1182	select ZSTD_COMPRESS
1183	select ZSTD_DECOMPRESS
1184	help
1185	  zstd compression algorithm
1186
1187	  See https://github.com/facebook/zstd for further information.
1188
1189endmenu
1190
1191menu "Random number generation"
1192
1193config CRYPTO_ANSI_CPRNG
1194	tristate "ANSI PRNG (Pseudo Random Number Generator)"
1195	select CRYPTO_AES
1196	select CRYPTO_RNG
1197	help
1198	  Pseudo RNG (random number generator) (ANSI X9.31 Appendix A.2.4)
1199
1200	  This uses the AES cipher algorithm.
1201
1202	  Note that this option must be enabled if CRYPTO_FIPS is selected
1203
1204menuconfig CRYPTO_DRBG_MENU
1205	tristate "NIST SP800-90A DRBG (Deterministic Random Bit Generator)"
1206	help
1207	  DRBG (Deterministic Random Bit Generator) (NIST SP800-90A)
1208
1209	  In the following submenu, one or more of the DRBG types must be selected.
1210
1211if CRYPTO_DRBG_MENU
1212
1213config CRYPTO_DRBG_HMAC
1214	bool
1215	default y
1216	select CRYPTO_HMAC
1217	select CRYPTO_SHA512
1218
1219config CRYPTO_DRBG_HASH
1220	bool "Hash_DRBG"
1221	select CRYPTO_SHA256
1222	help
1223	  Hash_DRBG variant as defined in NIST SP800-90A.
1224
1225	  This uses the SHA-1, SHA-256, SHA-384, or SHA-512 hash algorithms.
1226
1227config CRYPTO_DRBG_CTR
1228	bool "CTR_DRBG"
1229	select CRYPTO_AES
1230	select CRYPTO_CTR
1231	help
1232	  CTR_DRBG variant as defined in NIST SP800-90A.
1233
1234	  This uses the AES cipher algorithm with the counter block mode.
1235
1236config CRYPTO_DRBG
1237	tristate
1238	default CRYPTO_DRBG_MENU
1239	select CRYPTO_RNG
1240	select CRYPTO_JITTERENTROPY
1241
1242endif	# if CRYPTO_DRBG_MENU
1243
1244config CRYPTO_JITTERENTROPY
1245	tristate "CPU Jitter Non-Deterministic RNG (Random Number Generator)"
1246	select CRYPTO_RNG
1247	select CRYPTO_SHA3
1248	help
1249	  CPU Jitter RNG (Random Number Generator) from the Jitterentropy library
1250
1251	  A non-physical non-deterministic ("true") RNG (e.g., an entropy source
1252	  compliant with NIST SP800-90B) intended to provide a seed to a
1253	  deterministic RNG (e.g., per NIST SP800-90C).
1254	  This RNG does not perform any cryptographic whitening of the generated
1255	  random numbers.
1256
1257	  See https://www.chronox.de/jent/
1258
1259if CRYPTO_JITTERENTROPY
1260if CRYPTO_FIPS && EXPERT
1261
1262choice
1263	prompt "CPU Jitter RNG Memory Size"
1264	default CRYPTO_JITTERENTROPY_MEMSIZE_2
1265	help
1266	  The Jitter RNG measures the execution time of memory accesses.
1267	  Multiple consecutive memory accesses are performed. If the memory
1268	  size fits into a cache (e.g. L1), only the memory access timing
1269	  to that cache is measured. The closer the cache is to the CPU
1270	  the less variations are measured and thus the less entropy is
1271	  obtained. Thus, if the memory size fits into the L1 cache, the
1272	  obtained entropy is less than if the memory size fits within
1273	  L1 + L2, which in turn is less if the memory fits into
1274	  L1 + L2 + L3. Thus, by selecting a different memory size,
1275	  the entropy rate produced by the Jitter RNG can be modified.
1276
1277	config CRYPTO_JITTERENTROPY_MEMSIZE_2
1278		bool "2048 Bytes (default)"
1279
1280	config CRYPTO_JITTERENTROPY_MEMSIZE_128
1281		bool "128 kBytes"
1282
1283	config CRYPTO_JITTERENTROPY_MEMSIZE_1024
1284		bool "1024 kBytes"
1285
1286	config CRYPTO_JITTERENTROPY_MEMSIZE_8192
1287		bool "8192 kBytes"
1288endchoice
1289
1290config CRYPTO_JITTERENTROPY_MEMORY_BLOCKS
1291	int
1292	default 64 if CRYPTO_JITTERENTROPY_MEMSIZE_2
1293	default 512 if CRYPTO_JITTERENTROPY_MEMSIZE_128
1294	default 1024 if CRYPTO_JITTERENTROPY_MEMSIZE_1024
1295	default 4096 if CRYPTO_JITTERENTROPY_MEMSIZE_8192
1296
1297config CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE
1298	int
1299	default 32 if CRYPTO_JITTERENTROPY_MEMSIZE_2
1300	default 256 if CRYPTO_JITTERENTROPY_MEMSIZE_128
1301	default 1024 if CRYPTO_JITTERENTROPY_MEMSIZE_1024
1302	default 2048 if CRYPTO_JITTERENTROPY_MEMSIZE_8192
1303
1304config CRYPTO_JITTERENTROPY_OSR
1305	int "CPU Jitter RNG Oversampling Rate"
1306	range 1 15
1307	default 3
1308	help
1309	  The Jitter RNG allows the specification of an oversampling rate (OSR).
1310	  The Jitter RNG operation requires a fixed amount of timing
1311	  measurements to produce one output block of random numbers. The
1312	  OSR value is multiplied with the amount of timing measurements to
1313	  generate one output block. Thus, the timing measurement is oversampled
1314	  by the OSR factor. The oversampling allows the Jitter RNG to operate
1315	  on hardware whose timers deliver limited amount of entropy (e.g.
1316	  the timer is coarse) by setting the OSR to a higher value. The
1317	  trade-off, however, is that the Jitter RNG now requires more time
1318	  to generate random numbers.
1319
1320config CRYPTO_JITTERENTROPY_TESTINTERFACE
1321	bool "CPU Jitter RNG Test Interface"
1322	help
1323	  The test interface allows a privileged process to capture
1324	  the raw unconditioned high resolution time stamp noise that
1325	  is collected by the Jitter RNG for statistical analysis. As
1326	  this data is used at the same time to generate random bits,
1327	  the Jitter RNG operates in an insecure mode as long as the
1328	  recording is enabled. This interface therefore is only
1329	  intended for testing purposes and is not suitable for
1330	  production systems.
1331
1332	  The raw noise data can be obtained using the jent_raw_hires
1333	  debugfs file. Using the option
1334	  jitterentropy_testing.boot_raw_hires_test=1 the raw noise of
1335	  the first 1000 entropy events since boot can be sampled.
1336
1337	  If unsure, select N.
1338
1339endif	# if CRYPTO_FIPS && EXPERT
1340
1341if !(CRYPTO_FIPS && EXPERT)
1342
1343config CRYPTO_JITTERENTROPY_MEMORY_BLOCKS
1344	int
1345	default 64
1346
1347config CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE
1348	int
1349	default 32
1350
1351config CRYPTO_JITTERENTROPY_OSR
1352	int
1353	default 1
1354
1355config CRYPTO_JITTERENTROPY_TESTINTERFACE
1356	bool
1357
1358endif	# if !(CRYPTO_FIPS && EXPERT)
1359endif	# if CRYPTO_JITTERENTROPY
1360
1361config CRYPTO_KDF800108_CTR
1362	tristate
1363	select CRYPTO_HMAC
1364	select CRYPTO_SHA256
1365
1366endmenu
1367menu "Userspace interface"
1368
1369config CRYPTO_USER_API
1370	tristate
1371
1372config CRYPTO_USER_API_HASH
1373	tristate "Hash algorithms"
1374	depends on NET
1375	select CRYPTO_HASH
1376	select CRYPTO_USER_API
1377	help
1378	  Enable the userspace interface for hash algorithms.
1379
1380	  See Documentation/crypto/userspace-if.rst and
1381	  https://www.chronox.de/libkcapi/html/index.html
1382
1383config CRYPTO_USER_API_SKCIPHER
1384	tristate "Symmetric key cipher algorithms"
1385	depends on NET
1386	select CRYPTO_SKCIPHER
1387	select CRYPTO_USER_API
1388	help
1389	  Enable the userspace interface for symmetric key cipher algorithms.
1390
1391	  See Documentation/crypto/userspace-if.rst and
1392	  https://www.chronox.de/libkcapi/html/index.html
1393
1394config CRYPTO_USER_API_RNG
1395	tristate "RNG (random number generator) algorithms"
1396	depends on NET
1397	select CRYPTO_RNG
1398	select CRYPTO_USER_API
1399	help
1400	  Enable the userspace interface for RNG (random number generator)
1401	  algorithms.
1402
1403	  See Documentation/crypto/userspace-if.rst and
1404	  https://www.chronox.de/libkcapi/html/index.html
1405
1406config CRYPTO_USER_API_RNG_CAVP
1407	bool "Enable CAVP testing of DRBG"
1408	depends on CRYPTO_USER_API_RNG && CRYPTO_DRBG
1409	help
1410	  Enable extra APIs in the userspace interface for NIST CAVP
1411	  (Cryptographic Algorithm Validation Program) testing:
1412	  - resetting DRBG entropy
1413	  - providing Additional Data
1414
1415	  This should only be enabled for CAVP testing. You should say
1416	  no unless you know what this is.
1417
1418config CRYPTO_USER_API_AEAD
1419	tristate "AEAD cipher algorithms"
1420	depends on NET
1421	select CRYPTO_AEAD
1422	select CRYPTO_SKCIPHER
1423	select CRYPTO_NULL
1424	select CRYPTO_USER_API
1425	help
1426	  Enable the userspace interface for AEAD cipher algorithms.
1427
1428	  See Documentation/crypto/userspace-if.rst and
1429	  https://www.chronox.de/libkcapi/html/index.html
1430
1431config CRYPTO_USER_API_ENABLE_OBSOLETE
1432	bool "Obsolete cryptographic algorithms"
1433	depends on CRYPTO_USER_API
1434	default y
1435	help
1436	  Allow obsolete cryptographic algorithms to be selected that have
1437	  already been phased out from internal use by the kernel, and are
1438	  only useful for userspace clients that still rely on them.
1439
1440endmenu
1441
1442config CRYPTO_HASH_INFO
1443	bool
1444
1445if !KMSAN # avoid false positives from assembly
1446if ARM
1447source "arch/arm/crypto/Kconfig"
1448endif
1449if ARM64
1450source "arch/arm64/crypto/Kconfig"
1451endif
1452if LOONGARCH
1453source "arch/loongarch/crypto/Kconfig"
1454endif
1455if MIPS
1456source "arch/mips/crypto/Kconfig"
1457endif
1458if PPC
1459source "arch/powerpc/crypto/Kconfig"
1460endif
1461if RISCV
1462source "arch/riscv/crypto/Kconfig"
1463endif
1464if S390
1465source "arch/s390/crypto/Kconfig"
1466endif
1467if SPARC
1468source "arch/sparc/crypto/Kconfig"
1469endif
1470if X86
1471source "arch/x86/crypto/Kconfig"
1472endif
1473endif
1474
1475source "drivers/crypto/Kconfig"
1476source "crypto/asymmetric_keys/Kconfig"
1477source "certs/Kconfig"
1478source "crypto/krb5/Kconfig"
1479
1480endif	# if CRYPTO
1481