From 18a6033af50c1c5a37dc4cb48b5e1b313e2773bf Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 11 Sep 2017 13:08:54 -0400 Subject: Fix bugs in OCB long test --- src/tests/test_ocb.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/tests') 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 S(i); + std::vector S(i); + for(size_t j = 0; j != S.size(); ++j) + S[j] = 0x50 + j; - Botan::store_be(static_cast(3 * i + 1), &N[8]); + Botan::store_be(static_cast(3 * i + 1), &N[0]); ocb_encrypt(result, C, enc, N, S, S); - Botan::store_be(static_cast(3 * i + 2), &N[8]); + Botan::store_be(static_cast(3 * i + 2), &N[0]); ocb_encrypt(result, C, enc, N, S, empty); - Botan::store_be(static_cast(3 * i + 3), &N[8]); + Botan::store_be(static_cast(3 * i + 3), &N[0]); ocb_encrypt(result, C, enc, N, empty, S); } - Botan::store_be(static_cast(385), &N[8]); + Botan::store_be(static_cast(385), &N[0]); std::vector final_result; ocb_encrypt(result, final_result, enc, N, empty, C); -- cgit v1.2.3