]> git.ipfire.org Git - thirdparty/openssl.git/commit
Add CTX copy function for EVP_MD to optimize the performance of EVP_MD_CTX_copy_ex.
authorwangcheng <bangwangnj@163.com>
Sat, 26 Oct 2024 09:10:38 +0000 (17:10 +0800)
committerTomas Mraz <tomas@openssl.org>
Wed, 20 Nov 2024 13:12:53 +0000 (14:12 +0100)
commit4c41aa4b338ca181a394483c8bb6aeb6366c6f96
treeb520cd03abb8bd591666f8ce3a8fcc4971b63f6f
parent9ca66fc2731a7e76415282a0a8a6b60f0169b156
Add CTX copy function for EVP_MD to optimize the performance of EVP_MD_CTX_copy_ex.

1. Add OSSL_FUNC_digest_copyctx_fn function for EVP_MD, which is used to copy algctx from the old EVP_MD_CTX to the new one.

2. Add implementation of OSSL_FUNC_digest_copyctx_fn function for default providers.

3. Modify EVP_MD_CTX_copy_ex: When the fetched digest is the same in in and out contexts, use the copy function to copy the members in EVP_MD_CTX if the OSSL_FUNC_digest_copyctx_fn function exists. Otherwise, use the previous method to copy.

4. Add documentation for OSSL_FUNC_digest_copyctx function in doc/man7/provider-digest.pod.

5. Add testcase.

Fixes #25703

Signed-off-by: wangcheng <bangwangnj@163.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25726)
crypto/evp/digest.c
doc/man7/provider-digest.pod
include/crypto/evp.h
include/openssl/core_dispatch.h
providers/implementations/digests/blake2_prov.c
providers/implementations/digests/sha3_prov.c
providers/implementations/include/prov/digestcommon.h
test/evp_extra_test2.c