Clear signed/unsigned warnings with GCC and -Wall -Wextra

This commit is contained in:
Jeffrey Walton 2017-12-26 16:59:32 -05:00
parent 4d9c91b425
commit 0aa2ebbbf3
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ inline void SIMON_Encrypt(W c[2], const W p[2], const W k[R])
{
c[0]=p[0]; c[1]=p[1];
for (size_t i = 0; static_cast<int>(i) < R-1; i += 2)
for (int i = 0; i < static_cast<int>(R-1); i += 2)
R2(c[0], c[1], k[i], k[i + 1]);
if (R & 1)
@ -82,7 +82,7 @@ inline void SIMON_Decrypt(W p[2], const W c[2], const W k[R])
rounds--;
}
for (size_t i = rounds - 2; static_cast<int>(i) >= 0; i -= 2)
for (int i = static_cast<int>(rounds - 2); i >= 0; i -= 2)
R2(p[1], p[0], k[i + 1], k[i]);
}

View File

@ -64,7 +64,7 @@ inline void SPECK_Encrypt(W c[2], const W p[2], const W k[R])
c[0]=p[0]; c[1]=p[1];
// Don't unroll this loop. Things slow down.
for (size_t i=0; static_cast<int>(i)<R; ++i)
for (int i = 0; i < static_cast<int>(R); ++i)
TF83(c[0], c[1], k[i]);
}
@ -80,7 +80,7 @@ inline void SPECK_Decrypt(W p[2], const W c[2], const W k[R])
p[0]=c[0]; p[1]=c[1];
// Don't unroll this loop. Things slow down.
for (size_t i=R-1; static_cast<int>(i)>=0; --i)
for (int i = static_cast<int>(R-1); i >= 0; --i)
TR83(p[0], p[1], k[i]);
}