1 # SPDX-License-Identifier: GPL-2.0
3 # Generic algorithms support
9 # async_tx api: hardware offloaded memory transfer/transform support
11 source "crypto/async_tx/Kconfig"
14 # Cryptographic API Configuration
17 tristate "Cryptographic API"
18 select CRYPTO_LIB_UTILS
20 This option provides the core Cryptographic API.
24 menu "Crypto core or helper"
27 bool "FIPS 200 compliance"
28 depends on (CRYPTO_ANSI_CPRNG || CRYPTO_DRBG) && !CRYPTO_MANAGER_DISABLE_TESTS
29 depends on (MODULE_SIG || !MODULES)
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
36 config CRYPTO_FIPS_NAME
37 string "FIPS Module Name"
38 default "Linux Kernel Cryptographic API"
39 depends on CRYPTO_FIPS
41 This option sets the FIPS Module name reported by the Crypto API via
42 the /proc/sys/crypto/fips_name file.
44 config CRYPTO_FIPS_CUSTOM_VERSION
45 bool "Use Custom FIPS Module Version"
46 depends on CRYPTO_FIPS
49 config CRYPTO_FIPS_VERSION
50 string "FIPS Module Version"
52 depends on CRYPTO_FIPS_CUSTOM_VERSION
54 This option provides the ability to override the FIPS Module Version.
55 By default the KERNELRELEASE value is used.
61 This option provides the API for cryptographic algorithms.
84 config CRYPTO_SKCIPHER
86 select CRYPTO_SKCIPHER2
90 config CRYPTO_SKCIPHER2
101 select CRYPTO_ALGAPI2
110 select CRYPTO_ALGAPI2
112 config CRYPTO_RNG_DEFAULT
114 select CRYPTO_DRBG_MENU
116 config CRYPTO_AKCIPHER2
118 select CRYPTO_ALGAPI2
120 config CRYPTO_AKCIPHER
122 select CRYPTO_AKCIPHER2
127 select CRYPTO_ALGAPI2
136 select CRYPTO_ALGAPI2
144 config CRYPTO_MANAGER
145 tristate "Cryptographic algorithm manager"
146 select CRYPTO_MANAGER2
148 Create default cryptographic template instantiations such as
151 config CRYPTO_MANAGER2
152 def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
155 select CRYPTO_AKCIPHER2
160 select CRYPTO_SKCIPHER2
163 tristate "Userspace cryptographic algorithm configuration"
165 select CRYPTO_MANAGER
167 Userspace configuration for cryptographic instantiations such as
170 config CRYPTO_MANAGER_DISABLE_TESTS
171 bool "Disable run-time self tests"
174 Disable run-time self tests that normally take place at
175 algorithm registration.
177 config CRYPTO_MANAGER_EXTRA_TESTS
178 bool "Enable extra run-time crypto self tests"
179 depends on DEBUG_KERNEL && !CRYPTO_MANAGER_DISABLE_TESTS && CRYPTO_MANAGER
181 Enable extra run-time self tests of registered crypto algorithms,
182 including randomized fuzz tests.
184 This is intended for developer use only, as these tests take much
185 longer to run than the normal self tests.
188 tristate "Null algorithms"
191 These are 'Null' algorithms, used by IPsec, which do nothing.
195 select CRYPTO_ALGAPI2
196 select CRYPTO_SKCIPHER2
200 tristate "Parallel crypto engine"
203 select CRYPTO_MANAGER
206 This converts an arbitrary crypto algorithm into a parallel
207 algorithm that executes in kernel threads.
210 tristate "Software async crypto daemon"
211 select CRYPTO_SKCIPHER
213 select CRYPTO_MANAGER
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.
219 config CRYPTO_AUTHENC
220 tristate "Authenc support"
222 select CRYPTO_SKCIPHER
223 select CRYPTO_MANAGER
227 Authenc: Combined mode wrapper for IPsec.
229 This is required for IPSec ESP (XFRM_ESP).
232 tristate "Testing module"
233 depends on m || EXPERT
234 select CRYPTO_MANAGER
236 Quick & dirty crypto test module.
247 menu "Public-key cryptography"
250 tristate "RSA (Rivest-Shamir-Adleman)"
251 select CRYPTO_AKCIPHER
252 select CRYPTO_MANAGER
256 RSA (Rivest-Shamir-Adleman) public key algorithm (RFC8017)
259 tristate "DH (Diffie-Hellman)"
263 DH (Diffie-Hellman) key exchange algorithm
265 config CRYPTO_DH_RFC7919_GROUPS
266 bool "RFC 7919 FFDHE groups"
268 select CRYPTO_RNG_DEFAULT
270 FFDHE (Finite-Field-based Diffie-Hellman Ephemeral) groups
273 Support these finite-field groups in DH key exchanges:
274 - ffdhe2048, ffdhe3072, ffdhe4096, ffdhe6144, ffdhe8192
280 select CRYPTO_RNG_DEFAULT
283 tristate "ECDH (Elliptic Curve Diffie-Hellman)"
287 ECDH (Elliptic Curve Diffie-Hellman) key exchange algorithm
288 using curves P-192, P-256, and P-384 (FIPS 186)
291 tristate "ECDSA (Elliptic Curve Digital Signature Algorithm)"
293 select CRYPTO_AKCIPHER
296 ECDSA (Elliptic Curve Digital Signature Algorithm) (FIPS 186,
298 using curves P-192, P-256, and P-384
300 Only signature verification is implemented.
303 tristate "EC-RDSA (Elliptic Curve Russian Digital Signature Algorithm)"
305 select CRYPTO_AKCIPHER
306 select CRYPTO_STREEBOG
310 Elliptic Curve Russian Digital Signature Algorithm (GOST R 34.10-2012,
311 RFC 7091, ISO/IEC 14888-3)
313 One of the Russian cryptographic standard algorithms (called GOST
314 algorithms). Only signature verification is implemented.
317 tristate "SM2 (ShangMi 2)"
319 select CRYPTO_AKCIPHER
320 select CRYPTO_MANAGER
324 SM2 (ShangMi 2) public key algorithm
326 Published by State Encryption Management Bureau, China,
327 as specified by OSCCA GM/T 0003.1-2012 -- 0003.5-2012.
330 https://datatracker.ietf.org/doc/draft-shen-sm2-ecdsa/
331 http://www.oscca.gov.cn/sca/xxgk/2010-12/17/content_1002386.shtml
332 http://www.gmbz.org.cn/main/bzlb.html
334 config CRYPTO_CURVE25519
335 tristate "Curve25519"
337 select CRYPTO_LIB_CURVE25519_GENERIC
339 Curve25519 elliptic curve (RFC7748)
346 tristate "AES (Advanced Encryption Standard)"
348 select CRYPTO_LIB_AES
350 AES cipher algorithms (Rijndael)(FIPS-197, ISO/IEC 18033-3)
352 Rijndael appears to be consistently a very good performer in
353 both hardware and software across a wide range of computing
354 environments regardless of its use in feedback or non-feedback
355 modes. Its key setup time is excellent, and its key agility is
356 good. Rijndael's very low memory requirements make it very well
357 suited for restricted-space environments, in which it also
358 demonstrates excellent performance. Rijndael's operations are
359 among the easiest to defend against power and timing attacks.
361 The AES specifies three key sizes: 128, 192 and 256 bits
364 tristate "AES (Advanced Encryption Standard) (fixed time)"
366 select CRYPTO_LIB_AES
368 AES cipher algorithms (Rijndael)(FIPS-197, ISO/IEC 18033-3)
370 This is a generic implementation of AES that attempts to eliminate
371 data dependent latencies as much as possible without affecting
372 performance too much. It is intended for use by the generic CCM
373 and GCM drivers, and other CTR or CMAC/XCBC based modes that rely
374 solely on encryption (although decryption is supported as well, but
375 with a more dramatic performance hit)
377 Instead of using 16 lookup tables of 1 KB each, (8 for encryption and
378 8 for decryption), this implementation only uses just two S-boxes of
379 256 bytes each, and attempts to eliminate data dependent latencies by
380 prefetching the entire table into the cache at the start of each
381 block. Interrupts are also disabled to avoid races where cachelines
382 are evicted when the CPU is interrupted to do something else.
386 depends on CRYPTO_USER_API_ENABLE_OBSOLETE
389 Anubis cipher algorithm
391 Anubis is a variable key length cipher which can use keys from
392 128 bits to 320 bits in length. It was evaluated as a entrant
393 in the NESSIE competition.
395 See https://web.archive.org/web/20160606112246/http://www.larc.usp.br/~pbarreto/AnubisPage.html
396 for further information.
402 ARIA cipher algorithm (RFC5794)
404 ARIA is a standard encryption algorithm of the Republic of Korea.
405 The ARIA specifies three key sizes and rounds.
411 https://seed.kisa.or.kr/kisa/algorithm/EgovAriaInfo.do
413 config CRYPTO_BLOWFISH
416 select CRYPTO_BLOWFISH_COMMON
418 Blowfish cipher algorithm, by Bruce Schneier
420 This is a variable key length cipher which can use keys from 32
421 bits to 448 bits in length. It's fast, simple and specifically
422 designed for use on "large microprocessors".
424 See https://www.schneier.com/blowfish.html for further information.
426 config CRYPTO_BLOWFISH_COMMON
429 Common parts of the Blowfish cipher algorithm shared by the
430 generic c and the assembler implementations.
432 config CRYPTO_CAMELLIA
436 Camellia cipher algorithms (ISO/IEC 18033-3)
438 Camellia is a symmetric key block cipher developed jointly
439 at NTT and Mitsubishi Electric Corporation.
441 The Camellia specifies three key sizes: 128, 192 and 256 bits.
443 See https://info.isl.ntt.co.jp/crypt/eng/camellia/ for further information.
445 config CRYPTO_CAST_COMMON
448 Common parts of the CAST cipher algorithms shared by the
449 generic c and the assembler implementations.
452 tristate "CAST5 (CAST-128)"
454 select CRYPTO_CAST_COMMON
456 CAST5 (CAST-128) cipher algorithm (RFC2144, ISO/IEC 18033-3)
459 tristate "CAST6 (CAST-256)"
461 select CRYPTO_CAST_COMMON
463 CAST6 (CAST-256) encryption algorithm (RFC2612)
466 tristate "DES and Triple DES EDE"
468 select CRYPTO_LIB_DES
470 DES (Data Encryption Standard)(FIPS 46-2, ISO/IEC 18033-3) and
471 Triple DES EDE (Encrypt/Decrypt/Encrypt) (FIPS 46-3, ISO/IEC 18033-3)
477 select CRYPTO_SKCIPHER
479 FCrypt algorithm used by RxRPC
481 See https://ota.polyonymo.us/fcrypt-paper.txt
485 depends on CRYPTO_USER_API_ENABLE_OBSOLETE
488 Khazad cipher algorithm
490 Khazad was a finalist in the initial NESSIE competition. It is
491 an algorithm optimized for 64-bit processors with good performance
492 on 32-bit processors. Khazad uses an 128 bit key size.
494 See https://web.archive.org/web/20171011071731/http://www.larc.usp.br/~pbarreto/KhazadPage.html
495 for further information.
499 depends on CRYPTO_USER_API_ENABLE_OBSOLETE
502 SEED cipher algorithm (RFC4269, ISO/IEC 18033-3)
504 SEED is a 128-bit symmetric key block cipher that has been
505 developed by KISA (Korea Information Security Agency) as a
506 national standard encryption algorithm of the Republic of Korea.
507 It is a 16 round block cipher with the key size of 128 bit.
509 See https://seed.kisa.or.kr/kisa/algorithm/EgovSeedInfo.do
510 for further information.
512 config CRYPTO_SERPENT
516 Serpent cipher algorithm, by Anderson, Biham & Knudsen
518 Keys are allowed to be from 0 to 256 bits in length, in steps
521 See https://www.cl.cam.ac.uk/~rja14/serpent.html for further information.
526 config CRYPTO_SM4_GENERIC
527 tristate "SM4 (ShangMi 4)"
531 SM4 cipher algorithms (OSCCA GB/T 32907-2016,
532 ISO/IEC 18033-3:2010/Amd 1:2021)
534 SM4 (GBT.32907-2016) is a cryptographic standard issued by the
535 Organization of State Commercial Administration of China (OSCCA)
536 as an authorized cryptographic algorithms for the use within China.
538 SMS4 was originally created for use in protecting wireless
539 networks, and is mandated in the Chinese National Standard for
540 Wireless LAN WAPI (Wired Authentication and Privacy Infrastructure)
543 The latest SM4 standard (GBT.32907-2016) was proposed by OSCCA and
544 standardized through TC 260 of the Standardization Administration
545 of the People's Republic of China (SAC).
547 The input, output, and key of SMS4 are each 128 bits.
549 See https://eprint.iacr.org/2008/329.pdf for further information.
554 tristate "TEA, XTEA and XETA"
555 depends on CRYPTO_USER_API_ENABLE_OBSOLETE
558 TEA (Tiny Encryption Algorithm) cipher algorithms
560 Tiny Encryption Algorithm is a simple cipher that uses
561 many rounds for security. It is very fast and uses
564 Xtendend Tiny Encryption Algorithm is a modification to
565 the TEA algorithm to address a potential key weakness
566 in the TEA algorithm.
568 Xtendend Encryption Tiny Algorithm is a mis-implementation
569 of the XTEA algorithm for compatibility purposes.
571 config CRYPTO_TWOFISH
574 select CRYPTO_TWOFISH_COMMON
576 Twofish cipher algorithm
578 Twofish was submitted as an AES (Advanced Encryption Standard)
579 candidate cipher by researchers at CounterPane Systems. It is a
580 16 round block cipher supporting key sizes of 128, 192, and 256
583 See https://www.schneier.com/twofish.html for further information.
585 config CRYPTO_TWOFISH_COMMON
588 Common parts of the Twofish cipher algorithm shared by the
589 generic c and the assembler implementations.
593 menu "Length-preserving ciphers and modes"
595 config CRYPTO_ADIANTUM
597 select CRYPTO_CHACHA20
598 select CRYPTO_LIB_POLY1305_GENERIC
599 select CRYPTO_NHPOLY1305
600 select CRYPTO_MANAGER
602 Adiantum tweakable, length-preserving encryption mode
604 Designed for fast and secure disk encryption, especially on
605 CPUs without dedicated crypto instructions. It encrypts
606 each sector using the XChaCha12 stream cipher, two passes of
607 an ε-almost-∆-universal hash function, and an invocation of
608 the AES-256 block cipher on a single 16-byte block. On CPUs
609 without AES instructions, Adiantum is much faster than
612 Adiantum's security is provably reducible to that of its
613 underlying stream and block ciphers, subject to a security
614 bound. Unlike XTS, Adiantum is a true wide-block encryption
615 mode, so it actually provides an even stronger notion of
616 security than XTS, subject to the security bound.
621 tristate "ARC4 (Alleged Rivest Cipher 4)"
622 depends on CRYPTO_USER_API_ENABLE_OBSOLETE
623 select CRYPTO_SKCIPHER
624 select CRYPTO_LIB_ARC4
626 ARC4 cipher algorithm
628 ARC4 is a stream cipher using keys ranging from 8 bits to 2048
629 bits in length. This algorithm is required for driver-based
630 WEP, but it should not be for other purposes because of the
631 weakness of the algorithm.
633 config CRYPTO_CHACHA20
635 select CRYPTO_LIB_CHACHA_GENERIC
636 select CRYPTO_SKCIPHER
638 The ChaCha20, XChaCha20, and XChaCha12 stream cipher algorithms
640 ChaCha20 is a 256-bit high-speed stream cipher designed by Daniel J.
641 Bernstein and further specified in RFC7539 for use in IETF protocols.
642 This is the portable C implementation of ChaCha20. See
643 https://cr.yp.to/chacha/chacha-20080128.pdf for further information.
645 XChaCha20 is the application of the XSalsa20 construction to ChaCha20
646 rather than to Salsa20. XChaCha20 extends ChaCha20's nonce length
647 from 64 bits (or 96 bits using the RFC7539 convention) to 192 bits,
648 while provably retaining ChaCha20's security. See
649 https://cr.yp.to/snuffle/xsalsa-20081128.pdf for further information.
651 XChaCha12 is XChaCha20 reduced to 12 rounds, with correspondingly
652 reduced security margin but increased performance. It can be needed
653 in some performance-sensitive scenarios.
656 tristate "CBC (Cipher Block Chaining)"
657 select CRYPTO_SKCIPHER
658 select CRYPTO_MANAGER
660 CBC (Cipher Block Chaining) mode (NIST SP800-38A)
662 This block cipher mode is required for IPSec ESP (XFRM_ESP).
665 tristate "CFB (Cipher Feedback)"
666 select CRYPTO_SKCIPHER
667 select CRYPTO_MANAGER
669 CFB (Cipher Feedback) mode (NIST SP800-38A)
671 This block cipher mode is required for TPM2 Cryptography.
674 tristate "CTR (Counter)"
675 select CRYPTO_SKCIPHER
676 select CRYPTO_MANAGER
678 CTR (Counter) mode (NIST SP800-38A)
681 tristate "CTS (Cipher Text Stealing)"
682 select CRYPTO_SKCIPHER
683 select CRYPTO_MANAGER
685 CBC-CS3 variant of CTS (Cipher Text Stealing) (NIST
686 Addendum to SP800-38A (October 2010))
688 This mode is required for Kerberos gss mechanism support
692 tristate "ECB (Electronic Codebook)"
693 select CRYPTO_SKCIPHER2
694 select CRYPTO_MANAGER
696 ECB (Electronic Codebook) mode (NIST SP800-38A)
701 select CRYPTO_POLYVAL
702 select CRYPTO_MANAGER
704 HCTR2 length-preserving encryption mode
706 A mode for storage encryption that is efficient on processors with
707 instructions to accelerate AES and carryless multiplication, e.g.
708 x86 processors with AES-NI and CLMUL, and ARM processors with the
709 ARMv8 crypto extensions.
711 See https://eprint.iacr.org/2021/1441
713 config CRYPTO_KEYWRAP
714 tristate "KW (AES Key Wrap)"
715 select CRYPTO_SKCIPHER
716 select CRYPTO_MANAGER
718 KW (AES Key Wrap) authenticated encryption mode (NIST SP800-38F
719 and RFC3394) without padding.
722 tristate "LRW (Liskov Rivest Wagner)"
723 select CRYPTO_LIB_GF128MUL
724 select CRYPTO_SKCIPHER
725 select CRYPTO_MANAGER
728 LRW (Liskov Rivest Wagner) mode
730 A tweakable, non malleable, non movable
731 narrow block cipher mode for dm-crypt. Use it with cipher
732 specification string aes-lrw-benbi, the key must be 256, 320 or 384.
733 The first 128, 192 or 256 bits in the key are used for AES and the
734 rest is used to tie each cipher block to its logical position.
736 See https://people.csail.mit.edu/rivest/pubs/LRW02.pdf
739 tristate "OFB (Output Feedback)"
740 select CRYPTO_SKCIPHER
741 select CRYPTO_MANAGER
743 OFB (Output Feedback) mode (NIST SP800-38A)
745 This mode makes a block cipher into a synchronous
746 stream cipher. It generates keystream blocks, which are then XORed
747 with the plaintext blocks to get the ciphertext. Flipping a bit in the
748 ciphertext produces a flipped bit in the plaintext at the same
749 location. This property allows many error correcting codes to function
750 normally even when applied before encryption.
753 tristate "PCBC (Propagating Cipher Block Chaining)"
754 select CRYPTO_SKCIPHER
755 select CRYPTO_MANAGER
757 PCBC (Propagating Cipher Block Chaining) mode
759 This block cipher mode is required for RxRPC.
763 select CRYPTO_SKCIPHER
764 select CRYPTO_MANAGER
766 XCTR (XOR Counter) mode for HCTR2
768 This blockcipher mode is a variant of CTR mode using XORs and little-endian
769 addition rather than big-endian arithmetic.
771 XCTR mode is used to implement HCTR2.
774 tristate "XTS (XOR Encrypt XOR with ciphertext stealing)"
775 select CRYPTO_SKCIPHER
776 select CRYPTO_MANAGER
779 XTS (XOR Encrypt XOR with ciphertext stealing) mode (NIST SP800-38E
782 Use with aes-xts-plain, key size 256, 384 or 512 bits. This
783 implementation currently can't handle a sectorsize which is not a
784 multiple of 16 bytes.
786 config CRYPTO_NHPOLY1305
789 select CRYPTO_LIB_POLY1305_GENERIC
793 menu "AEAD (authenticated encryption with associated data) ciphers"
795 config CRYPTO_AEGIS128
798 select CRYPTO_AES # for AES S-box tables
800 AEGIS-128 AEAD algorithm
802 config CRYPTO_AEGIS128_SIMD
803 bool "AEGIS-128 (arm NEON, arm64 NEON)"
804 depends on CRYPTO_AEGIS128 && ((ARM || ARM64) && KERNEL_MODE_NEON)
807 AEGIS-128 AEAD algorithm
809 Architecture: arm or arm64 using:
810 - NEON (Advanced SIMD) extension
812 config CRYPTO_CHACHA20POLY1305
813 tristate "ChaCha20-Poly1305"
814 select CRYPTO_CHACHA20
815 select CRYPTO_POLY1305
817 select CRYPTO_MANAGER
819 ChaCha20 stream cipher and Poly1305 authenticator combined
823 tristate "CCM (Counter with Cipher Block Chaining-MAC)"
827 select CRYPTO_MANAGER
829 CCM (Counter with Cipher Block Chaining-Message Authentication Code)
830 authenticated encryption mode (NIST SP800-38C)
833 tristate "GCM (Galois/Counter Mode) and GMAC (GCM MAC)"
838 select CRYPTO_MANAGER
840 GCM (Galois/Counter Mode) authenticated encryption mode and GMAC
841 (GCM Message Authentication Code) (NIST SP800-38D)
843 This is required for IPSec ESP (XFRM_ESP).
849 select CRYPTO_MANAGER
850 select CRYPTO_RNG_DEFAULT
853 tristate "Sequence Number IV Generator"
856 Sequence Number IV generator
858 This IV generator generates an IV based on a sequence number by
859 xoring it with a salt. This algorithm is mainly useful for CTR.
861 This is required for IPsec ESP (XFRM_ESP).
863 config CRYPTO_ECHAINIV
864 tristate "Encrypted Chain IV Generator"
867 Encrypted Chain IV generator
869 This IV generator generates an IV based on the encryption of
870 a sequence number xored with a salt. This is the default
874 tristate "Encrypted Salt-Sector IV Generator"
875 select CRYPTO_AUTHENC
877 Encrypted Salt-Sector IV generator
879 This IV generator is used in some cases by fscrypt and/or
880 dm-crypt. It uses the hash of the block encryption key as the
881 symmetric key for a block encryption pass applied to the input
882 IV, making low entropy IV sources more suitable for block
885 This driver implements a crypto API template that can be
886 instantiated either as an skcipher or as an AEAD (depending on the
887 type of the first template argument), and which defers encryption
888 and decryption requests to the encapsulated cipher after applying
889 ESSIV to the input IV. Note that in the AEAD case, it is assumed
890 that the keys are presented in the same format used by the authenc
891 template, and that the IV appears at the end of the authenticated
892 associated data (AAD) region (which is how dm-crypt uses it.)
894 Note that the use of ESSIV is not recommended for new deployments,
895 and so this only needs to be enabled when interoperability with
896 existing encrypted volumes of filesystems is required, or when
897 building for a particular system that requires it (e.g., when
898 the SoC in question has accelerated CBC but not XTS, making CBC
899 combined with ESSIV the only feasible mode for h/w accelerated
904 menu "Hashes, digests, and MACs"
906 config CRYPTO_BLAKE2B
910 BLAKE2b cryptographic hash function (RFC 7693)
912 BLAKE2b is optimized for 64-bit platforms and can produce digests
913 of any size between 1 and 64 bytes. The keyed hash is also implemented.
915 This module provides the following algorithms:
921 Used by the btrfs filesystem.
923 See https://blake2.net for further information.
926 tristate "CMAC (Cipher-based MAC)"
928 select CRYPTO_MANAGER
930 CMAC (Cipher-based Message Authentication Code) authentication
931 mode (NIST SP800-38B and IETF RFC4493)
936 select CRYPTO_LIB_GF128MUL
938 GCM GHASH function (NIST SP800-38D)
941 tristate "HMAC (Keyed-Hash MAC)"
943 select CRYPTO_MANAGER
945 HMAC (Keyed-Hash Message Authentication Code) (FIPS 198 and
948 This is required for IPsec AH (XFRM_AH) and IPsec ESP (XFRM_ESP).
954 MD4 message digest algorithm (RFC1320)
960 MD5 message digest algorithm (RFC1321)
962 config CRYPTO_MICHAEL_MIC
963 tristate "Michael MIC"
966 Michael MIC (Message Integrity Code) (IEEE 802.11i)
968 Defined by the IEEE 802.11i TKIP (Temporal Key Integrity Protocol),
969 known as WPA (Wif-Fi Protected Access).
971 This algorithm is required for TKIP, but it should not be used for
972 other purposes because of the weakness of the algorithm.
974 config CRYPTO_POLYVAL
977 select CRYPTO_LIB_GF128MUL
979 POLYVAL hash function for HCTR2
981 This is used in HCTR2. It is not a general-purpose
982 cryptographic hash function.
984 config CRYPTO_POLY1305
987 select CRYPTO_LIB_POLY1305_GENERIC
989 Poly1305 authenticator algorithm (RFC7539)
991 Poly1305 is an authenticator algorithm designed by Daniel J. Bernstein.
992 It is used for the ChaCha20-Poly1305 AEAD, specified in RFC7539 for use
993 in IETF protocols. This is the portable C implementation of Poly1305.
996 tristate "RIPEMD-160"
999 RIPEMD-160 hash function (ISO/IEC 10118-3)
1001 RIPEMD-160 is a 160-bit cryptographic hash function. It is intended
1002 to be used as a secure replacement for the 128-bit hash functions
1003 MD4, MD5 and its predecessor RIPEMD
1004 (not to be confused with RIPEMD-128).
1006 Its speed is comparable to SHA-1 and there are no known attacks
1009 Developed by Hans Dobbertin, Antoon Bosselaers and Bart Preneel.
1010 See https://homes.esat.kuleuven.be/~bosselae/ripemd160.html
1011 for further information.
1016 select CRYPTO_LIB_SHA1
1018 SHA-1 secure hash algorithm (FIPS 180, ISO/IEC 10118-3)
1020 config CRYPTO_SHA256
1021 tristate "SHA-224 and SHA-256"
1023 select CRYPTO_LIB_SHA256
1025 SHA-224 and SHA-256 secure hash algorithms (FIPS 180, ISO/IEC 10118-3)
1027 This is required for IPsec AH (XFRM_AH) and IPsec ESP (XFRM_ESP).
1028 Used by the btrfs filesystem, Ceph, NFS, and SMB.
1030 config CRYPTO_SHA512
1031 tristate "SHA-384 and SHA-512"
1034 SHA-384 and SHA-512 secure hash algorithms (FIPS 180, ISO/IEC 10118-3)
1040 SHA-3 secure hash algorithms (FIPS 202, ISO/IEC 10118-3)
1045 config CRYPTO_SM3_GENERIC
1046 tristate "SM3 (ShangMi 3)"
1050 SM3 (ShangMi 3) secure hash function (OSCCA GM/T 0004-2012, ISO/IEC 10118-3)
1052 This is part of the Chinese Commercial Cryptography suite.
1055 http://www.oscca.gov.cn/UpFile/20101222141857786.pdf
1056 https://datatracker.ietf.org/doc/html/draft-shen-sm3-hash
1058 config CRYPTO_STREEBOG
1062 Streebog Hash Function (GOST R 34.11-2012, RFC 6986, ISO/IEC 10118-3)
1064 This is one of the Russian cryptographic standard algorithms (called
1065 GOST algorithms). This setting enables two hash algorithms with
1066 256 and 512 bits output.
1069 https://tc26.ru/upload/iblock/fed/feddbb4d26b685903faa2ba11aea43f6.pdf
1070 https://tools.ietf.org/html/rfc6986
1075 select CRYPTO_MANAGER
1077 VMAC is a message authentication algorithm designed for
1078 very high speed on 64-bit architectures.
1080 See https://fastcrypto.org/vmac for further information.
1083 tristate "Whirlpool"
1086 Whirlpool hash function (ISO/IEC 10118-3)
1088 512, 384 and 256-bit hashes.
1090 Whirlpool-512 is part of the NESSIE cryptographic primitives.
1092 See https://web.archive.org/web/20171129084214/http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html
1093 for further information.
1096 tristate "XCBC-MAC (Extended Cipher Block Chaining MAC)"
1098 select CRYPTO_MANAGER
1100 XCBC-MAC (Extended Cipher Block Chaining Message Authentication
1103 config CRYPTO_XXHASH
1108 xxHash non-cryptographic hash algorithm
1110 Extremely fast, working at speeds close to RAM limits.
1112 Used by the btrfs filesystem.
1116 menu "CRCs (cyclic redundancy checks)"
1118 config CRYPTO_CRC32C
1123 CRC32c CRC algorithm with the iSCSI polynomial (RFC 3385 and RFC 3720)
1125 A 32-bit CRC (cyclic redundancy check) with a polynomial defined
1126 by G. Castagnoli, S. Braeuer and M. Herrman in "Optimization of Cyclic
1127 Redundancy-Check Codes with 24 and 32 Parity Bits", IEEE Transactions
1128 on Communications, Vol. 41, No. 6, June 1993, selected for use with
1131 Used by btrfs, ext4, jbd2, NVMeoF/TCP, and iSCSI.
1138 CRC32 CRC algorithm (IEEE 802.3)
1140 Used by RoCEv2 and f2fs.
1142 config CRYPTO_CRCT10DIF
1143 tristate "CRCT10DIF"
1146 CRC16 CRC algorithm used for the T10 (SCSI) Data Integrity Field (DIF)
1148 CRC algorithm used by the SCSI Block Commands standard.
1150 config CRYPTO_CRC64_ROCKSOFT
1151 tristate "CRC64 based on Rocksoft Model algorithm"
1155 CRC64 CRC algorithm based on the Rocksoft Model CRC Algorithm
1157 Used by the NVMe implementation of T10 DIF (BLK_DEV_INTEGRITY)
1159 See https://zlib.net/crc_v3.txt
1165 config CRYPTO_DEFLATE
1167 select CRYPTO_ALGAPI
1168 select CRYPTO_ACOMP2
1172 Deflate compression algorithm (RFC1951)
1174 Used by IPSec with the IPCOMP protocol (RFC3173, RFC2394)
1178 select CRYPTO_ALGAPI
1179 select CRYPTO_ACOMP2
1181 select LZO_DECOMPRESS
1183 LZO compression algorithm
1185 See https://www.oberhumer.com/opensource/lzo/ for further information.
1189 select CRYPTO_ALGAPI
1190 select CRYPTO_ACOMP2
1192 select 842_DECOMPRESS
1194 842 compression algorithm by IBM
1196 See https://github.com/plauth/lib842 for further information.
1200 select CRYPTO_ALGAPI
1201 select CRYPTO_ACOMP2
1203 select LZ4_DECOMPRESS
1205 LZ4 compression algorithm
1207 See https://github.com/lz4/lz4 for further information.
1211 select CRYPTO_ALGAPI
1212 select CRYPTO_ACOMP2
1213 select LZ4HC_COMPRESS
1214 select LZ4_DECOMPRESS
1216 LZ4 high compression mode algorithm
1218 See https://github.com/lz4/lz4 for further information.
1222 select CRYPTO_ALGAPI
1223 select CRYPTO_ACOMP2
1224 select ZSTD_COMPRESS
1225 select ZSTD_DECOMPRESS
1227 zstd compression algorithm
1229 See https://github.com/facebook/zstd for further information.
1233 menu "Random number generation"
1235 config CRYPTO_ANSI_CPRNG
1236 tristate "ANSI PRNG (Pseudo Random Number Generator)"
1240 Pseudo RNG (random number generator) (ANSI X9.31 Appendix A.2.4)
1242 This uses the AES cipher algorithm.
1244 Note that this option must be enabled if CRYPTO_FIPS is selected
1246 menuconfig CRYPTO_DRBG_MENU
1247 tristate "NIST SP800-90A DRBG (Deterministic Random Bit Generator)"
1249 DRBG (Deterministic Random Bit Generator) (NIST SP800-90A)
1251 In the following submenu, one or more of the DRBG types must be selected.
1255 config CRYPTO_DRBG_HMAC
1259 select CRYPTO_SHA512
1261 config CRYPTO_DRBG_HASH
1263 select CRYPTO_SHA256
1265 Hash_DRBG variant as defined in NIST SP800-90A.
1267 This uses the SHA-1, SHA-256, SHA-384, or SHA-512 hash algorithms.
1269 config CRYPTO_DRBG_CTR
1274 CTR_DRBG variant as defined in NIST SP800-90A.
1276 This uses the AES cipher algorithm with the counter block mode.
1280 default CRYPTO_DRBG_MENU
1282 select CRYPTO_JITTERENTROPY
1284 endif # if CRYPTO_DRBG_MENU
1286 config CRYPTO_JITTERENTROPY
1287 tristate "CPU Jitter Non-Deterministic RNG (Random Number Generator)"
1291 CPU Jitter RNG (Random Number Generator) from the Jitterentropy library
1293 A non-physical non-deterministic ("true") RNG (e.g., an entropy source
1294 compliant with NIST SP800-90B) intended to provide a seed to a
1295 deterministic RNG (e.g. per NIST SP800-90C).
1296 This RNG does not perform any cryptographic whitening of the generated
1298 See https://www.chronox.de/jent.html
1300 if CRYPTO_JITTERENTROPY
1301 if CRYPTO_FIPS && EXPERT
1304 prompt "CPU Jitter RNG Memory Size"
1305 default CRYPTO_JITTERENTROPY_MEMSIZE_2
1307 The Jitter RNG measures the execution time of memory accesses.
1308 Multiple consecutive memory accesses are performed. If the memory
1309 size fits into a cache (e.g. L1), only the memory access timing
1310 to that cache is measured. The closer the cache is to the CPU
1311 the less variations are measured and thus the less entropy is
1312 obtained. Thus, if the memory size fits into the L1 cache, the
1313 obtained entropy is less than if the memory size fits within
1314 L1 + L2, which in turn is less if the memory fits into
1315 L1 + L2 + L3. Thus, by selecting a different memory size,
1316 the entropy rate produced by the Jitter RNG can be modified.
1318 config CRYPTO_JITTERENTROPY_MEMSIZE_2
1319 bool "2048 Bytes (default)"
1321 config CRYPTO_JITTERENTROPY_MEMSIZE_128
1324 config CRYPTO_JITTERENTROPY_MEMSIZE_1024
1327 config CRYPTO_JITTERENTROPY_MEMSIZE_8192
1331 config CRYPTO_JITTERENTROPY_MEMORY_BLOCKS
1333 default 64 if CRYPTO_JITTERENTROPY_MEMSIZE_2
1334 default 512 if CRYPTO_JITTERENTROPY_MEMSIZE_128
1335 default 1024 if CRYPTO_JITTERENTROPY_MEMSIZE_1024
1336 default 4096 if CRYPTO_JITTERENTROPY_MEMSIZE_8192
1338 config CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE
1340 default 32 if CRYPTO_JITTERENTROPY_MEMSIZE_2
1341 default 256 if CRYPTO_JITTERENTROPY_MEMSIZE_128
1342 default 1024 if CRYPTO_JITTERENTROPY_MEMSIZE_1024
1343 default 2048 if CRYPTO_JITTERENTROPY_MEMSIZE_8192
1345 config CRYPTO_JITTERENTROPY_OSR
1346 int "CPU Jitter RNG Oversampling Rate"
1350 The Jitter RNG allows the specification of an oversampling rate (OSR).
1351 The Jitter RNG operation requires a fixed amount of timing
1352 measurements to produce one output block of random numbers. The
1353 OSR value is multiplied with the amount of timing measurements to
1354 generate one output block. Thus, the timing measurement is oversampled
1355 by the OSR factor. The oversampling allows the Jitter RNG to operate
1356 on hardware whose timers deliver limited amount of entropy (e.g.
1357 the timer is coarse) by setting the OSR to a higher value. The
1358 trade-off, however, is that the Jitter RNG now requires more time
1359 to generate random numbers.
1361 config CRYPTO_JITTERENTROPY_TESTINTERFACE
1362 bool "CPU Jitter RNG Test Interface"
1364 The test interface allows a privileged process to capture
1365 the raw unconditioned high resolution time stamp noise that
1366 is collected by the Jitter RNG for statistical analysis. As
1367 this data is used at the same time to generate random bits,
1368 the Jitter RNG operates in an insecure mode as long as the
1369 recording is enabled. This interface therefore is only
1370 intended for testing purposes and is not suitable for
1373 The raw noise data can be obtained using the jent_raw_hires
1374 debugfs file. Using the option
1375 jitterentropy_testing.boot_raw_hires_test=1 the raw noise of
1376 the first 1000 entropy events since boot can be sampled.
1378 If unsure, select N.
1380 endif # if CRYPTO_FIPS && EXPERT
1382 if !(CRYPTO_FIPS && EXPERT)
1384 config CRYPTO_JITTERENTROPY_MEMORY_BLOCKS
1388 config CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE
1392 config CRYPTO_JITTERENTROPY_OSR
1396 config CRYPTO_JITTERENTROPY_TESTINTERFACE
1399 endif # if !(CRYPTO_FIPS && EXPERT)
1400 endif # if CRYPTO_JITTERENTROPY
1402 config CRYPTO_KDF800108_CTR
1405 select CRYPTO_SHA256
1408 menu "Userspace interface"
1410 config CRYPTO_USER_API
1413 config CRYPTO_USER_API_HASH
1414 tristate "Hash algorithms"
1417 select CRYPTO_USER_API
1419 Enable the userspace interface for hash algorithms.
1421 See Documentation/crypto/userspace-if.rst and
1422 https://www.chronox.de/libkcapi/html/index.html
1424 config CRYPTO_USER_API_SKCIPHER
1425 tristate "Symmetric key cipher algorithms"
1427 select CRYPTO_SKCIPHER
1428 select CRYPTO_USER_API
1430 Enable the userspace interface for symmetric key cipher algorithms.
1432 See Documentation/crypto/userspace-if.rst and
1433 https://www.chronox.de/libkcapi/html/index.html
1435 config CRYPTO_USER_API_RNG
1436 tristate "RNG (random number generator) algorithms"
1439 select CRYPTO_USER_API
1441 Enable the userspace interface for RNG (random number generator)
1444 See Documentation/crypto/userspace-if.rst and
1445 https://www.chronox.de/libkcapi/html/index.html
1447 config CRYPTO_USER_API_RNG_CAVP
1448 bool "Enable CAVP testing of DRBG"
1449 depends on CRYPTO_USER_API_RNG && CRYPTO_DRBG
1451 Enable extra APIs in the userspace interface for NIST CAVP
1452 (Cryptographic Algorithm Validation Program) testing:
1453 - resetting DRBG entropy
1454 - providing Additional Data
1456 This should only be enabled for CAVP testing. You should say
1457 no unless you know what this is.
1459 config CRYPTO_USER_API_AEAD
1460 tristate "AEAD cipher algorithms"
1463 select CRYPTO_SKCIPHER
1465 select CRYPTO_USER_API
1467 Enable the userspace interface for AEAD cipher algorithms.
1469 See Documentation/crypto/userspace-if.rst and
1470 https://www.chronox.de/libkcapi/html/index.html
1472 config CRYPTO_USER_API_ENABLE_OBSOLETE
1473 bool "Obsolete cryptographic algorithms"
1474 depends on CRYPTO_USER_API
1477 Allow obsolete cryptographic algorithms to be selected that have
1478 already been phased out from internal use by the kernel, and are
1479 only useful for userspace clients that still rely on them.
1482 bool "Crypto usage statistics"
1483 depends on CRYPTO_USER
1485 Enable the gathering of crypto stats.
1487 Enabling this option reduces the performance of the crypto API. It
1488 should only be enabled when there is actually a use case for it.
1490 This collects data sizes, numbers of requests, and numbers
1491 of errors processed by:
1492 - AEAD ciphers (encrypt, decrypt)
1493 - asymmetric key ciphers (encrypt, decrypt, verify, sign)
1494 - symmetric key ciphers (encrypt, decrypt)
1495 - compression algorithms (compress, decompress)
1496 - hash algorithms (hash)
1497 - key-agreement protocol primitives (setsecret, generate
1498 public key, compute shared secret)
1499 - RNG (generate, seed)
1503 config CRYPTO_HASH_INFO
1506 if !KMSAN # avoid false positives from assembly
1508 source "arch/arm/crypto/Kconfig"
1511 source "arch/arm64/crypto/Kconfig"
1514 source "arch/loongarch/crypto/Kconfig"
1517 source "arch/mips/crypto/Kconfig"
1520 source "arch/powerpc/crypto/Kconfig"
1523 source "arch/s390/crypto/Kconfig"
1526 source "arch/sparc/crypto/Kconfig"
1529 source "arch/x86/crypto/Kconfig"
1533 source "drivers/crypto/Kconfig"
1534 source "crypto/asymmetric_keys/Kconfig"
1535 source "certs/Kconfig"