diff --git a/test/Jamfile b/test/Jamfile index 95dba5f..2986f9b 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -58,5 +58,8 @@ run test_sha256.cpp ; run test_nist_cavs_sha1_monte.cpp ; run test_nist_cavs_sha1_short_long.cpp ; +run test_nist_cavs_sha224_monte.cpp ; +run test_nist_cavs_sha224_short_long.cpp ; + run test_nist_cavs_sha256_monte.cpp ; run test_nist_cavs_sha256_short_long.cpp ; diff --git a/test/test_nist_cavs_sha224_monte.cpp b/test/test_nist_cavs_sha224_monte.cpp new file mode 100644 index 0000000..98cfc2c --- /dev/null +++ b/test/test_nist_cavs_sha224_monte.cpp @@ -0,0 +1,33 @@ +// 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_monte { }; + + std::vector + seed_init + ( + { + 0x99, 0xf9, 0x57, 0xf2, 0x72, 0xb0, 0xac, 0xc5, 0xbf, 0xaf, 0x38, 0xc0, 0x30, 0x78, 0xc8, 0x8c, 0x97, 0x22, 0x67, 0x1a, 0xf0, 0x4f, 0x7e, 0x39, 0x9f, 0x5e, 0x40, 0x68 + } + ); + + static_cast(nist::cavs::parse_file_monte("SHA224Monte.rsp", my_test_vectors_monte)); + + result_is_ok = (nist::cavs::test_vectors_monte(my_test_vectors_monte, seed_init) && result_is_ok); + + BOOST_TEST(result_is_ok); + } + + return boost::report_errors(); +} diff --git a/test/test_nist_cavs_sha224_short_long.cpp b/test/test_nist_cavs_sha224_short_long.cpp new file mode 100644 index 0000000..11e8529 --- /dev/null +++ b/test/test_nist_cavs_sha224_short_long.cpp @@ -0,0 +1,36 @@ +// 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_short { }; + + static_cast(nist::cavs::detail::parse_file_vectors("SHA224ShortMsg.rsp", test_vectors_short)); + + result_is_ok = (nist::cavs::test_vectors_oneshot(test_vectors_short) && result_is_ok); + + BOOST_TEST(result_is_ok); + } + + + { + nist::cavs::test_vector_container_type test_vectors_long { }; + + static_cast(nist::cavs::detail::parse_file_vectors("SHA224LongMsg.rsp", test_vectors_long)); + + result_is_ok = (nist::cavs::test_vectors_oneshot(test_vectors_long) && result_is_ok); + + BOOST_TEST(result_is_ok); + } + + return boost::report_errors(); +}