From e0ca8db7b790051ec0247b1fb43af6a3f34ef3ac Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Feb 2025 08:36:37 -0500 Subject: [PATCH 1/8] Add nist cavs testing of SHA1 HMAC DRBG --- test/Jamfile | 2 +- test/test_nist_cavs_sha1_hmac_drbg.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Jamfile b/test/Jamfile index 2e1e9af0..c52f038a 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -87,7 +87,7 @@ run test_hash_drbg.cpp ; 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_sha1_hmac_drbg.cpp ; +run test_nist_cavs_sha1_hmac_drbg.cpp ; run test_nist_cavs_sha1_hash_drbg.cpp ; run test_nist_cavs_sha224_monte.cpp ; diff --git a/test/test_nist_cavs_sha1_hmac_drbg.cpp b/test/test_nist_cavs_sha1_hmac_drbg.cpp index dd412788..2f9d9226 100644 --- a/test/test_nist_cavs_sha1_hmac_drbg.cpp +++ b/test/test_nist_cavs_sha1_hmac_drbg.cpp @@ -3,7 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include +#include #include "test_nist_cavs_detail.hpp" auto main() -> int From ccfe2919df9c0eb99320bd2d1aa25f61c19f50d1 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Feb 2025 08:41:01 -0500 Subject: [PATCH 2/8] Add and test SHA224 HMAC DRBG --- include/boost/crypt2/drbg/sha224_drbg.hpp | 8 ++++++++ test/Jamfile | 2 +- test/test_nist_cavs_sha224_hmac_drbg.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/crypt2/drbg/sha224_drbg.hpp b/include/boost/crypt2/drbg/sha224_drbg.hpp index c229fe16..f6929610 100644 --- a/include/boost/crypt2/drbg/sha224_drbg.hpp +++ b/include/boost/crypt2/drbg/sha224_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA224_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha224_hash_drbg_t = hash_drbg; +template +using sha224_hmac_drbg_t = hmac_drbg, 192U, 224U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha224_hash_drbg = drbg_detail::sha224_hash_drbg_t; BOOST_CRYPT_EXPORT using sha224_hash_drbg_pr = drbg_detail::sha224_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha224_hmac_drbg = drbg_detail::sha224_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha224_hmac_drbg_pr = drbg_detail::sha224_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT2_DRBG_SHA224_DRBG_HPP diff --git a/test/Jamfile b/test/Jamfile index c52f038a..bd953b20 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -93,7 +93,7 @@ run test_nist_cavs_sha1_hash_drbg.cpp ; run test_nist_cavs_sha224_monte.cpp ; run test_nist_cavs_sha224_short_long.cpp ; run test_nist_cavs_sha224_hmac.cpp ; -#run test_nist_cavs_sha224_hmac_drbg.cpp ; +run test_nist_cavs_sha224_hmac_drbg.cpp ; run test_nist_cavs_sha224_hash_drbg.cpp ; run test_nist_cavs_sha256_monte.cpp ; diff --git a/test/test_nist_cavs_sha224_hmac_drbg.cpp b/test/test_nist_cavs_sha224_hmac_drbg.cpp index f179fb3b..1f4f3caf 100644 --- a/test/test_nist_cavs_sha224_hmac_drbg.cpp +++ b/test/test_nist_cavs_sha224_hmac_drbg.cpp @@ -3,7 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include +#include #include "test_nist_cavs_detail.hpp" auto main() -> int From ffcb192204fc0065af47c67d2ea2db2159e482b6 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Feb 2025 08:45:02 -0500 Subject: [PATCH 3/8] Add and test SHA256 HMAC DRBG --- include/boost/crypt2/drbg/sha256_drbg.hpp | 8 ++++++++ test/Jamfile | 2 +- test/test_nist_cavs_sha256_hmac_drbg.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/crypt2/drbg/sha256_drbg.hpp b/include/boost/crypt2/drbg/sha256_drbg.hpp index 40156460..9b6e853c 100644 --- a/include/boost/crypt2/drbg/sha256_drbg.hpp +++ b/include/boost/crypt2/drbg/sha256_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA256_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha256_hash_drbg_t = hash_drbg; +template +using sha256_hmac_drbg_t = hmac_drbg, 256U, 256U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha256_hash_drbg = drbg_detail::sha256_hash_drbg_t; BOOST_CRYPT_EXPORT using sha256_hash_drbg_pr = drbg_detail::sha256_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha256_hmac_drbg = drbg_detail::sha256_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha256_hmac_drbg_pr = drbg_detail::sha256_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT2_DRBG_SHA256_DRBG_HPP diff --git a/test/Jamfile b/test/Jamfile index bd953b20..5c2bfddb 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -99,7 +99,7 @@ run test_nist_cavs_sha224_hash_drbg.cpp ; run test_nist_cavs_sha256_monte.cpp ; run test_nist_cavs_sha256_short_long.cpp ; run test_nist_cavs_sha256_hmac.cpp ; -#run test_nist_cavs_sha256_hmac_drbg.cpp ; +run test_nist_cavs_sha256_hmac_drbg.cpp ; run test_nist_cavs_sha256_hash_drbg.cpp ; run test_nist_cavs_sha384_monte.cpp ; diff --git a/test/test_nist_cavs_sha256_hmac_drbg.cpp b/test/test_nist_cavs_sha256_hmac_drbg.cpp index d5f5318d..25448a28 100644 --- a/test/test_nist_cavs_sha256_hmac_drbg.cpp +++ b/test/test_nist_cavs_sha256_hmac_drbg.cpp @@ -3,7 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include +#include #include "test_nist_cavs_detail.hpp" auto main() -> int From fb47cd3be59ed33a6bf7ecf8678ef12c38981a1e Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Feb 2025 08:47:39 -0500 Subject: [PATCH 4/8] Add and test SHA384 HMAC DRBG --- include/boost/crypt2/drbg/sha384_drbg.hpp | 8 ++++++++ test/Jamfile | 2 +- test/test_nist_cavs_sha384_hmac_drbg.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/crypt2/drbg/sha384_drbg.hpp b/include/boost/crypt2/drbg/sha384_drbg.hpp index a9a42283..3e4adb5c 100644 --- a/include/boost/crypt2/drbg/sha384_drbg.hpp +++ b/include/boost/crypt2/drbg/sha384_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA384_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha384_hash_drbg_t = hash_drbg; +template +using sha384_hmac_drbg_t = hmac_drbg, 256U, 384U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha384_hash_drbg = drbg_detail::sha384_hash_drbg_t; BOOST_CRYPT_EXPORT using sha384_hash_drbg_pr = drbg_detail::sha384_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha384_hmac_drbg = drbg_detail::sha384_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha384_hmac_drbg_pr = drbg_detail::sha384_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT2_DRBG_SHA384_DRBG_HPP diff --git a/test/Jamfile b/test/Jamfile index 5c2bfddb..050e4d63 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -105,7 +105,7 @@ run test_nist_cavs_sha256_hash_drbg.cpp ; run test_nist_cavs_sha384_monte.cpp ; run test_nist_cavs_sha384_short_long.cpp ; run test_nist_cavs_sha384_hmac.cpp ; -#run test_nist_cavs_sha384_hmac_drbg.cpp ; +run test_nist_cavs_sha384_hmac_drbg.cpp ; run test_nist_cavs_sha384_hash_drbg.cpp ; run test_nist_cavs_sha512_monte.cpp ; diff --git a/test/test_nist_cavs_sha384_hmac_drbg.cpp b/test/test_nist_cavs_sha384_hmac_drbg.cpp index 6716743d..b6a0d693 100644 --- a/test/test_nist_cavs_sha384_hmac_drbg.cpp +++ b/test/test_nist_cavs_sha384_hmac_drbg.cpp @@ -3,7 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include +#include #include "test_nist_cavs_detail.hpp" auto main() -> int From dbde0691a628a152caab0dc0ee52cdf0b59f537a Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Feb 2025 08:53:32 -0500 Subject: [PATCH 5/8] Add SHA3 family HMAC DRBG definitions --- include/boost/crypt2/drbg/sha3_224_drbg.hpp | 8 ++++++++ include/boost/crypt2/drbg/sha3_256_drbg.hpp | 8 ++++++++ include/boost/crypt2/drbg/sha3_384_drbg.hpp | 8 ++++++++ include/boost/crypt2/drbg/sha3_512_drbg.hpp | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/include/boost/crypt2/drbg/sha3_224_drbg.hpp b/include/boost/crypt2/drbg/sha3_224_drbg.hpp index b1ee49d5..fbbe47be 100644 --- a/include/boost/crypt2/drbg/sha3_224_drbg.hpp +++ b/include/boost/crypt2/drbg/sha3_224_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA3_224_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha3_224_hash_drbg_t = hash_drbg; +template +using sha3_224_hmac_drbg_t = hmac_drbg, 192U, 224U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha3_224_hash_drbg = drbg_detail::sha3_224_hash_drbg_t; BOOST_CRYPT_EXPORT using sha3_224_hash_drbg_pr = drbg_detail::sha3_224_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha3_224_hmac_drbg = drbg_detail::sha3_224_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha3_224_hmac_drbg_pr = drbg_detail::sha3_224_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT_DRBG_SHA3_224_DRBG_HPP diff --git a/include/boost/crypt2/drbg/sha3_256_drbg.hpp b/include/boost/crypt2/drbg/sha3_256_drbg.hpp index 377c5c27..2cf406f8 100644 --- a/include/boost/crypt2/drbg/sha3_256_drbg.hpp +++ b/include/boost/crypt2/drbg/sha3_256_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA3_256_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha3_256_hash_drbg_t = hash_drbg; +template +using sha3_256_hmac_drbg_t = hmac_drbg, 256U, 256U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha3_256_hash_drbg = drbg_detail::sha3_256_hash_drbg_t; BOOST_CRYPT_EXPORT using sha3_256_hash_drbg_pr = drbg_detail::sha3_256_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha3_256_hmac_drbg = drbg_detail::sha3_256_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha3_256_hmac_drbg_pr = drbg_detail::sha3_256_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT_DRBG_SHA3_256_DRBG_HPP diff --git a/include/boost/crypt2/drbg/sha3_384_drbg.hpp b/include/boost/crypt2/drbg/sha3_384_drbg.hpp index 0d8a8ab5..f28cc1bc 100644 --- a/include/boost/crypt2/drbg/sha3_384_drbg.hpp +++ b/include/boost/crypt2/drbg/sha3_384_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA3_384_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha3_384_hash_drbg_t = hash_drbg; +template +using sha3_384_hmac_drbg_t = hmac_drbg, 256U, 384U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha3_384_hash_drbg = drbg_detail::sha3_384_hash_drbg_t; BOOST_CRYPT_EXPORT using sha3_384_hash_drbg_pr = drbg_detail::sha3_384_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha3_384_hmac_drbg = drbg_detail::sha3_384_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha3_384_hmac_drbg_pr = drbg_detail::sha3_384_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT_DRBG_SHA3_384_DRBG_HPP diff --git a/include/boost/crypt2/drbg/sha3_512_drbg.hpp b/include/boost/crypt2/drbg/sha3_512_drbg.hpp index a4140ec2..f2fbc7ee 100644 --- a/include/boost/crypt2/drbg/sha3_512_drbg.hpp +++ b/include/boost/crypt2/drbg/sha3_512_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA3_512_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha3_512_hash_drbg_t = hash_drbg; +template +using sha3_512_hmac_drbg_t = hmac_drbg, 256U, 512U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha3_512_hash_drbg = drbg_detail::sha3_512_hash_drbg_t; BOOST_CRYPT_EXPORT using sha3_512_hash_drbg_pr = drbg_detail::sha3_512_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha3_512_hmac_drbg = drbg_detail::sha3_512_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha3_512_hmac_drbg_pr = drbg_detail::sha3_512_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT_DRBG_SHA3_512_DRBG_HPP From e5f14a614da9a6d743ad4983ab4aadc122ea464d Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Feb 2025 09:16:07 -0500 Subject: [PATCH 6/8] Add and test SHA512/224 HMAC DRBG --- include/boost/crypt2/drbg/sha512_224_drbg.hpp | 8 ++++++++ test/Jamfile | 2 +- test/test_nist_cavs_sha512_224_hmac_drbg.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/crypt2/drbg/sha512_224_drbg.hpp b/include/boost/crypt2/drbg/sha512_224_drbg.hpp index f21d4eb0..804420e4 100644 --- a/include/boost/crypt2/drbg/sha512_224_drbg.hpp +++ b/include/boost/crypt2/drbg/sha512_224_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA512_224_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha512_224_hash_drbg_t = hash_drbg; +template +using sha512_224_hmac_drbg_t = hmac_drbg, 192U, 224U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha512_224_hash_drbg = drbg_detail::sha512_224_hash_drbg_t; BOOST_CRYPT_EXPORT using sha512_224_hash_drbg_pr = drbg_detail::sha512_224_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha512_224_hmac_drbg = drbg_detail::sha512_224_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha512_224_hmac_drbg_pr = drbg_detail::sha512_224_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT2_DRBG_SHA512_224_DRBG_HPP diff --git a/test/Jamfile b/test/Jamfile index 050e4d63..daf87940 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -117,7 +117,7 @@ run test_nist_cavs_sha512_hash_drbg.cpp ; run test_nist_cavs_sha512_224_monte.cpp ; run test_nist_cavs_sha512_224_short_long.cpp ; run test_nist_cavs_sha512_224_hmac.cpp ; -#run test_nist_cavs_sha512_224_hmac_drbg.cpp ; +run test_nist_cavs_sha512_224_hmac_drbg.cpp ; run test_nist_cavs_sha512_224_hash_drbg.cpp ; run test_nist_cavs_sha512_256_monte.cpp ; diff --git a/test/test_nist_cavs_sha512_224_hmac_drbg.cpp b/test/test_nist_cavs_sha512_224_hmac_drbg.cpp index e2db576d..cacf34de 100644 --- a/test/test_nist_cavs_sha512_224_hmac_drbg.cpp +++ b/test/test_nist_cavs_sha512_224_hmac_drbg.cpp @@ -3,7 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include +#include #include "test_nist_cavs_detail.hpp" auto main() -> int From 38470a16e2f444b48eabe093a661310709bd8161 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Feb 2025 09:17:45 -0500 Subject: [PATCH 7/8] Add and test SHA512/256 HMAC DRBG --- include/boost/crypt2/drbg/sha512_256_drbg.hpp | 8 ++++++++ test/Jamfile | 2 +- test/test_nist_cavs_sha512_256_hmac_drbg.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/crypt2/drbg/sha512_256_drbg.hpp b/include/boost/crypt2/drbg/sha512_256_drbg.hpp index 1e4eb7bc..2f45bcc2 100644 --- a/include/boost/crypt2/drbg/sha512_256_drbg.hpp +++ b/include/boost/crypt2/drbg/sha512_256_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA512_256_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha512_256_hash_drbg_t = hash_drbg; +template +using sha512_256_hmac_drbg_t = hmac_drbg, 256U, 256U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha512_256_hash_drbg = drbg_detail::sha512_256_hash_drbg_t; BOOST_CRYPT_EXPORT using sha512_256_hash_drbg_pr = drbg_detail::sha512_256_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha512_256_hmac_drbg = drbg_detail::sha512_256_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha512_256_hmac_drbg_pr = drbg_detail::sha512_256_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT2_DRBG_SHA512_256_DRBG_HPP diff --git a/test/Jamfile b/test/Jamfile index daf87940..893250f2 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -123,7 +123,7 @@ run test_nist_cavs_sha512_224_hash_drbg.cpp ; run test_nist_cavs_sha512_256_monte.cpp ; run test_nist_cavs_sha512_256_short_long.cpp ; run test_nist_cavs_sha512_256_hmac.cpp ; -#run test_nist_cavs_sha512_256_hmac_drbg.cpp ; +run test_nist_cavs_sha512_256_hmac_drbg.cpp ; run test_nist_cavs_sha512_256_hash_drbg.cpp ; run test_nist_cavs_sha3_512_monte.cpp ; diff --git a/test/test_nist_cavs_sha512_256_hmac_drbg.cpp b/test/test_nist_cavs_sha512_256_hmac_drbg.cpp index 15b03ef7..fe250621 100644 --- a/test/test_nist_cavs_sha512_256_hmac_drbg.cpp +++ b/test/test_nist_cavs_sha512_256_hmac_drbg.cpp @@ -3,7 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include +#include #include "test_nist_cavs_detail.hpp" auto main() -> int From 851a4cdf611fb9127474d62a0cf922de7ce56331 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Feb 2025 09:19:20 -0500 Subject: [PATCH 8/8] Add and test SHA512 HMAC DRBG --- include/boost/crypt2/drbg/sha512_drbg.hpp | 8 ++++++++ test/Jamfile | 2 +- test/test_nist_cavs_sha512_hmac_drbg.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/crypt2/drbg/sha512_drbg.hpp b/include/boost/crypt2/drbg/sha512_drbg.hpp index e73ee028..a1dc27b5 100644 --- a/include/boost/crypt2/drbg/sha512_drbg.hpp +++ b/include/boost/crypt2/drbg/sha512_drbg.hpp @@ -6,6 +6,8 @@ #define BOOST_CRYPT2_DRBG_SHA512_DRBG_HPP #include +#include +#include #include namespace boost::crypt { @@ -15,11 +17,17 @@ namespace drbg_detail { template using sha512_hash_drbg_t = hash_drbg; +template +using sha512_hmac_drbg_t = hmac_drbg, 256U, 512U, prediction_resistance>; + } // namespace drbg_detail BOOST_CRYPT_EXPORT using sha512_hash_drbg = drbg_detail::sha512_hash_drbg_t; BOOST_CRYPT_EXPORT using sha512_hash_drbg_pr = drbg_detail::sha512_hash_drbg_t; +BOOST_CRYPT_EXPORT using sha512_hmac_drbg = drbg_detail::sha512_hmac_drbg_t; +BOOST_CRYPT_EXPORT using sha512_hmac_drbg_pr = drbg_detail::sha512_hmac_drbg_t; + } // namespace boost::crypt #endif // BOOST_CRYPT2_DRBG_SHA512_DRBG_HPP diff --git a/test/Jamfile b/test/Jamfile index 893250f2..b364f475 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -111,7 +111,7 @@ run test_nist_cavs_sha384_hash_drbg.cpp ; run test_nist_cavs_sha512_monte.cpp ; run test_nist_cavs_sha512_short_long.cpp ; run test_nist_cavs_sha512_hmac.cpp ; -#run test_nist_cavs_sha512_hmac_drbg.cpp ; +run test_nist_cavs_sha512_hmac_drbg.cpp ; run test_nist_cavs_sha512_hash_drbg.cpp ; run test_nist_cavs_sha512_224_monte.cpp ; diff --git a/test/test_nist_cavs_sha512_hmac_drbg.cpp b/test/test_nist_cavs_sha512_hmac_drbg.cpp index 3a9a34b6..b94d55be 100644 --- a/test/test_nist_cavs_sha512_hmac_drbg.cpp +++ b/test/test_nist_cavs_sha512_hmac_drbg.cpp @@ -3,7 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include +#include #include "test_nist_cavs_detail.hpp" auto main() -> int