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_MD5_KUNIT_TEST 39 tristate "KUnit tests for MD5" if !KUNIT_ALL_TESTS 40 depends on KUNIT && CRYPTO_LIB_MD5 41 default KUNIT_ALL_TESTS 42 select CRYPTO_LIB_BENCHMARK_VISIBLE 43 help 44 KUnit tests for the MD5 cryptographic hash function and its 45 corresponding HMAC. 46 47config CRYPTO_LIB_MLDSA_KUNIT_TEST 48 tristate "KUnit tests for ML-DSA" if !KUNIT_ALL_TESTS 49 depends on KUNIT && CRYPTO_LIB_MLDSA 50 default KUNIT_ALL_TESTS 51 select CRYPTO_LIB_BENCHMARK_VISIBLE 52 help 53 KUnit tests for the ML-DSA digital signature algorithm. 54 55config CRYPTO_LIB_NH_KUNIT_TEST 56 tristate "KUnit tests for NH" if !KUNIT_ALL_TESTS 57 depends on KUNIT && CRYPTO_LIB_NH 58 default KUNIT_ALL_TESTS 59 help 60 KUnit tests for the NH almost-universal hash function. 61 62config CRYPTO_LIB_POLY1305_KUNIT_TEST 63 tristate "KUnit tests for Poly1305" if !KUNIT_ALL_TESTS 64 depends on KUNIT && CRYPTO_LIB_POLY1305 65 default KUNIT_ALL_TESTS 66 select CRYPTO_LIB_BENCHMARK_VISIBLE 67 help 68 KUnit tests for the Poly1305 library functions. 69 70config CRYPTO_LIB_POLYVAL_KUNIT_TEST 71 tristate "KUnit tests for POLYVAL" if !KUNIT_ALL_TESTS 72 depends on KUNIT && CRYPTO_LIB_POLYVAL 73 default KUNIT_ALL_TESTS 74 select CRYPTO_LIB_BENCHMARK_VISIBLE 75 help 76 KUnit tests for the POLYVAL library functions. 77 78config CRYPTO_LIB_SHA1_KUNIT_TEST 79 tristate "KUnit tests for SHA-1" if !KUNIT_ALL_TESTS 80 depends on KUNIT && CRYPTO_LIB_SHA1 81 default KUNIT_ALL_TESTS 82 select CRYPTO_LIB_BENCHMARK_VISIBLE 83 help 84 KUnit tests for the SHA-1 cryptographic hash function and its 85 corresponding HMAC. 86 87# Option is named *_SHA256_KUNIT_TEST, though both SHA-224 and SHA-256 tests are 88# included, for consistency with the naming used elsewhere (e.g. CRYPTO_SHA256). 89config CRYPTO_LIB_SHA256_KUNIT_TEST 90 tristate "KUnit tests for SHA-224 and SHA-256" if !KUNIT_ALL_TESTS 91 depends on KUNIT && CRYPTO_LIB_SHA256 92 default KUNIT_ALL_TESTS 93 select CRYPTO_LIB_BENCHMARK_VISIBLE 94 help 95 KUnit tests for the SHA-224 and SHA-256 cryptographic hash functions 96 and their corresponding HMACs. 97 98# Option is named *_SHA512_KUNIT_TEST, though both SHA-384 and SHA-512 tests are 99# included, for consistency with the naming used elsewhere (e.g. CRYPTO_SHA512). 100config CRYPTO_LIB_SHA512_KUNIT_TEST 101 tristate "KUnit tests for SHA-384 and SHA-512" if !KUNIT_ALL_TESTS 102 depends on KUNIT && CRYPTO_LIB_SHA512 103 default KUNIT_ALL_TESTS 104 select CRYPTO_LIB_BENCHMARK_VISIBLE 105 help 106 KUnit tests for the SHA-384 and SHA-512 cryptographic hash functions 107 and their corresponding HMACs. 108 109config CRYPTO_LIB_SHA3_KUNIT_TEST 110 tristate "KUnit tests for SHA-3" if !KUNIT_ALL_TESTS 111 depends on KUNIT && CRYPTO_LIB_SHA3 112 default KUNIT_ALL_TESTS 113 select CRYPTO_LIB_BENCHMARK_VISIBLE 114 help 115 KUnit tests for the SHA3 cryptographic hash and XOF functions, 116 including SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128 and 117 SHAKE256. 118 119config CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT 120 tristate "Enable all crypto library code for KUnit tests" 121 depends on KUNIT 122 select CRYPTO_LIB_AES_CBC_MACS 123 select CRYPTO_LIB_BLAKE2B 124 select CRYPTO_LIB_CURVE25519 125 select CRYPTO_LIB_MD5 126 select CRYPTO_LIB_MLDSA 127 select CRYPTO_LIB_NH 128 select CRYPTO_LIB_POLY1305 129 select CRYPTO_LIB_POLYVAL 130 select CRYPTO_LIB_SHA1 131 select CRYPTO_LIB_SHA256 132 select CRYPTO_LIB_SHA512 133 select CRYPTO_LIB_SHA3 134 help 135 Enable all the crypto library code that has KUnit tests. 136 137 Enable this only if you'd like to test all the crypto library code, 138 even code that wouldn't otherwise need to be built. 139 140 You'll still need to enable the tests themselves, either individually 141 or using KUNIT_ALL_TESTS. 142 143config CRYPTO_LIB_BENCHMARK_VISIBLE 144 bool 145 146config CRYPTO_LIB_BENCHMARK 147 bool "Include benchmarks in KUnit tests for cryptographic functions" 148 depends on CRYPTO_LIB_BENCHMARK_VISIBLE 149 help 150 Include benchmarks in the KUnit tests for cryptographic functions. 151 The benchmark results are printed to the kernel log when the 152 corresponding KUnit test suite runs. 153 154 This is useful for evaluating the performance of the cryptographic 155 functions. However, it will increase the runtime of the KUnit tests. 156 157 If you're only interested in correctness testing, leave this disabled. 158