Re: [PATCH v1 1/1] s390/crypto: Generate intermediate CV for API partial block handling

Harald Freudenberger <[email protected]>
Newsgroups org.kernel.vger.linux-crypto,org.kernel.vger.linux-s390
Message-ID <[email protected]>
On 2026-08-14 16:20, Holger Dengler wrote:
> The API partial block handling requires a intermediate chaining
> value (CV). The internal function hash_data() sets the function code
> correctly, so also call cpacf_kimd() instruction for intermediate CV
> generation, as cpacf_klmd() always generate the final hash value.
> 
> Cc: [email protected] # 6.15+
> Fixes: 08811169ac01 ("crypto: s390/hmac - Use API partial block 
> handling")
> Signed-off-by: Holger Dengler <[email protected]>
> ---
>  arch/s390/crypto/hmac_s390.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/s390/crypto/hmac_s390.c 
> b/arch/s390/crypto/hmac_s390.c
> index f8cd09f341d4..445fa7bbd958 100644
> --- a/arch/s390/crypto/hmac_s390.c
> +++ b/arch/s390/crypto/hmac_s390.c
> @@ -150,7 +150,10 @@ static int hash_data(const u8 *in, unsigned int 
> inlen,
> 
>  #undef PARAM_INIT
> 
> -	cpacf_klmd(func, &param, in, inlen);
> +	if (final)
> +		cpacf_klmd(func, &param, in, inlen);
> +	else
> +		cpacf_kimd(func, &param, in, inlen);
> 
>  	memcpy(digest, &param, digestsize);

Reviewed-by: Harald Freudenberger <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.