diff --git a/test/Jamfile b/test/Jamfile index 15621daf..d8b27135 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -69,6 +69,7 @@ run test_hmac.cpp ; # NIST standard testing run test_nist_cavs_sha1_monte.cpp ; run test_nist_cavs_sha1_short_long.cpp ; +run test_nist_cavs_sha1_hmac.cpp ; run test_nist_cavs_sha224_monte.cpp ; run test_nist_cavs_sha224_short_long.cpp ; diff --git a/test/test_nist_cavs_detail.hpp b/test/test_nist_cavs_detail.hpp index 3caa0c16..c1056731 100644 --- a/test/test_nist_cavs_detail.hpp +++ b/test/test_nist_cavs_detail.hpp @@ -7,7 +7,7 @@ #define BOOST_CRYPT_TEST_NIST_CAVS_DETAIL_HPP #include - +#include #include #include #include @@ -337,7 +337,6 @@ auto parse_file_vectors_hmac(const std::string& test_vectors_filename, test_vect result_parse_is_ok = true; std::string line { }; - std::size_t length { }; std::string message { }; std::string result { }; std::string key { }; diff --git a/test/test_nist_cavs_sha1_hmac.cpp b/test/test_nist_cavs_sha1_hmac.cpp new file mode 100644 index 00000000..3f63882d --- /dev/null +++ b/test/test_nist_cavs_sha1_hmac.cpp @@ -0,0 +1,35 @@ +// 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 test_vectors {}; + + static_cast(nist::cavs::detail::parse_file_vectors_hmac("sha1.fax", test_vectors)); + + result_is_ok = (nist::cavs::test_vectors_hmac(test_vectors) && result_is_ok); + + BOOST_TEST(result_is_ok); + } + + { + nist::cavs::test_vector_container_type test_vectors {}; + + static_cast(nist::cavs::detail::parse_file_vectors_hmac("sha1cavs11.fax", test_vectors)); + + result_is_ok = (nist::cavs::test_vectors_hmac(test_vectors) && result_is_ok); + + BOOST_TEST(result_is_ok); + } + + return boost::report_errors(); +}