Re: [PATCH v3 7/8] crypto/sha3: Add SHAKE128/256 support
From: David Howells
Date: Wed Oct 01 2025 - 09:02:57 EST
Eric Biggers <ebiggers@xxxxxxxxxx> wrote:
> I recommend holding off on this part until you have a try at using the
> SHAKE library API directly. The dispatch to different algorithms could
> be done in the calling code. This patch would also limit the ML-DSA
> code to fixed-size SHAKE outputs; is that really going to be enough?
Actually, ML-DSA also allows SHA2 hashes for the prehash, so if I use
crypto_shash for that, then I maintain the flexibility through that.
> When there's only a small number of supported algorithms, just doing the
> dispatch in the calling code tends to be simpler than using
> crypto_shash. For example, see the recent conversion of fs/verity/ to
> use the SHA-2 library API instead of crypto_shash.
That's reinventing the wheel. Why have crypto_shash at all if we're going to
encourage people to ignore that and use a union and an enum/ops table.
Is the goal to get rid of crypto/ entirely and use lib/crypto/ instead? Not
that I wouldn't mind a better crypto offloading API - the one we have kind of
sucks, especially for offloading to async crypto h/w (sorry Herbert;-)).
David