Clear signed/unsigned warnings with GCC and -Wall -Wextra
parent
4d9c91b425
commit
0aa2ebbbf3
|
|
@ -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];
|
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]);
|
R2(c[0], c[1], k[i], k[i + 1]);
|
||||||
|
|
||||||
if (R & 1)
|
if (R & 1)
|
||||||
|
|
@ -82,7 +82,7 @@ inline void SIMON_Decrypt(W p[2], const W c[2], const W k[R])
|
||||||
rounds--;
|
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]);
|
R2(p[1], p[0], k[i + 1], k[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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];
|
c[0]=p[0]; c[1]=p[1];
|
||||||
|
|
||||||
// Don't unroll this loop. Things slow down.
|
// 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]);
|
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];
|
p[0]=c[0]; p[1]=c[1];
|
||||||
|
|
||||||
// Don't unroll this loop. Things slow down.
|
// 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]);
|
TR83(p[0], p[1], k[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue