Re: [PATCH] lib/crypto: Add SHA3-224, SHA3-256, SHA3-384, SHA-512, SHAKE128, SHAKE256
From: Stephan Müller
Date: Fri Sep 19 2025 - 11:41:07 EST
Am Freitag, 19. September 2025, 17:34:36 Mitteleuropäische Sommerzeit schrieb
David Howells:
Hi David,
> Simo Sorce <simo@xxxxxxxxxx> wrote:
> > I strongly suggest creating a test vector where multiple absorb and
> > squeeze operations are done in intermixed order, and then use that test
> > vector in your Kunit tests to ensure changes to the code do not break
> > this fundamental property of the keccak sponge algorithm.
>
> I'm putting such a beast in the module init function at least.
>
> Annoyingly, Eric's hash-test-template.h makes some unwarranted assumptions
> about the hashes it is testing - such as the final function zeroing out the
> hash struct.
If it is of help, here is such test that I use:
https://github.com/smuellerDD/leancrypto/blob/master/hash/tests/
shake_squeeze_more_tester.c#L92
Ciao
Stephan