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

From: Herbert Xu

Date: Fri Jul 03 2026 - 03:19:45 EST


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,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt