From 5ce37ae5ba27fbd0644d2a591ccfac6d09927fa4 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 31 Oct 2024 16:37:55 -0400 Subject: [PATCH] Test SHAKE128 variable length output --- test/Jamfile | 1 + ...est_nist_cavs_shake128_variable_output.cpp | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/test_nist_cavs_shake128_variable_output.cpp diff --git a/test/Jamfile b/test/Jamfile index 4de839f..5a92534 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -99,3 +99,4 @@ run test_nist_cavs_sha3_224_short_long.cpp ; run test_nist_cavs_shake128_short_long.cpp ; run test_nist_cavs_shake128_monte.cpp ; +run test_nist_cavs_shake128_variable_output.cpp ; diff --git a/test/test_nist_cavs_shake128_variable_output.cpp b/test/test_nist_cavs_shake128_variable_output.cpp new file mode 100644 index 0000000..b9298e1 --- /dev/null +++ b/test/test_nist_cavs_shake128_variable_output.cpp @@ -0,0 +1,26 @@ +// Copyright 2024 Matt Borland +// Copyright 2024 Christopher Kormanyos +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include + +#include "test_nist_cavs_detail.hpp" + +auto main() -> int +{ + bool result_is_ok { true }; + + { + nist::cavs::test_vector_container_type my_test_vectors_variable { }; + + std::vector lengths {}; + static_cast(nist::cavs::detail::parse_file_vectors_variable_xof("SHAKE128VariableOut.rsp", my_test_vectors_variable, lengths)); + + result_is_ok = (nist::cavs::test_vectors_variable(my_test_vectors_variable, lengths) && result_is_ok); + + BOOST_TEST(result_is_ok); + } + + return boost::report_errors(); +}