QMessageAuthenticationCode: remove Private::method

...it's the same as messageHash.method, so we don't need to store it
twice.

Pick-to: 6.5
Change-Id: I926dbfa177c25e9bc3ebed9149da5ce8bad8cf2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2023-03-19 15:33:41 +01:00
parent 57a7db746a
commit ed604ce101

View File

@ -1303,14 +1303,13 @@ class QMessageAuthenticationCodePrivate
{ {
public: public:
QMessageAuthenticationCodePrivate(QCryptographicHash::Algorithm m) QMessageAuthenticationCodePrivate(QCryptographicHash::Algorithm m)
: messageHash(m), method(m) : messageHash(m)
{ {
} }
HashBlock key; HashBlock key;
HashResult result; HashResult result;
QCryptographicHashPrivate messageHash; QCryptographicHashPrivate messageHash;
const QCryptographicHash::Algorithm method;
void setKey(QByteArrayView k) noexcept; void setKey(QByteArrayView k) noexcept;
void initMessageHash() noexcept; void initMessageHash() noexcept;
@ -1333,7 +1332,7 @@ public:
*/ */
void QMessageAuthenticationCodePrivate::setKey(QByteArrayView newKey) noexcept 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) { if (newKey.size() > blockSize) {
messageHash.addData(newKey); messageHash.addData(newKey);