Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] lib/crypto: tests: Add some additional lengths to the ChaCha benchmark
@ 2026-11-04 23:06 Eric Biggers
  2026-11-05 15:33 ` Antonio Quartulli
  2026-11-07 22:06 ` Eric Biggers
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Biggers @ 2026-11-04 23:06 UTC (permalink / raw)
  To: linux-crypto
  Cc: Ard Biesheuvel, Jason A . Donenfeld, Herbert Xu, Martin Willi,
	Antonio Quartulli, Eric Biggers

All the benchmarked lengths below 1420 are multiples of the ChaCha block
size, and all except 64 are a multiple of 4 blocks.  Add some additional
lengths to cover a wider variety of situations.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
 lib/crypto/tests/chacha_kunit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/crypto/tests/chacha_kunit.c b/lib/crypto/tests/chacha_kunit.c
index bbf73dcbafee..2e002e46976e 100644
--- a/lib/crypto/tests/chacha_kunit.c
+++ b/lib/crypto/tests/chacha_kunit.c
@@ -217,7 +217,8 @@ static void test_chacha_rfc7539(struct kunit *test)
 static void benchmark_chacha(struct kunit *test)
 {
 	static const size_t lens_to_test[] = {
-		64, 256, 512, 1024, 1420, 2048, 4096, 8920, 16384,
+		64,   128,  200,  256,	511,  512,   513,
+		1024, 1420, 2048, 4096, 8920, 16384,
 	};
 	const size_t max_len = 16384;
 	u8 *data = alloc_buf(test, max_len);

base-commit: 9fbbbaefd5f95551da18426c200cf41e1b4255a1
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] lib/crypto: tests: Add some additional lengths to the ChaCha benchmark
  2026-11-04 23:06 [PATCH] lib/crypto: tests: Add some additional lengths to the ChaCha benchmark Eric Biggers
@ 2026-11-05 15:33 ` Antonio Quartulli
  2026-11-07 21:06   ` Eric Biggers
  2026-11-07 22:06 ` Eric Biggers
  1 sibling, 1 reply; 4+ messages in thread
From: Antonio Quartulli @ 2026-11-05 15:33 UTC (permalink / raw)
  To: Eric Biggers, linux-crypto
  Cc: Ard Biesheuvel, Jason A . Donenfeld, Herbert Xu, Martin Willi

Tested on Zen 5 (Ryzen 9 9950X) in a KVM guest, on top of base
9fbbbaefd5f9. KUnit chacha suite passes and the benchmark reports
all 13 lengths on every x86 code path:

   path                 CPU setup              KUnit  benchmark
   -------------------  ---------------------  -----  ------------
   AVX-512, zmm         native                 pass   13/13 lengths
   AVX-512VL, ymm only  spoofed SKX (6/0x55)   pass   13/13 lengths
   AVX2                 clearcpuid=avx512f     pass   13/13 lengths
   SSSE3                clearcpuid=avx2        pass   13/13 lengths

Nit: there's a tab between "256," and "511," while the rest of the
array is aligned with spaces.

Tested-by: Antonio Quartulli <antonio@mandelbit.com>

-- 
Antonio Quartulli

CEO and Co-Founder
Mandelbit Srl
https://www.mandelbit.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lib/crypto: tests: Add some additional lengths to the ChaCha benchmark
  2026-11-05 15:33 ` Antonio Quartulli
@ 2026-11-07 21:06   ` Eric Biggers
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2026-11-07 21:06 UTC (permalink / raw)
  To: Antonio Quartulli
  Cc: linux-crypto, Ard Biesheuvel, Jason A . Donenfeld, Herbert Xu,
	Martin Willi

On Thu, Nov 05, 2026 at 04:33:19PM +0100, Antonio Quartulli wrote:
> Nit: there's a tab between "256," and "511," while the rest of the
> array is aligned with spaces.

If it's removed, 'git clang-format' puts it back in.  It just happens to
be the only place where it does so here, due to the spacing.  We do
still override 'git clang-format' with manual formatting fairly often,
but I don't think it's worth it here.

- Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lib/crypto: tests: Add some additional lengths to the ChaCha benchmark
  2026-11-04 23:06 [PATCH] lib/crypto: tests: Add some additional lengths to the ChaCha benchmark Eric Biggers
  2026-11-05 15:33 ` Antonio Quartulli
@ 2026-11-07 22:06 ` Eric Biggers
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2026-11-07 22:06 UTC (permalink / raw)
  To: linux-crypto
  Cc: Ard Biesheuvel, Jason A . Donenfeld, Herbert Xu, Martin Willi,
	Antonio Quartulli

On Wed, Nov 04, 2026 at 03:06:26PM -0800, Eric Biggers wrote:
> All the benchmarked lengths below 1420 are multiples of the ChaCha block
> size, and all except 64 are a multiple of 4 blocks.  Add some additional
> lengths to cover a wider variety of situations.
> 
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> ---
>  lib/crypto/tests/chacha_kunit.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next

- Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-07 22:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 23:06 [PATCH] lib/crypto: tests: Add some additional lengths to the ChaCha benchmark Eric Biggers
2026-11-05 15:33 ` Antonio Quartulli
2026-11-07 21:06   ` Eric Biggers
2026-11-07 22:06 ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox