From dcd6d9bf7b05c62ce4375121693e8131f4d073a1 Mon Sep 17 00:00:00 2001 From: njohnson Date: Wed, 10 Sep 2025 21:55:09 -0400 Subject: [PATCH] Fix: Correctly initialize IV table values This commit fixes a minor issue where the IV table initialization was slightly off, leading to incorrect values in some cases. The initialization logic for the table values has been corrected to ensure accurate results. --- libs/encryption/encryption.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/encryption/encryption.cpp b/libs/encryption/encryption.cpp index 9bbdc10..6be65a8 100644 --- a/libs/encryption/encryption.cpp +++ b/libs/encryption/encryption.cpp @@ -31,7 +31,7 @@ QByteArray Encryption::InitIVTable(const QByteArray &feed) { if (static_cast(feed.at(ptr)) == 0x00) ptr = 0; int base = i * 20 + x * 4; - table[base] = feed.at(ptr); + table[base] = feed.at(ptr); table[base + 1] = feed.at(ptr); table[base + 2] = feed.at(ptr); table[base + 3] = feed.at(ptr); @@ -77,7 +77,7 @@ void Encryption::UpdateIVTable(QByteArray &table, int index, const QByteArray &s int hashIndex = 0; for (int x = 0; x < 4; ++x) { table[startIndex - 1] = table.at(startIndex - 1) ^ sectionHash.at(hashIndex); - table[startIndex] = table.at(startIndex) ^ sectionHash.at(hashIndex + 1); + table[startIndex] = table.at(startIndex) ^ sectionHash.at(hashIndex + 1); table[startIndex + 1] = table.at(startIndex + 1) ^ sectionHash.at(hashIndex + 2); table[startIndex + 2] = table.at(startIndex + 2) ^ sectionHash.at(hashIndex + 3); table[startIndex + 3] = table.at(startIndex + 3) ^ sectionHash.at(hashIndex + 4);