mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
Fix state handling of keccak_final for s390x.
The digest life-cycle state diagram has been updated for XOF. Fix the state handling in s390x_keccac_final() according to the updated state diagram. Signed-off-by: Holger Dengler <dengler@linux.ibm.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22221)
This commit is contained in:
parent
288fbb4b71
commit
1022131d16
@ -235,6 +235,10 @@ static int s390x_keccakc_final(void *vctx, unsigned char *out, size_t outlen,
|
||||
|
||||
if (!ossl_prov_is_running())
|
||||
return 0;
|
||||
if (!(ctx->xof_state == XOF_STATE_INIT ||
|
||||
ctx->xof_state == XOF_STATE_ABSORB))
|
||||
return 0;
|
||||
ctx->xof_state = XOF_STATE_FINAL;
|
||||
if (outlen == 0)
|
||||
return 1;
|
||||
memset(ctx->buf + num, 0, bsz - num);
|
||||
|
Loading…
Reference in New Issue
Block a user