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/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/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/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 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/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/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 2e1e9af0..b364f475 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -87,43 +87,43 @@ 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 ; 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 ; 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 ; 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 ; 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 ; 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 ; 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_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 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 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 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 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 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 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