De-pessimize QCryptographicHash::reset() in OpenSSL3 mode
Instead of going through the whole dance with provider loading, context creation etc, just call EVP_MD_CTX_reset() to reuse the already-setup context, if any. This makes QCryptographicHash::reset() adhere to its noexcept specification again (assuming EVP_MD_CTX_reset() doesn't allocate state, and, despite its non-void return type, cannot fail on a valid context), and should greatly improve the speed of reset(), addData(), resultView() cycles. Pick-to: 6.5 Change-Id: I7c35b61cbeab1ffd6dd258e8389ea614d49e2e1e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jan Grulich <jgrulich@redhat.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
3b08cbff69
commit
189444d8c4
@ -547,6 +547,12 @@ void QCryptographicHashPrivate::reset() noexcept
|
||||
return;
|
||||
}
|
||||
|
||||
if (context && !initializationFailed) {
|
||||
// everything already set up - just reset the context
|
||||
EVP_MD_CTX_reset(context.get());
|
||||
return;
|
||||
}
|
||||
|
||||
initializationFailed = true;
|
||||
|
||||
if (method == QCryptographicHash::Md4) {
|
||||
|
Loading…
Reference in New Issue
Block a user