[PATCH] crypto: tstmgr - guard xxhash tests

From: Hamza Mahfooz

Date: Tue Apr 07 2026 - 15:31:15 EST


If the kernel isn't built with CONFIG_CRYPTO_XXHASH and booted with FIPS
mode enabled it will currently panic. So, only benchmark xxhash64 if
CRYPTO_XXHASH is enabled.

Cc: Jeff Barnes <jeffbarnes@xxxxxxxxxxxxxxxxxxx>
Cc: Paul Monson <paul.monson@xxxxxxxxxxxxx>
Signed-off-by: Hamza Mahfooz <hamzamahfooz@xxxxxxxxxxxxxxxxxxx>
---
crypto/testmgr.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 4985411dedaec..9e4a040029ab8 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -5609,7 +5609,9 @@ static const struct alg_test_desc alg_test_descs[] = {
#endif
.alg = "xxhash64",
.test = alg_test_hash,
+#if IS_ENABLED(CONFIG_CRYPTO_XXHASH)
.fips_allowed = 1,
+#endif
.suite = {
.hash = __VECS(xxhash64_tv_template)
}
--
2.53.0