Re: [PATCH v2 01/19] crypto: talitos/hash - Use CRYPTO_AHASH_BLOCK_ONLY API

From: Paul Louvel

Date: Wed Jul 15 2026 - 01:51:05 EST


On Fri Jul 3, 2026 at 9:18 AM CEST, Herbert Xu wrote:
> On Thu, Jun 11, 2026 at 09:35:55AM +0200, Paul Louvel wrote:
>>
>> @@ -2932,8 +2861,11 @@ static struct talitos_alg_template driver_algs[] = {
>> .cra_name = "md5",
>> .cra_driver_name = "md5-talitos",
>> .cra_blocksize = MD5_HMAC_BLOCK_SIZE,
>> + .cra_reqsize = sizeof(struct talitos_ahash_req_ctx),
>> .cra_flags = CRYPTO_ALG_ASYNC |
>> - CRYPTO_ALG_ALLOCATES_MEMORY,
>> + CRYPTO_ALG_ALLOCATES_MEMORY |
>> + CRYPTO_AHASH_ALG_BLOCK_ONLY |
>> + CRYPTO_AHASH_ALG_FINAL_NONZERO,
>
> Sorry, but the FINAL_NONZERO flag doesn't work for algorithms like
> md5.
>
> The reason is that all implementations of md5 must accept the exports
> from each other. So as long as the generic md5 doesn't not set
> FINAL_NONZERO, your driver will need to be able to take that on
> import.
>
> Cheers,

Hi Herbert,

Thanks for the info.

Paul.

--
Paul Louvel, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com