linux/include/crypto
Eric Biggers ac90aad0e9 crypto: testmgr - reinstate kconfig control over full self-tests
Commit 698de82278 ("crypto: testmgr - make it easier to enable the
full set of tests") removed support for building kernels that run only
the "fast" set of crypto self-tests by default.  This assumed that
nearly everyone actually wanted the full set of tests, *if* they had
already chosen to enable the tests at all.

Unfortunately, it turns out that both Debian and Fedora intentionally
have the crypto self-tests enabled in their production kernels.  And for
production kernels we do need to keep the testing time down, which
implies just running the "fast" tests, not the full set of tests.

For Fedora, a reason for enabling the tests in production is that they
are being (mis)used to meet the FIPS 140-3 pre-operational testing
requirement.

However, the other reason for enabling the tests in production, which
applies to both distros, is that they provide some value in protecting
users from buggy drivers.  Unfortunately, the crypto/ subsystem has many
buggy and untested drivers for off-CPU hardware accelerators on rare
platforms.  These broken drivers get shipped to users, and there have
been multiple examples of the tests preventing these buggy drivers from
being used.  So effectively, the tests are being relied on in production
kernels.  I think this is kind of crazy (untested drivers should just
not be enabled at all), but that seems to be how things work currently.

Thus, reintroduce a kconfig option that controls the level of testing.
Call it CRYPTO_SELFTESTS_FULL instead of the original name
CRYPTO_MANAGER_EXTRA_TESTS, which was slightly misleading.

Moreover, given the "production kernel" use case, make CRYPTO_SELFTESTS
depend on EXPERT instead of DEBUG_KERNEL.

I also haven't reinstated all the #ifdefs in crypto/testmgr.c.  Instead,
just rely on the compiler to optimize out unused code.

Fixes: 40b9969796 ("crypto: testmgr - replace CRYPTO_MANAGER_DISABLE_TESTS with CRYPTO_SELFTESTS")
Fixes: 698de82278 ("crypto: testmgr - make it easier to enable the full set of tests")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2025-06-13 17:24:21 +08:00
..
internal crypto: testmgr - reinstate kconfig control over full self-tests 2025-06-13 17:24:21 +08:00
acompress.h crypto: acomp - Clone folios properly 2025-05-05 18:20:45 +08:00
aead.h
aes.h
akcipher.h
algapi.h crypto: algapi - Add driver template support to crypto_inst_setname 2025-05-19 13:48:20 +08:00
arc4.h
aria.h
authenc.h
b128ops.h
blake2b.h crypto: arm/blake2b - Use API partial block handling 2025-04-23 11:33:46 +08:00
blake2s.h
blowfish.h
cast5.h
cast6.h
cast_common.h
chacha.h crypto: lib/chacha - add array bounds to function prototypes 2025-05-12 13:32:53 +08:00
chacha20poly1305.h
cryptd.h
ctr.h crypto: ctr - Remove unnecessary header inclusions 2025-04-16 15:16:21 +08:00
curve25519.h
des.h
dh.h
drbg.h
ecc_curve.h
ecdh.h
engine.h
gcm.h
gf128mul.h
ghash.h crypto: riscv/ghash - Use API partial block handling 2025-04-23 11:33:47 +08:00
hash.h crypto: hmac - Add ahash support 2025-05-19 13:48:20 +08:00
hash_info.h
hkdf.h
hmac.h
if_alg.h
kdf_sp800108.h
kpp.h
krb5.h rxrpc: Add the security index for yfs-rxgk 2025-04-14 17:36:41 -07:00
md5.h crypto: md5-generic - Use API partial block handling 2025-04-23 11:33:47 +08:00
nhpoly1305.h
null.h crypto: null - remove the default null skcipher 2025-05-12 13:32:53 +08:00
padlock.h
pcrypt.h
pkcs7.h
poly1305.h crypto: lib/poly1305 - Use block-only interface 2025-05-05 13:33:02 +08:00
polyval.h crypto: polyval-generic - Use API partial block handling 2025-04-28 19:40:54 +08:00
public_key.h
rng.h crypto: rng - fix documentation for crypto_rng_alg() 2025-05-05 18:20:45 +08:00
scatterwalk.h crypto: scatterwalk - Move skcipher walk and use it for memcpy_sglist 2025-04-28 19:45:26 +08:00
serpent.h
sha1.h crypto: sha1-generic - Use API partial block handling 2025-04-23 11:33:47 +08:00
sha1_base.h crypto: sha1_base - Remove partial block helpers 2025-04-23 11:33:48 +08:00
sha2.h crypto: sha256 - Use the partial block API for generic 2025-05-05 18:20:45 +08:00
sha3.h crypto: zynqmp-sha - Fix partial block implementation 2025-05-05 18:20:46 +08:00
sha512_base.h crypto: sha512_base - Remove partial block helpers 2025-04-23 15:52:47 +08:00
sig.h crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY 2025-04-16 15:16:21 +08:00
skcipher.h
sm3.h crypto: lib/sm3 - Remove partial block helpers 2025-04-23 15:52:47 +08:00
sm3_base.h crypto: lib/sm3 - Remove partial block helpers 2025-04-23 15:52:47 +08:00
sm4.h
streebog.h crypto: streebog - Use API partial block handling 2025-05-05 18:20:44 +08:00
twofish.h
utils.h
xts.h