xref: /linux/lib/crypto/tests/Kconfig (revision ed894faccb8de55cd755e093c4b0971f190d384d)
1# SPDX-License-Identifier: GPL-2.0-or-later
2
3config CRYPTO_LIB_BLAKE2B_KUNIT_TEST
4	tristate "KUnit tests for BLAKE2b" if !KUNIT_ALL_TESTS
5	depends on KUNIT
6	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
7	select CRYPTO_LIB_BENCHMARK_VISIBLE
8	select CRYPTO_LIB_BLAKE2B
9	help
10	  KUnit tests for the BLAKE2b cryptographic hash function.
11
12config CRYPTO_LIB_BLAKE2S_KUNIT_TEST
13	tristate "KUnit tests for BLAKE2s" if !KUNIT_ALL_TESTS
14	depends on KUNIT
15	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
16	select CRYPTO_LIB_BENCHMARK_VISIBLE
17	# No need to select CRYPTO_LIB_BLAKE2S here, as that option doesn't
18	# exist; the BLAKE2s code is always built-in for the /dev/random driver.
19	help
20	  KUnit tests for the BLAKE2s cryptographic hash function.
21
22config CRYPTO_LIB_CURVE25519_KUNIT_TEST
23	tristate "KUnit tests for Curve25519" if !KUNIT_ALL_TESTS
24	depends on KUNIT
25	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
26	select CRYPTO_LIB_BENCHMARK_VISIBLE
27	select CRYPTO_LIB_CURVE25519
28	help
29	  KUnit tests for the Curve25519 Diffie-Hellman function.
30
31config CRYPTO_LIB_MD5_KUNIT_TEST
32	tristate "KUnit tests for MD5" if !KUNIT_ALL_TESTS
33	depends on KUNIT
34	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
35	select CRYPTO_LIB_BENCHMARK_VISIBLE
36	select CRYPTO_LIB_MD5
37	help
38	  KUnit tests for the MD5 cryptographic hash function and its
39	  corresponding HMAC.
40
41config CRYPTO_LIB_MLDSA_KUNIT_TEST
42	tristate "KUnit tests for ML-DSA" if !KUNIT_ALL_TESTS
43	depends on KUNIT
44	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
45	select CRYPTO_LIB_BENCHMARK_VISIBLE
46	select CRYPTO_LIB_MLDSA
47	help
48	  KUnit tests for the ML-DSA digital signature algorithm.
49
50config CRYPTO_LIB_POLY1305_KUNIT_TEST
51	tristate "KUnit tests for Poly1305" if !KUNIT_ALL_TESTS
52	depends on KUNIT
53	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
54	select CRYPTO_LIB_BENCHMARK_VISIBLE
55	select CRYPTO_LIB_POLY1305
56	help
57	  KUnit tests for the Poly1305 library functions.
58
59config CRYPTO_LIB_POLYVAL_KUNIT_TEST
60	tristate "KUnit tests for POLYVAL" if !KUNIT_ALL_TESTS
61	depends on KUNIT
62	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
63	select CRYPTO_LIB_BENCHMARK_VISIBLE
64	select CRYPTO_LIB_POLYVAL
65	help
66	  KUnit tests for the POLYVAL library functions.
67
68config CRYPTO_LIB_SHA1_KUNIT_TEST
69	tristate "KUnit tests for SHA-1" if !KUNIT_ALL_TESTS
70	depends on KUNIT
71	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
72	select CRYPTO_LIB_BENCHMARK_VISIBLE
73	select CRYPTO_LIB_SHA1
74	help
75	  KUnit tests for the SHA-1 cryptographic hash function and its
76	  corresponding HMAC.
77
78# Option is named *_SHA256_KUNIT_TEST, though both SHA-224 and SHA-256 tests are
79# included, for consistency with the naming used elsewhere (e.g. CRYPTO_SHA256).
80config CRYPTO_LIB_SHA256_KUNIT_TEST
81	tristate "KUnit tests for SHA-224 and SHA-256" if !KUNIT_ALL_TESTS
82	depends on KUNIT
83	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
84	select CRYPTO_LIB_BENCHMARK_VISIBLE
85	select CRYPTO_LIB_SHA256
86	help
87	  KUnit tests for the SHA-224 and SHA-256 cryptographic hash functions
88	  and their corresponding HMACs.
89
90# Option is named *_SHA512_KUNIT_TEST, though both SHA-384 and SHA-512 tests are
91# included, for consistency with the naming used elsewhere (e.g. CRYPTO_SHA512).
92config CRYPTO_LIB_SHA512_KUNIT_TEST
93	tristate "KUnit tests for SHA-384 and SHA-512" if !KUNIT_ALL_TESTS
94	depends on KUNIT
95	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
96	select CRYPTO_LIB_BENCHMARK_VISIBLE
97	select CRYPTO_LIB_SHA512
98	help
99	  KUnit tests for the SHA-384 and SHA-512 cryptographic hash functions
100	  and their corresponding HMACs.
101
102config CRYPTO_LIB_SHA3_KUNIT_TEST
103	tristate "KUnit tests for SHA-3" if !KUNIT_ALL_TESTS
104	depends on KUNIT
105	default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
106	select CRYPTO_LIB_BENCHMARK_VISIBLE
107	select CRYPTO_LIB_SHA3
108	help
109	  KUnit tests for the SHA3 cryptographic hash and XOF functions,
110	  including SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128 and
111	  SHAKE256.
112
113config CRYPTO_LIB_BENCHMARK_VISIBLE
114	bool
115
116config CRYPTO_LIB_BENCHMARK
117	bool "Include benchmarks in KUnit tests for cryptographic functions"
118	depends on CRYPTO_LIB_BENCHMARK_VISIBLE
119	help
120	  Include benchmarks in the KUnit tests for cryptographic functions.
121	  The benchmark results are printed to the kernel log when the
122	  corresponding KUnit test suite runs.
123
124	  This is useful for evaluating the performance of the cryptographic
125	  functions.  However, it will increase the runtime of the KUnit tests.
126
127	  If you're only interested in correctness testing, leave this disabled.
128