Re: [PATCH 02/12] lib/crypto: tests: Add KUnit tests for NH

0 views
Skip to first unread message

Geert Uytterhoeven

unread,
Feb 26, 2026, 8:12:51 AM (yesterday) Feb 26
to Eric Biggers, linux-...@vger.kernel.org, linux-...@vger.kernel.org, Ard Biesheuvel, Jason A . Donenfeld, Herbert Xu, linux-ar...@lists.infradead.org, x...@kernel.org, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development
Hi Eric,

On Thu, 11 Dec 2025 at 02:25, Eric Biggers <ebig...@kernel.org> wrote:
> Add some simple KUnit tests for the nh() function.
>
> These replace the test coverage which will be lost by removing the
> nhpoly1305 crypto_shash.
>
> Note that the NH code also continues to be tested indirectly as well,
> via the tests for the "adiantum(xchacha12,aes)" crypto_skcipher.
>
> Signed-off-by: Eric Biggers <ebig...@kernel.org>

Thanks for your patch, which is now commit 7246fe6cd64475d8
("lib/crypto: tests: Add KUnit tests for NH") in v7.0-rc1.

> --- a/lib/crypto/tests/Kconfig
> +++ b/lib/crypto/tests/Kconfig
> @@ -45,10 +45,18 @@ config CRYPTO_LIB_MLDSA_KUNIT_TEST
> select CRYPTO_LIB_BENCHMARK_VISIBLE
> select CRYPTO_LIB_MLDSA
> help
> KUnit tests for the ML-DSA digital signature algorithm.
>
> +config CRYPTO_LIB_NH_KUNIT_TEST
> + tristate "KUnit tests for NH" if !KUNIT_ALL_TESTS
> + depends on KUNIT
> + default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
> + select CRYPTO_LIB_NH

This select means that enabling KUNIT_ALL_TESTS also enables
extra functionality, which may not be desirable in a production system.
Fortunately CRYPTO_LIB_NH is tristate, so in the modular case the
extra functionality is a module, too, and not part of the running
system by default. Unfortunately CRYPTO_LIB_NH is invisible, so this
cannot just be changed from "select" to "depends on".

> + help
> + KUnit tests for the NH almost-universal hash function.
> +
> config CRYPTO_LIB_POLY1305_KUNIT_TEST
> tristate "KUnit tests for Poly1305" if !KUNIT_ALL_TESTS
> depends on KUNIT
> default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
> select CRYPTO_LIB_BENCHMARK_VISIBLE

Gr{oetje,eeting}s,

Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Eric Biggers

unread,
Feb 26, 2026, 1:12:07 PM (yesterday) Feb 26
to Geert Uytterhoeven, linux-...@vger.kernel.org, linux-...@vger.kernel.org, Ard Biesheuvel, Jason A . Donenfeld, Herbert Xu, linux-ar...@lists.infradead.org, x...@kernel.org, open list:KERNEL SELFTEST FRAMEWORK, KUnit Development
I'll probably be changing this, pending the result of the discussion on
the similar thread about CRYPTO_LIB_MLDSA_KUNIT_TEST:
https://lore.kernel.org/linux-crypto/20260226180538.GC2251@sol/

- Eric
Reply all
Reply to author
Forward
0 new messages