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