* Re: [PATCH 02/12] lib/crypto: tests: Add KUnit tests for NH
[not found] ` <20251211011846.8179-3-ebiggers@kernel.org>
@ 2026-02-26 13:12 ` Geert Uytterhoeven
2026-02-26 18:11 ` Eric Biggers
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2026-02-26 13:12 UTC (permalink / raw)
To: Eric Biggers
Cc: linux-crypto, linux-kernel, Ard Biesheuvel, Jason A . Donenfeld,
Herbert Xu, linux-arm-kernel, x86,
open list:KERNEL SELFTEST FRAMEWORK, KUnit Development
Hi Eric,
On Thu, 11 Dec 2025 at 02:25, Eric Biggers <ebiggers@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 <ebiggers@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 -- geert@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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 02/12] lib/crypto: tests: Add KUnit tests for NH
2026-02-26 13:12 ` [PATCH 02/12] lib/crypto: tests: Add KUnit tests for NH Geert Uytterhoeven
@ 2026-02-26 18:11 ` Eric Biggers
0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2026-02-26 18:11 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: linux-crypto, linux-kernel, Ard Biesheuvel, Jason A . Donenfeld,
Herbert Xu, linux-arm-kernel, x86,
open list:KERNEL SELFTEST FRAMEWORK, KUnit Development
On Thu, Feb 26, 2026 at 02:12:38PM +0100, Geert Uytterhoeven wrote:
> Hi Eric,
>
> On Thu, 11 Dec 2025 at 02:25, Eric Biggers <ebiggers@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 <ebiggers@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".
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-26 18:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20251211011846.8179-1-ebiggers@kernel.org>
[not found] ` <20251211011846.8179-3-ebiggers@kernel.org>
2026-02-26 13:12 ` [PATCH 02/12] lib/crypto: tests: Add KUnit tests for NH Geert Uytterhoeven
2026-02-26 18:11 ` Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox