Skip to content

Commit

Permalink
Merge pull request #3 from 211217613/master
Browse files Browse the repository at this point in the history
SImple makefile and removed to unused variables
  • Loading branch information
AndrewCarterUK authored Jan 19, 2018
2 parents 15deec8 + 5d8f9b0 commit e99d474
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
all:
cd ./test && gcc encrypt.c ../aes.c -o encrypt
clean:
rm ./test/encrypt
clang:
cd ./test && clang -Wall encrypt.c ../aes.c -o encrypt

5 changes: 2 additions & 3 deletions aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ void aes_InvShiftRows(uint8_t state[16])
void aes_MixColumns(uint8_t state[16])
{
counter i = 4;
uint8_t new_state[4], tmp;
uint8_t new_state[4];

while (i--) {
new_state[0] = MUL2(state[MAP(0,i)]) ^ MUL3(state[MAP(1,i)]) ^ state[MAP(2,i)] ^ state[MAP(3,i)] ;
Expand All @@ -284,7 +284,7 @@ void aes_MixColumns(uint8_t state[16])
void aes_InvMixColumns(uint8_t state[16])
{
counter i = 4;
uint8_t new_state[4], tmp;
uint8_t new_state[4];

while (i--) {
new_state[0] = MUL(14, state[MAP(0,i)]) ^ MUL(11, state[MAP(1,i)]) ^ MUL(13, state[MAP(2,i)]) ^ MUL( 9, state[MAP(3,i)]);
Expand Down Expand Up @@ -334,4 +334,3 @@ uint8_t aes_GaloisFieldMultiply(uint8_t fixed, uint8_t variable)

return result;
}

0 comments on commit e99d474

Please sign in to comment.