diff options
author | Holger Dengler <dengler@linux.ibm.com> | 2023-09-27 15:36:23 +0200 |
---|---|---|
committer | Holger Dengler <dengler@linux.ibm.com> | 2023-11-10 14:26:27 +0100 |
commit | 7aa45b8bb3269e881d0378aa785ff344efdd2897 (patch) | |
tree | 535af9d0791b7ae654ce1628dc325b9b22de6a69 /providers | |
parent | 1337b50936ed190a98af1ee6601d857b42a3d296 (diff) |
Fix state handling of sha3_absorb for s390x.
The digest life-cycle state diagram has been updated for XOF. Fix the
state handling in s390x_sha3_aborb() 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)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/digests/sha3_prov.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/providers/implementations/digests/sha3_prov.c b/providers/implementations/digests/sha3_prov.c index 13735153f2..85370912f6 100644 --- a/providers/implementations/digests/sha3_prov.c +++ b/providers/implementations/digests/sha3_prov.c @@ -188,6 +188,10 @@ static size_t s390x_sha3_absorb(void *vctx, const void *inp, size_t len) KECCAK1600_CTX *ctx = vctx; size_t rem = len % ctx->block_size; + if (!(ctx->xof_state == XOF_STATE_INIT || + ctx->xof_state == XOF_STATE_ABSORB)) + return 0; + ctx->xof_state = XOF_STATE_ABSORB; s390x_kimd(inp, len - rem, ctx->pad, ctx->A); return rem; } |