Skip to content

Commit

Permalink
Test SHAKE128 variable length output
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Oct 31, 2024
1 parent f9bd03b commit 5ce37ae
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
26 changes: 26 additions & 0 deletions test/test_nist_cavs_shake128_variable_output.cpp
Original file line number Diff line number Diff line change
@@ -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 <boost/crypt/hash/shake128.hpp>

#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<std::size_t> lengths {};
static_cast<void>(nist::cavs::detail::parse_file_vectors_variable_xof("SHAKE128VariableOut.rsp", my_test_vectors_variable, lengths));

result_is_ok = (nist::cavs::test_vectors_variable<boost::crypt::shake128_hasher>(my_test_vectors_variable, lengths) && result_is_ok);

BOOST_TEST(result_is_ok);
}

return boost::report_errors();
}

0 comments on commit 5ce37ae

Please sign in to comment.