Re: [PATCH] lib/crypto: Add SHA3-224, SHA3-256, SHA3-384, SHA-512, SHAKE128, SHAKE256

From: Simo Sorce

Date: Fri Sep 19 2025 - 09:59:25 EST


On Fri, 2025-09-19 at 07:17 +0100, David Howells wrote:
> Stephan Müller <smueller@xxxxxxxxxx> wrote:
>
> > For a multi-stage squeeze, it is perhaps not helpful to zeroize the context
> > here.
>
> Yeah - I've seen this now that I'm starting to trawl through your dilithium
> code, so it will need adjusting.


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.

Simo.

--
Simo Sorce
Distinguished Engineer
RHEL Crypto Team
Red Hat, Inc