From a22e7bd5f903c4e67669f6e5b71d65d1841a1e43 Mon Sep 17 00:00:00 2001 From: Ilya Chesalin <evilyach@protonmail.com> Date: Sat, 16 May 2020 03:28:30 +0300 Subject: [PATCH] Fixed invShiftRows in Shift 3 (#30) This must be broken. The indices of iterable inside shift 3 seem random and do not correspond to the AES algorighm. More than that, it should be reversed from shiftRows methods, and shifts 1 and 2 seem normal. --- qaesencryption.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qaesencryption.cpp b/qaesencryption.cpp index 6461dd1..4a3cd56 100644 --- a/qaesencryption.cpp +++ b/qaesencryption.cpp @@ -391,11 +391,11 @@ void QAESEncryption::invShiftRows() it[6] = (quint8)temp; //Shift 3 - temp = (quint8)it[15]; - it[15] = (quint8)it[3]; - it[3] = (quint8)it[7]; + temp = (quint8)it[7]; it[7] = (quint8)it[11]; - it[11] = (quint8)temp; + it[11] = (quint8)it[15]; + it[15] = (quint8)it[3]; + it[3] = (quint8)temp; } QByteArray QAESEncryption::byteXor(const QByteArray &a, const QByteArray &b)