]> git.ipfire.org Git - thirdparty/openssl.git/commit
Add EVP_MD_CTX serialization for SHA3/SHAKE
authorSimo Sorce <simo@redhat.com>
Fri, 10 Oct 2025 17:47:38 +0000 (13:47 -0400)
committerDmitry Belyavskiy <beldmit@gmail.com>
Fri, 12 Dec 2025 08:08:34 +0000 (09:08 +0100)
commitb760334f8f10487f972b321069b1c928b9996b0d
tree6577f4c6fcff50ac373d7819a4bab462e0258702
parent1afb05b6035cfe7a748e9152e72832e760bab3dc
Add EVP_MD_CTX serialization for SHA3/SHAKE

Implement context serialization and deserialization for the SHA3, KECCAK,
SHAKE, and KMAC provider-based digests.

This is achieved by handling the `OSSL_DIGEST_SERIALIZATION` parameter in
get_ctx_params and set_ctx_params. A custom format is used to store the KECCAK
state, including a magic number and an algorithm identifier to ensure the
context is not loaded into an incompatible digest instance.

This allows an EVP_MD_CTX to be saved and restored, which is useful for
applications that need to checkpoint hashing operations. The existing EVP
serialization tests have been extended to cover these new algorithms.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28837)
providers/implementations/digests/sha3_prov.c
test/evp_extra_test2.c