From b677d41e495030b98bfa757e9b3f7592aa8fd17a Mon Sep 17 00:00:00 2001 From: 211217613 Date: Fri, 2 Dec 2016 18:33:17 -0600 Subject: [PATCH 1/2] Removed tmp - unused variable --- aes.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aes.c b/aes.c index 042ebf3..767efb7 100644 --- a/aes.c +++ b/aes.c @@ -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)] ; @@ -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)]); @@ -334,4 +334,3 @@ uint8_t aes_GaloisFieldMultiply(uint8_t fixed, uint8_t variable) return result; } - From 5d8f9b0ecde33e0854eb276365d68331d0bc9c1a Mon Sep 17 00:00:00 2001 From: 211217613 Date: Fri, 2 Dec 2016 18:39:00 -0600 Subject: [PATCH 2/2] Add simple Makefile for easy building and clang support --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..46eb19b --- /dev/null +++ b/Makefile @@ -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 +