openssl
openssl copied to clipboard
Add CTX copy function for EVP_MD to optimize the performance of EVP_MD_CTX_copy_ex
-
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.
-
Add implementation of OSSL_FUNC_digest_copyctx_fn function for default providers.
-
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.
CLA:trivial
Fixes #25703
I can't justify CLA:trivial, just the changes in crypto/evp/digest.c are too important.
Otherwise, the changes look good... would you mind adding a bit of documentation in doc/man7/provider-digest.pod, though?
Could you please submit a CLA? https://openssl-library.org/policies/cla/index.html
Also please remove the CLA: trivial annotation from the commit message.
Agreed, this is definitely not a trivial change.
Should the copy context function be expanded to more digests? Most currently support the operation at a low level.
This needs tests including ones that test a copy where the two contexts are from different providers.
I'll add test cases, man doc, and sign cla later.
Should the copy context function be expanded to more digests? Most currently support the operation at a low level.
I have added copyctx to all the digests I know. What other digests in openssl need to be expanded?
All review problems have been fixed. @t8m
Your review comment has been modified, please review the code. @beldmit
This pull request is ready to merge
Merged to the master branch. Thank you for your contribution.