Re: Need some clarification about CRYPTO_AHASH_ALG_BLOCK_ONLY
From: Herbert Xu
Date: Thu Mar 26 2026 - 23:42:45 EST
On Thu, Mar 26, 2026 at 10:46:26AM +0100, Paul Louvel wrote:
>
> I agree. I am currently working on the talitos crypto driver, which includes
> code to handle partial blocks. The SEC1 (currently supported by the talitos
> driver) is older hardware that only accepts data with a length that is a
> multiple of the underlying hashing algorithm's block size. Would it make
> sense for the crypto API to have a flag to handle such limitations
> automatically?
Yes it should be fairly easy to handle this if you use the BLOCK_ONLY
interface. If you have a last partial block you could either feed
it to a software fallback, or manually generate the padding data
and feed it to the hardware with no finalisation.
The aspeed driver is an example using the second method to generate
the final block by hand.
Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt