summaryrefslogtreecommitdiffstats
path: root/include/crypto/evp.h
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-03-10 09:38:09 +0000
committerPauli <pauli@openssl.org>2022-03-15 20:59:43 +1100
commit43646286c0d6c9c50dc356185c89fe9cc56b2fcb (patch)
treed8b6f8fd6b4d70f7a7c513f8c435b69dc8706f9d /include/crypto/evp.h
parent2b002fc313d223b2314e7758298619f09efeae52 (diff)
EVP_MD performance fix (refcount cache contention)
Partial fix for #17064. Avoid excessive writes to the cache line containing the refcount for an EVP_MD object to avoid extreme cache contention when using a single EVP_MD at high frequency on multiple threads. This changes performance in 3.0 from being double that of 1.1 to only slightly higher than that of 1.1. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17857) (cherry picked from commit c0b7dac66edde45b8da80918f5b5b62d1e766a0c)
Diffstat (limited to 'include/crypto/evp.h')
-rw-r--r--include/crypto/evp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/crypto/evp.h b/include/crypto/evp.h
index c5d3a930f7..6fb05309dc 100644
--- a/include/crypto/evp.h
+++ b/include/crypto/evp.h
@@ -900,7 +900,7 @@ int evp_set_default_properties_int(OSSL_LIB_CTX *libctx, const char *propq,
int loadconfig, int mirrored);
char *evp_get_global_properties_str(OSSL_LIB_CTX *libctx, int loadconfig);
-void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force);
+void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force, int keep_digest);
/* Three possible states: */
# define EVP_PKEY_STATE_UNKNOWN 0