Skip to content

Commit

Permalink
Clear signed/unsigned warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Dec 31, 2017
1 parent ba98c2b commit 5f083d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions simon-simd.cpp
Expand Up @@ -136,7 +136,7 @@ inline void SIMON64_Enc_Block(uint32x4_t &block1, uint32x4_t &block0,

x1 = Shuffle32(x1); y1 = Shuffle32(y1);

for (size_t i = 0; static_cast<int>(i) < (rounds & ~1)-1; i += 2)
for (int i = 0; i < static_cast<int>(rounds & ~1)-1; i += 2)
{
const uint32x4_t rk1 = vld1q_dup_u32(subkeys+i);
y1 = veorq_u32(veorq_u32(y1, SIMON64_f(x1)), rk1);
Expand Down Expand Up @@ -182,7 +182,7 @@ inline void SIMON64_Dec_Block(uint32x4_t &block0, uint32x4_t &block1,
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)
{
const uint32x4_t rk1 = vld1q_dup_u32(subkeys+i+1);
x1 = veorq_u32(veorq_u32(x1, SIMON64_f(y1)), rk1);
Expand Down Expand Up @@ -218,7 +218,7 @@ inline void SIMON64_Enc_6_Blocks(uint32x4_t &block0, uint32x4_t &block1,
x2 = Shuffle32(x2); y2 = Shuffle32(y2);
x3 = Shuffle32(x3); y3 = Shuffle32(y3);

for (size_t i = 0; static_cast<int>(i) < (rounds & ~1) - 1; i += 2)
for (int i = 0; i < static_cast<int>(rounds & ~1) - 1; i += 2)
{
const uint32x4_t rk1 = vld1q_dup_u32(subkeys+i);
y1 = veorq_u32(veorq_u32(y1, SIMON64_f(x1)), rk1);
Expand Down Expand Up @@ -285,7 +285,7 @@ inline void SIMON64_Dec_6_Blocks(uint32x4_t &block0, uint32x4_t &block1,
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)
{
const uint32x4_t rk1 = vld1q_dup_u32(subkeys + i + 1);
x1 = veorq_u32(veorq_u32(x1, SIMON64_f(y1)), rk1);
Expand Down Expand Up @@ -409,7 +409,7 @@ inline void SIMON128_Enc_Block(uint64x2_t &block0, uint64x2_t &block1,

x1 = Shuffle64(x1); y1 = Shuffle64(y1);

for (size_t i = 0; static_cast<int>(i) < (rounds & ~1)-1; i += 2)
for (int i = 0; i < static_cast<int>(rounds & ~1)-1; i += 2)
{
const uint64x2_t rk1 = vld1q_dup_u64(subkeys+i);
y1 = veorq_u64(veorq_u64(y1, SIMON128_f(x1)), rk1);
Expand Down Expand Up @@ -451,7 +451,7 @@ inline void SIMON128_Enc_6_Blocks(uint64x2_t &block0, uint64x2_t &block1,
x2 = Shuffle64(x2); y2 = Shuffle64(y2);
x3 = Shuffle64(x3); y3 = Shuffle64(y3);

for (size_t i = 0; static_cast<int>(i) < (rounds & ~1) - 1; i += 2)
for (int i = 0; i < static_cast<int>(rounds & ~1) - 1; i += 2)
{
const uint64x2_t rk1 = vld1q_dup_u64(subkeys+i);
y1 = veorq_u64(veorq_u64(y1, SIMON128_f(x1)), rk1);
Expand Down Expand Up @@ -507,7 +507,7 @@ inline void SIMON128_Dec_Block(uint64x2_t &block0, uint64x2_t &block1,
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)
{
const uint64x2_t rk1 = vld1q_dup_u64(subkeys+i+1);
x1 = veorq_u64(veorq_u64(x1, SIMON128_f(y1)), rk1);
Expand Down Expand Up @@ -552,7 +552,7 @@ inline void SIMON128_Dec_6_Blocks(uint64x2_t &block0, uint64x2_t &block1,
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)
{
const uint64x2_t rk1 = vld1q_dup_u64(subkeys + i + 1);
x1 = veorq_u64(veorq_u64(x1, SIMON128_f(y1)), rk1);
Expand Down
8 changes: 4 additions & 4 deletions speck-simd.cpp
Expand Up @@ -135,7 +135,7 @@ inline void SPECK64_Enc_Block(uint32x4_t &block0, uint32x4_t &block1,

x1 = Shuffle32(x1); y1 = Shuffle32(y1);

for (size_t i=0; static_cast<int>(i)<rounds; ++i)
for (int i=0; i < static_cast<int>(rounds); ++i)
{
const uint32x4_t rk = vdupq_n_u32(subkeys[i]);

Expand Down Expand Up @@ -203,7 +203,7 @@ inline void SPECK64_Enc_6_Blocks(uint32x4_t &block0, uint32x4_t &block1,
x2 = Shuffle32(x2); y2 = Shuffle32(y2);
x3 = Shuffle32(x3); y3 = Shuffle32(y3);

for (size_t i=0; static_cast<int>(i)<rounds; ++i)
for (int i=0; i < static_cast<int>(rounds); ++i)
{
const uint32x4_t rk = vdupq_n_u32(subkeys[i]);

Expand Down Expand Up @@ -383,7 +383,7 @@ inline void SPECK128_Enc_Block(uint64x2_t &block0, uint64x2_t &block1,

x1 = Shuffle64(x1); y1 = Shuffle64(y1);

for (size_t i=0; static_cast<int>(i)<rounds; ++i)
for (int i=0; i < static_cast<int>(rounds); ++i)
{
const uint64x2_t rk = vld1q_dup_u64(subkeys+i);

Expand Down Expand Up @@ -420,7 +420,7 @@ inline void SPECK128_Enc_6_Blocks(uint64x2_t &block0, uint64x2_t &block1,
x2 = Shuffle64(x2); y2 = Shuffle64(y2);
x3 = Shuffle64(x3); y3 = Shuffle64(y3);

for (size_t i=0; static_cast<int>(i)<rounds; ++i)
for (int i=0; i < static_cast<int>(rounds); ++i)
{
const uint64x2_t rk = vld1q_dup_u64(subkeys+i);

Expand Down

0 comments on commit 5f083d6

Please sign in to comment.