aes: remove compiler warning when compiled with ENCRYPT_ONLY

This commit is contained in:
Steffen Jaeckel 2014-01-03 15:50:21 +01:00 committed by Steffen Jaeckel
parent 8e7777b554
commit 3da9adc366

View File

@ -120,7 +120,7 @@ static ulong32 setup_mix2(ulong32 temp)
*/ */
int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
{ {
int i, j; int i;
ulong32 temp, *rk; ulong32 temp, *rk;
#ifndef ENCRYPT_ONLY #ifndef ENCRYPT_ONLY
ulong32 *rrk; ulong32 *rrk;
@ -146,7 +146,6 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s
LOAD32H(rk[2], key + 8); LOAD32H(rk[2], key + 8);
LOAD32H(rk[3], key + 12); LOAD32H(rk[3], key + 12);
if (keylen == 16) { if (keylen == 16) {
j = 44;
for (;;) { for (;;) {
temp = rk[3]; temp = rk[3];
rk[4] = rk[0] ^ setup_mix(temp) ^ rcon[i]; rk[4] = rk[0] ^ setup_mix(temp) ^ rcon[i];
@ -159,7 +158,6 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s
rk += 4; rk += 4;
} }
} else if (keylen == 24) { } else if (keylen == 24) {
j = 52;
LOAD32H(rk[4], key + 16); LOAD32H(rk[4], key + 16);
LOAD32H(rk[5], key + 20); LOAD32H(rk[5], key + 20);
for (;;) { for (;;) {
@ -180,7 +178,6 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s
rk += 6; rk += 6;
} }
} else if (keylen == 32) { } else if (keylen == 32) {
j = 60;
LOAD32H(rk[4], key + 16); LOAD32H(rk[4], key + 16);
LOAD32H(rk[5], key + 20); LOAD32H(rk[5], key + 20);
LOAD32H(rk[6], key + 24); LOAD32H(rk[6], key + 24);
@ -213,7 +210,7 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s
#ifndef ENCRYPT_ONLY #ifndef ENCRYPT_ONLY
/* setup the inverse key now */ /* setup the inverse key now */
rk = skey->rijndael.dK; rk = skey->rijndael.dK;
rrk = skey->rijndael.eK + j - 4; rrk = skey->rijndael.eK + (28 + keylen) - 4;
/* apply the inverse MixColumn transform to all round keys but the first and the last: */ /* apply the inverse MixColumn transform to all round keys but the first and the last: */
/* copy first */ /* copy first */