diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index abfef79cec3..1fecf2ee6af 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -1303,14 +1303,13 @@ class QMessageAuthenticationCodePrivate { public: QMessageAuthenticationCodePrivate(QCryptographicHash::Algorithm m) - : messageHash(m), method(m) + : messageHash(m) { } HashBlock key; HashResult result; QCryptographicHashPrivate messageHash; - const QCryptographicHash::Algorithm method; void setKey(QByteArrayView k) noexcept; void initMessageHash() noexcept; @@ -1333,7 +1332,7 @@ public: */ void QMessageAuthenticationCodePrivate::setKey(QByteArrayView newKey) noexcept { - const int blockSize = qt_hash_block_size(method); + const int blockSize = qt_hash_block_size(messageHash.method); if (newKey.size() > blockSize) { messageHash.addData(newKey);