aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_ocb.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-01 06:51:06 -0400
committerJack Lloyd <[email protected]>2017-10-01 06:51:06 -0400
commit7b1fa2b7798264f2866eb80ca43181efddb66141 (patch)
tree9c24919a8b53e3baa5417ca7e7dac0883d0f8cc0 /src/tests/test_ocb.cpp
parente58f66ae5f07f31419a819ded874fcf39aa1fdc6 (diff)
Fix some cast warnings from Sonar
Diffstat (limited to 'src/tests/test_ocb.cpp')
-rw-r--r--src/tests/test_ocb.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tests/test_ocb.cpp b/src/tests/test_ocb.cpp
index 07f216f96..490a52f4f 100644
--- a/src/tests/test_ocb.cpp
+++ b/src/tests/test_ocb.cpp
@@ -69,9 +69,9 @@ class OCB_Wide_Test_Block_Cipher final : public Botan::BlockCipher
for(size_t i = 0; i != m_bs; ++i)
out[i] = in[i] ^ m_key[i];
- const uint8_t bottom_carry = in[m_bs-1] & 0x01;
+ uint8_t carry = in[m_bs-1] & 0x01;
- if(bottom_carry)
+ if(carry)
{
if(m_bs == 16 || m_bs == 24)
{
@@ -91,13 +91,14 @@ class OCB_Wide_Test_Block_Cipher final : public Botan::BlockCipher
throw Test_Error("Bad OCB test block size");
}
- uint8_t carry = bottom_carry << 7;
+ carry <<= 7;
for(size_t i = 0; i != m_bs; ++i)
{
- uint8_t temp = out[i];
+ const uint8_t temp = out[i];
out[i] = (temp >> 1) | carry;
- carry = (temp & 0x1) << 7;
+ carry = (temp & 0x1);
+ carry <<= 7;
}
blocks--;