summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkokke <spam@rowdy.dk>2014-06-03 00:22:35 +0200
committerkokke <spam@rowdy.dk>2014-06-03 00:22:35 +0200
commit45e73382512cbf33c21a19fb1ea1a928c64bfe43 (patch)
tree8b5ed2baa29c5bae5394e9c34a518c36799437f9
parentUpdate test.c (diff)
downloadtiny-AES-c-45e73382512cbf33c21a19fb1ea1a928c64bfe43.tar
tiny-AES-c-45e73382512cbf33c21a19fb1ea1a928c64bfe43.tar.gz
tiny-AES-c-45e73382512cbf33c21a19fb1ea1a928c64bfe43.tar.bz2
tiny-AES-c-45e73382512cbf33c21a19fb1ea1a928c64bfe43.tar.lz
tiny-AES-c-45e73382512cbf33c21a19fb1ea1a928c64bfe43.tar.xz
tiny-AES-c-45e73382512cbf33c21a19fb1ea1a928c64bfe43.tar.zst
tiny-AES-c-45e73382512cbf33c21a19fb1ea1a928c64bfe43.zip
Diffstat (limited to '')
-rw-r--r--aes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/aes.c b/aes.c
index cca2049..edff203 100644
--- a/aes.c
+++ b/aes.c
@@ -129,7 +129,7 @@ static void KeyExpansion()
// The first round key is the key itself.
for(i = 0; i < Nk; ++i)
{
- RoundKey[ i * 4 ] = Key[ i * 4 ];
+ RoundKey[(i * 4) + 0] = Key[(i * 4) + 0];
RoundKey[(i * 4) + 1] = Key[(i * 4) + 1];
RoundKey[(i * 4) + 2] = Key[(i * 4) + 2];
RoundKey[(i * 4) + 3] = Key[(i * 4) + 3];
@@ -179,7 +179,7 @@ static void KeyExpansion()
tempa[3] = getSBoxValue(tempa[3]);
}
}
- RoundKey[i * 4] = RoundKey[(i - Nk) * 4] ^ tempa[0];
+ RoundKey[i * 4 + 0] = RoundKey[(i - Nk) * 4 + 0] ^ tempa[0];
RoundKey[i * 4 + 1] = RoundKey[(i - Nk) * 4 + 1] ^ tempa[1];
RoundKey[i * 4 + 2] = RoundKey[(i - Nk) * 4 + 2] ^ tempa[2];
RoundKey[i * 4 + 3] = RoundKey[(i - Nk) * 4 + 3] ^ tempa[3];