less warning
warning: cast discards qualifiers from pointer target type
This commit is contained in:
parent
2b4aa63478
commit
c56df4e782
@ -99,31 +99,31 @@ int rijndaelKeyEncToDec(word8 W[MAXROUNDS+1][4][4], int ROUNDS) {
|
||||
for (r = 1; r < ROUNDS; r++) {
|
||||
w = W[r][0];
|
||||
*((word32*)w) =
|
||||
*((word32*)U1[w[0]])
|
||||
^ *((word32*)U2[w[1]])
|
||||
^ *((word32*)U3[w[2]])
|
||||
^ *((word32*)U4[w[3]]);
|
||||
*((const word32*)U1[w[0]])
|
||||
^ *((const word32*)U2[w[1]])
|
||||
^ *((const word32*)U3[w[2]])
|
||||
^ *((const word32*)U4[w[3]]);
|
||||
|
||||
w = W[r][1];
|
||||
*((word32*)w) =
|
||||
*((word32*)U1[w[0]])
|
||||
^ *((word32*)U2[w[1]])
|
||||
^ *((word32*)U3[w[2]])
|
||||
^ *((word32*)U4[w[3]]);
|
||||
*((const word32*)U1[w[0]])
|
||||
^ *((const word32*)U2[w[1]])
|
||||
^ *((const word32*)U3[w[2]])
|
||||
^ *((const word32*)U4[w[3]]);
|
||||
|
||||
w = W[r][2];
|
||||
*((word32*)w) =
|
||||
*((word32*)U1[w[0]])
|
||||
^ *((word32*)U2[w[1]])
|
||||
^ *((word32*)U3[w[2]])
|
||||
^ *((word32*)U4[w[3]]);
|
||||
*((const word32*)U1[w[0]])
|
||||
^ *((const word32*)U2[w[1]])
|
||||
^ *((const word32*)U3[w[2]])
|
||||
^ *((const word32*)U4[w[3]]);
|
||||
|
||||
w = W[r][3];
|
||||
*((word32*)w) =
|
||||
*((word32*)U1[w[0]])
|
||||
^ *((word32*)U2[w[1]])
|
||||
^ *((word32*)U3[w[2]])
|
||||
^ *((word32*)U4[w[3]]);
|
||||
*((const word32*)U1[w[0]])
|
||||
^ *((const word32*)U2[w[1]])
|
||||
^ *((const word32*)U3[w[2]])
|
||||
^ *((const word32*)U4[w[3]]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -151,44 +151,44 @@ int rijndaelEncrypt(word8 in[16], word8 out[16], word8 rk[MAXROUNDS+1][4][4], in
|
||||
*((word32*)temp[1]) = *((word32*)(a+ 4)) ^ *((word32*)rk[0][1]);
|
||||
*((word32*)temp[2]) = *((word32*)(a+ 8)) ^ *((word32*)rk[0][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(a+12)) ^ *((word32*)rk[0][3]);
|
||||
*((word32*)(b )) = *((word32*)T1[temp[0][0]])
|
||||
^ *((word32*)T2[temp[1][1]])
|
||||
^ *((word32*)T3[temp[2][2]])
|
||||
^ *((word32*)T4[temp[3][3]]);
|
||||
*((word32*)(b + 4)) = *((word32*)T1[temp[1][0]])
|
||||
^ *((word32*)T2[temp[2][1]])
|
||||
^ *((word32*)T3[temp[3][2]])
|
||||
^ *((word32*)T4[temp[0][3]]);
|
||||
*((word32*)(b + 8)) = *((word32*)T1[temp[2][0]])
|
||||
^ *((word32*)T2[temp[3][1]])
|
||||
^ *((word32*)T3[temp[0][2]])
|
||||
^ *((word32*)T4[temp[1][3]]);
|
||||
*((word32*)(b +12)) = *((word32*)T1[temp[3][0]])
|
||||
^ *((word32*)T2[temp[0][1]])
|
||||
^ *((word32*)T3[temp[1][2]])
|
||||
^ *((word32*)T4[temp[2][3]]);
|
||||
*((word32*)(b )) = *((const word32*)T1[temp[0][0]])
|
||||
^ *((const word32*)T2[temp[1][1]])
|
||||
^ *((const word32*)T3[temp[2][2]])
|
||||
^ *((const word32*)T4[temp[3][3]]);
|
||||
*((word32*)(b + 4)) = *((const word32*)T1[temp[1][0]])
|
||||
^ *((const word32*)T2[temp[2][1]])
|
||||
^ *((const word32*)T3[temp[3][2]])
|
||||
^ *((const word32*)T4[temp[0][3]]);
|
||||
*((word32*)(b + 8)) = *((const word32*)T1[temp[2][0]])
|
||||
^ *((const word32*)T2[temp[3][1]])
|
||||
^ *((const word32*)T3[temp[0][2]])
|
||||
^ *((const word32*)T4[temp[1][3]]);
|
||||
*((word32*)(b +12)) = *((const word32*)T1[temp[3][0]])
|
||||
^ *((const word32*)T2[temp[0][1]])
|
||||
^ *((const word32*)T3[temp[1][2]])
|
||||
^ *((const word32*)T4[temp[2][3]]);
|
||||
for (r = 1; r < ROUNDS-1; r++) {
|
||||
*((word32*)temp[0]) = *((word32*)(b )) ^ *((word32*)rk[r][0]);
|
||||
*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[r][1]);
|
||||
*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[r][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[r][3]);
|
||||
|
||||
*((word32*)(b )) = *((word32*)T1[temp[0][0]])
|
||||
^ *((word32*)T2[temp[1][1]])
|
||||
^ *((word32*)T3[temp[2][2]])
|
||||
^ *((word32*)T4[temp[3][3]]);
|
||||
*((word32*)(b + 4)) = *((word32*)T1[temp[1][0]])
|
||||
^ *((word32*)T2[temp[2][1]])
|
||||
^ *((word32*)T3[temp[3][2]])
|
||||
^ *((word32*)T4[temp[0][3]]);
|
||||
*((word32*)(b + 8)) = *((word32*)T1[temp[2][0]])
|
||||
^ *((word32*)T2[temp[3][1]])
|
||||
^ *((word32*)T3[temp[0][2]])
|
||||
^ *((word32*)T4[temp[1][3]]);
|
||||
*((word32*)(b +12)) = *((word32*)T1[temp[3][0]])
|
||||
^ *((word32*)T2[temp[0][1]])
|
||||
^ *((word32*)T3[temp[1][2]])
|
||||
^ *((word32*)T4[temp[2][3]]);
|
||||
*((word32*)(b )) = *((const word32*)T1[temp[0][0]])
|
||||
^ *((const word32*)T2[temp[1][1]])
|
||||
^ *((const word32*)T3[temp[2][2]])
|
||||
^ *((const word32*)T4[temp[3][3]]);
|
||||
*((word32*)(b + 4)) = *((const word32*)T1[temp[1][0]])
|
||||
^ *((const word32*)T2[temp[2][1]])
|
||||
^ *((const word32*)T3[temp[3][2]])
|
||||
^ *((const word32*)T4[temp[0][3]]);
|
||||
*((word32*)(b + 8)) = *((const word32*)T1[temp[2][0]])
|
||||
^ *((const word32*)T2[temp[3][1]])
|
||||
^ *((const word32*)T3[temp[0][2]])
|
||||
^ *((const word32*)T4[temp[1][3]]);
|
||||
*((word32*)(b +12)) = *((const word32*)T1[temp[3][0]])
|
||||
^ *((const word32*)T2[temp[0][1]])
|
||||
^ *((const word32*)T3[temp[1][2]])
|
||||
^ *((const word32*)T4[temp[2][3]]);
|
||||
}
|
||||
/* last round is special */
|
||||
*((word32*)temp[0]) = *((word32*)(b )) ^ *((word32*)rk[ROUNDS-1][0]);
|
||||
@ -317,43 +317,43 @@ int rijndaelDecrypt(word8 in[16], word8 out[16], word8 rk[MAXROUNDS+1][4][4], in
|
||||
*((word32*)temp[2]) = *((word32*)(a+ 8)) ^ *((word32*)rk[ROUNDS][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(a+12)) ^ *((word32*)rk[ROUNDS][3]);
|
||||
|
||||
*((word32*)(b )) = *((word32*)T5[temp[0][0]])
|
||||
^ *((word32*)T6[temp[3][1]])
|
||||
^ *((word32*)T7[temp[2][2]])
|
||||
^ *((word32*)T8[temp[1][3]]);
|
||||
*((word32*)(b+ 4)) = *((word32*)T5[temp[1][0]])
|
||||
^ *((word32*)T6[temp[0][1]])
|
||||
^ *((word32*)T7[temp[3][2]])
|
||||
^ *((word32*)T8[temp[2][3]]);
|
||||
*((word32*)(b+ 8)) = *((word32*)T5[temp[2][0]])
|
||||
^ *((word32*)T6[temp[1][1]])
|
||||
^ *((word32*)T7[temp[0][2]])
|
||||
^ *((word32*)T8[temp[3][3]]);
|
||||
*((word32*)(b+12)) = *((word32*)T5[temp[3][0]])
|
||||
^ *((word32*)T6[temp[2][1]])
|
||||
^ *((word32*)T7[temp[1][2]])
|
||||
^ *((word32*)T8[temp[0][3]]);
|
||||
*((word32*)(b )) = *((const word32*)T5[temp[0][0]])
|
||||
^ *((const word32*)T6[temp[3][1]])
|
||||
^ *((const word32*)T7[temp[2][2]])
|
||||
^ *((const word32*)T8[temp[1][3]]);
|
||||
*((word32*)(b+ 4)) = *((const word32*)T5[temp[1][0]])
|
||||
^ *((const word32*)T6[temp[0][1]])
|
||||
^ *((const word32*)T7[temp[3][2]])
|
||||
^ *((const word32*)T8[temp[2][3]]);
|
||||
*((word32*)(b+ 8)) = *((const word32*)T5[temp[2][0]])
|
||||
^ *((const word32*)T6[temp[1][1]])
|
||||
^ *((const word32*)T7[temp[0][2]])
|
||||
^ *((const word32*)T8[temp[3][3]]);
|
||||
*((word32*)(b+12)) = *((const word32*)T5[temp[3][0]])
|
||||
^ *((const word32*)T6[temp[2][1]])
|
||||
^ *((const word32*)T7[temp[1][2]])
|
||||
^ *((const word32*)T8[temp[0][3]]);
|
||||
for (r = ROUNDS-1; r > 1; r--) {
|
||||
*((word32*)temp[0]) = *((word32*)(b )) ^ *((word32*)rk[r][0]);
|
||||
*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[r][1]);
|
||||
*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[r][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[r][3]);
|
||||
*((word32*)(b )) = *((word32*)T5[temp[0][0]])
|
||||
^ *((word32*)T6[temp[3][1]])
|
||||
^ *((word32*)T7[temp[2][2]])
|
||||
^ *((word32*)T8[temp[1][3]]);
|
||||
*((word32*)(b+ 4)) = *((word32*)T5[temp[1][0]])
|
||||
^ *((word32*)T6[temp[0][1]])
|
||||
^ *((word32*)T7[temp[3][2]])
|
||||
^ *((word32*)T8[temp[2][3]]);
|
||||
*((word32*)(b+ 8)) = *((word32*)T5[temp[2][0]])
|
||||
^ *((word32*)T6[temp[1][1]])
|
||||
^ *((word32*)T7[temp[0][2]])
|
||||
^ *((word32*)T8[temp[3][3]]);
|
||||
*((word32*)(b+12)) = *((word32*)T5[temp[3][0]])
|
||||
^ *((word32*)T6[temp[2][1]])
|
||||
^ *((word32*)T7[temp[1][2]])
|
||||
^ *((word32*)T8[temp[0][3]]);
|
||||
*((word32*)(b )) = *((const word32*)T5[temp[0][0]])
|
||||
^ *((const word32*)T6[temp[3][1]])
|
||||
^ *((const word32*)T7[temp[2][2]])
|
||||
^ *((const word32*)T8[temp[1][3]]);
|
||||
*((word32*)(b+ 4)) = *((const word32*)T5[temp[1][0]])
|
||||
^ *((const word32*)T6[temp[0][1]])
|
||||
^ *((const word32*)T7[temp[3][2]])
|
||||
^ *((const word32*)T8[temp[2][3]]);
|
||||
*((word32*)(b+ 8)) = *((const word32*)T5[temp[2][0]])
|
||||
^ *((const word32*)T6[temp[1][1]])
|
||||
^ *((const word32*)T7[temp[0][2]])
|
||||
^ *((const word32*)T8[temp[3][3]]);
|
||||
*((word32*)(b+12)) = *((const word32*)T5[temp[3][0]])
|
||||
^ *((const word32*)T6[temp[2][1]])
|
||||
^ *((const word32*)T7[temp[1][2]])
|
||||
^ *((const word32*)T8[temp[0][3]]);
|
||||
}
|
||||
/* last round is special */
|
||||
*((word32*)temp[0]) = *((word32*)(b )) ^ *((word32*)rk[1][0]);
|
||||
|
@ -534,7 +534,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
|
||||
}
|
||||
while (len >= SHA256_BLOCK_LENGTH) {
|
||||
/* Process as many complete blocks as we can */
|
||||
SHA256_Transform(context, (sha2_word32*)data);
|
||||
SHA256_Transform(context, (const sha2_word32*)data);
|
||||
context->bitcount += SHA256_BLOCK_LENGTH << 3;
|
||||
len -= SHA256_BLOCK_LENGTH;
|
||||
data += SHA256_BLOCK_LENGTH;
|
||||
@ -856,7 +856,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
|
||||
}
|
||||
while (len >= SHA512_BLOCK_LENGTH) {
|
||||
/* Process as many complete blocks as we can */
|
||||
SHA512_Transform(context, (sha2_word64*)data);
|
||||
SHA512_Transform(context, (const sha2_word64*)data);
|
||||
ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3);
|
||||
len -= SHA512_BLOCK_LENGTH;
|
||||
data += SHA512_BLOCK_LENGTH;
|
||||
|
Loading…
Reference in New Issue
Block a user