1# SPDX-License-Identifier: GPL-2.0-or-later 2 3config CRYPTO_LIB_AES_CBC_MACS_KUNIT_TEST 4 tristate "KUnit tests for AES-CMAC, AES-XCBC-MAC, and AES-CBC-MAC" if !KUNIT_ALL_TESTS 5 depends on KUNIT && CRYPTO_LIB_AES_CBC_MACS 6 default KUNIT_ALL_TESTS 7 select CRYPTO_LIB_BENCHMARK_VISIBLE 8 help 9 KUnit tests for the AES-CMAC, AES-XCBC-MAC, and AES-CBC-MAC message 10 authentication codes. 11 12config CRYPTO_LIB_BLAKE2B_KUNIT_TEST 13 tristate "KUnit tests for BLAKE2b" if !KUNIT_ALL_TESTS 14 depends on KUNIT && CRYPTO_LIB_BLAKE2B 15 default KUNIT_ALL_TESTS 16 select CRYPTO_LIB_BENCHMARK_VISIBLE 17 help 18 KUnit tests for the BLAKE2b cryptographic hash function. 19 20config CRYPTO_LIB_BLAKE2S_KUNIT_TEST 21 tristate "KUnit tests for BLAKE2s" if !KUNIT_ALL_TESTS 22 depends on KUNIT 23 default KUNIT_ALL_TESTS 24 select CRYPTO_LIB_BENCHMARK_VISIBLE 25 # No need to depend on CRYPTO_LIB_BLAKE2S here, as that option doesn't 26 # exist; the BLAKE2s code is always built-in for the /dev/random driver. 27 help 28 KUnit tests for the BLAKE2s cryptographic hash function. 29 30config CRYPTO_LIB_CURVE25519_KUNIT_TEST 31 tristate "KUnit tests for Curve25519" if !KUNIT_ALL_TESTS 32 depends on KUNIT && CRYPTO_LIB_CURVE25519 33 default KUNIT_ALL_TESTS 34 select CRYPTO_LIB_BENCHMARK_VISIBLE 35 help 36 KUnit tests for the Curve25519 Diffie-Hellman function. 37 38config CRYPTO_LIB_GHASH_KUNIT_TEST 39 tristate "KUnit tests for GHASH" if !KUNIT_ALL_TESTS 40 depends on KUNIT && CRYPTO_LIB_GF128HASH 41 default KUNIT_ALL_TESTS 42 select CRYPTO_LIB_BENCHMARK_VISIBLE 43 help 44 KUnit tests for the GHASH library functions. 45 46config CRYPTO_LIB_MD5_KUNIT_TEST 47 tristate "KUnit tests for MD5" if !KUNIT_ALL_TESTS 48 depends on KUNIT && CRYPTO_LIB_MD5 49 default KUNIT_ALL_TESTS 50 select CRYPTO_LIB_BENCHMARK_VISIBLE 51 help 52 KUnit tests for the MD5 cryptographic hash function and its 53 corresponding HMAC. 54 55config CRYPTO_LIB_MLDSA_KUNIT_TEST 56 tristate "KUnit tests for ML-DSA" if !KUNIT_ALL_TESTS 57 depends on KUNIT && CRYPTO_LIB_MLDSA 58 default KUNIT_ALL_TESTS 59 select CRYPTO_LIB_BENCHMARK_VISIBLE 60 help 61 KUnit tests for the ML-DSA digital signature algorithm. 62 63config CRYPTO_LIB_NH_KUNIT_TEST 64 tristate "KUnit tests for NH" if !KUNIT_ALL_TESTS 65 depends on KUNIT && CRYPTO_LIB_NH 66 default KUNIT_ALL_TESTS 67 help 68 KUnit tests for the NH almost-universal hash function. 69 70config CRYPTO_LIB_POLY1305_KUNIT_TEST 71 tristate "KUnit tests for Poly1305" if !KUNIT_ALL_TESTS 72 depends on KUNIT && CRYPTO_LIB_POLY1305 73 default KUNIT_ALL_TESTS 74 select CRYPTO_LIB_BENCHMARK_VISIBLE 75 help 76 KUnit tests for the Poly1305 library functions. 77 78config CRYPTO_LIB_POLYVAL_KUNIT_TEST 79 tristate "KUnit tests for POLYVAL" if !KUNIT_ALL_TESTS 80 depends on KUNIT && CRYPTO_LIB_GF128HASH 81 default KUNIT_ALL_TESTS 82 select CRYPTO_LIB_BENCHMARK_VISIBLE 83 help 84 KUnit tests for the POLYVAL library functions. 85 86config CRYPTO_LIB_SHA1_KUNIT_TEST 87 tristate "KUnit tests for SHA-1" if !KUNIT_ALL_TESTS 88 depends on KUNIT && CRYPTO_LIB_SHA1 89 default KUNIT_ALL_TESTS 90 select CRYPTO_LIB_BENCHMARK_VISIBLE 91 help 92 KUnit tests for the SHA-1 cryptographic hash function and its 93 corresponding HMAC. 94 95# Option is named *_SHA256_KUNIT_TEST, though both SHA-224 and SHA-256 tests are 96# included, for consistency with the naming used elsewhere (e.g. CRYPTO_SHA256). 97config CRYPTO_LIB_SHA256_KUNIT_TEST 98 tristate "KUnit tests for SHA-224 and SHA-256" if !KUNIT_ALL_TESTS 99 depends on KUNIT && CRYPTO_LIB_SHA256 100 default KUNIT_ALL_TESTS 101 select CRYPTO_LIB_BENCHMARK_VISIBLE 102 help 103 KUnit tests for the SHA-224 and SHA-256 cryptographic hash functions 104 and their corresponding HMACs. 105 106# Option is named *_SHA512_KUNIT_TEST, though both SHA-384 and SHA-512 tests are 107# included, for consistency with the naming used elsewhere (e.g. CRYPTO_SHA512). 108config CRYPTO_LIB_SHA512_KUNIT_TEST 109 tristate "KUnit tests for SHA-384 and SHA-512" if !KUNIT_ALL_TESTS 110 depends on KUNIT && CRYPTO_LIB_SHA512 111 default KUNIT_ALL_TESTS 112 select CRYPTO_LIB_BENCHMARK_VISIBLE 113 help 114 KUnit tests for the SHA-384 and SHA-512 cryptographic hash functions 115 and their corresponding HMACs. 116 117config CRYPTO_LIB_SHA3_KUNIT_TEST 118 tristate "KUnit tests for SHA-3" if !KUNIT_ALL_TESTS 119 depends on KUNIT && CRYPTO_LIB_SHA3 120 default KUNIT_ALL_TESTS 121 select CRYPTO_LIB_BENCHMARK_VISIBLE 122 help 123 KUnit tests for the SHA3 cryptographic hash and XOF functions, 124 including SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128 and 125 SHAKE256. 126 127config CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT 128 tristate "Enable all crypto library code for KUnit tests" 129 depends on KUNIT 130 select CRYPTO_LIB_AES_CBC_MACS 131 select CRYPTO_LIB_BLAKE2B 132 select CRYPTO_LIB_CURVE25519 133 select CRYPTO_LIB_GF128HASH 134 select CRYPTO_LIB_MD5 135 select CRYPTO_LIB_MLDSA 136 select CRYPTO_LIB_NH 137 select CRYPTO_LIB_POLY1305 138 select CRYPTO_LIB_SHA1 139 select CRYPTO_LIB_SHA256 140 select CRYPTO_LIB_SHA512 141 select CRYPTO_LIB_SHA3 142 help 143 Enable all the crypto library code that has KUnit tests. 144 145 Enable this only if you'd like to test all the crypto library code, 146 even code that wouldn't otherwise need to be built. 147 148 You'll still need to enable the tests themselves, either individually 149 or using KUNIT_ALL_TESTS. 150 151config CRYPTO_LIB_BENCHMARK_VISIBLE 152 bool 153 154config CRYPTO_LIB_BENCHMARK 155 bool "Include benchmarks in KUnit tests for cryptographic functions" 156 depends on CRYPTO_LIB_BENCHMARK_VISIBLE 157 help 158 Include benchmarks in the KUnit tests for cryptographic functions. 159 The benchmark results are printed to the kernel log when the 160 corresponding KUnit test suite runs. 161 162 This is useful for evaluating the performance of the cryptographic 163 functions. However, it will increase the runtime of the KUnit tests. 164 165 If you're only interested in correctness testing, leave this disabled. 166