aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-09-11 13:08:54 -0400
committerJack Lloyd <[email protected]>2017-09-11 13:08:54 -0400
commit18a6033af50c1c5a37dc4cb48b5e1b313e2773bf (patch)
treef15702eb34f4a30c6e36cb3cdfa1809d84cba217 /src/tests
parent0f1aaaaf76f737fd0b421af00c49b82fd3d17d5b (diff)
Fix bugs in OCB long test
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_ocb.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tests/test_ocb.cpp b/src/tests/test_ocb.cpp
index cacf9a0d4..aa9343e7f 100644
--- a/src/tests/test_ocb.cpp
+++ b/src/tests/test_ocb.cpp
@@ -195,18 +195,20 @@ class OCB_Wide_Long_KAT_Tests : public Text_Based_Test
for(size_t i = 0; i != 128; ++i)
{
- const std::vector<uint8_t> S(i);
+ std::vector<uint8_t> S(i);
+ for(size_t j = 0; j != S.size(); ++j)
+ S[j] = 0x50 + j;
- Botan::store_be(static_cast<uint32_t>(3 * i + 1), &N[8]);
+ Botan::store_be(static_cast<uint16_t>(3 * i + 1), &N[0]);
ocb_encrypt(result, C, enc, N, S, S);
- Botan::store_be(static_cast<uint32_t>(3 * i + 2), &N[8]);
+ Botan::store_be(static_cast<uint16_t>(3 * i + 2), &N[0]);
ocb_encrypt(result, C, enc, N, S, empty);
- Botan::store_be(static_cast<uint32_t>(3 * i + 3), &N[8]);
+ Botan::store_be(static_cast<uint16_t>(3 * i + 3), &N[0]);
ocb_encrypt(result, C, enc, N, empty, S);
}
- Botan::store_be(static_cast<uint32_t>(385), &N[8]);
+ Botan::store_be(static_cast<uint16_t>(385), &N[0]);
std::vector<uint8_t> final_result;
ocb_encrypt(result, final_result, enc, N, empty, C);