diff --git a/src/core/utilities.cpp b/src/core/utilities.cpp index 8baf49ceb..632c167d4 100644 --- a/src/core/utilities.cpp +++ b/src/core/utilities.cpp @@ -479,15 +479,15 @@ void OpenInFileBrowser(const QList &urls) { QByteArray Hmac(const QByteArray &key, const QByteArray &data, const QCryptographicHash::Algorithm method) { - const int kBlockSize = 64; // bytes - Q_ASSERT(key.length() <= kBlockSize); + constexpr int block_size = 64; + Q_ASSERT(key.length() <= block_size); - QByteArray inner_padding(kBlockSize, static_cast(0x36)); - QByteArray outer_padding(kBlockSize, static_cast(0x5c)); + QByteArray inner_padding(block_size, static_cast(0x36)); + QByteArray outer_padding(block_size, static_cast(0x5c)); for (int i = 0; i < key.length(); ++i) { - inner_padding[i] = inner_padding[i] ^ key[i]; - outer_padding[i] = outer_padding[i] ^ key[i]; + inner_padding[i] = static_cast(inner_padding[i] ^ key[i]); + outer_padding[i] = static_cast(outer_padding[i] ^ key[i]); } QByteArray part;