diff --git a/aes.c b/aes.c index bb026fd..e58498f 100644 --- a/aes.c +++ b/aes.c @@ -42,6 +42,7 @@ NOTE: String length must be evenly divisible by 16byte (str_len % 16 == 0) /*****************************************************************************/ // The number of columns comprising a state in AES. This is a constant in AES. Value=4 #define Nb 4 +#define BLOCKLEN 16 //Block length in bytes AES is 128b block only #ifdef AES256 #define Nk 8 @@ -177,7 +178,7 @@ static void KeyExpansion(void) // All other round keys are found from the previous round keys. //i == Nk - for(i = Nk; i < Nb * (Nr + 1); ++i) + for(; i < Nb * (Nr + 1); ++i) { { tempa[0]=RoundKey[(i-1) * 4 + 0]; @@ -448,16 +449,6 @@ static void InvCipher(void) AddRoundKey(0); } -static void BlockCopy(uint8_t* output, const uint8_t* input) -{ - uint8_t i; - for (i=0;i