WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 3302f72

Browse files
authored
Merge pull request #238 from cppalliance/hmac_drbg_cavs
Add NIST CAVS testing of HMAC DRBG
2 parents 14a243e + 851a4cd commit 3302f72

18 files changed

+94
-14
lines changed

include/boost/crypt2/drbg/sha224_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA224_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha224.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha224_hash_drbg_t = hash_drbg<sha224_hasher, 192U, 224U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha224_hmac_drbg_t = hmac_drbg<hmac<sha224_hasher>, 192U, 224U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha224_hash_drbg = drbg_detail::sha224_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha224_hash_drbg_pr = drbg_detail::sha224_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha224_hmac_drbg = drbg_detail::sha224_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha224_hmac_drbg_pr = drbg_detail::sha224_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT2_DRBG_SHA224_DRBG_HPP

include/boost/crypt2/drbg/sha256_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA256_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha256.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha256_hash_drbg_t = hash_drbg<sha256_hasher, 256U, 256U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha256_hmac_drbg_t = hmac_drbg<hmac<sha256_hasher>, 256U, 256U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha256_hash_drbg = drbg_detail::sha256_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha256_hash_drbg_pr = drbg_detail::sha256_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha256_hmac_drbg = drbg_detail::sha256_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha256_hmac_drbg_pr = drbg_detail::sha256_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT2_DRBG_SHA256_DRBG_HPP

include/boost/crypt2/drbg/sha384_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA384_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha384.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha384_hash_drbg_t = hash_drbg<sha384_hasher, 256U, 384U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha384_hmac_drbg_t = hmac_drbg<hmac<sha384_hasher>, 256U, 384U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha384_hash_drbg = drbg_detail::sha384_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha384_hash_drbg_pr = drbg_detail::sha384_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha384_hmac_drbg = drbg_detail::sha384_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha384_hmac_drbg_pr = drbg_detail::sha384_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT2_DRBG_SHA384_DRBG_HPP

include/boost/crypt2/drbg/sha3_224_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA3_224_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha3_224.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha3_224_hash_drbg_t = hash_drbg<sha3_224_hasher, 192U, 224U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha3_224_hmac_drbg_t = hmac_drbg<hmac<sha3_224_hasher>, 192U, 224U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha3_224_hash_drbg = drbg_detail::sha3_224_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha3_224_hash_drbg_pr = drbg_detail::sha3_224_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha3_224_hmac_drbg = drbg_detail::sha3_224_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha3_224_hmac_drbg_pr = drbg_detail::sha3_224_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT_DRBG_SHA3_224_DRBG_HPP

include/boost/crypt2/drbg/sha3_256_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA3_256_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha3_256.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha3_256_hash_drbg_t = hash_drbg<sha3_256_hasher, 256U, 256U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha3_256_hmac_drbg_t = hmac_drbg<hmac<sha3_256_hasher>, 256U, 256U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha3_256_hash_drbg = drbg_detail::sha3_256_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha3_256_hash_drbg_pr = drbg_detail::sha3_256_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha3_256_hmac_drbg = drbg_detail::sha3_256_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha3_256_hmac_drbg_pr = drbg_detail::sha3_256_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT_DRBG_SHA3_256_DRBG_HPP

include/boost/crypt2/drbg/sha3_384_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA3_384_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha3_384.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha3_384_hash_drbg_t = hash_drbg<sha3_384_hasher, 256U, 384U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha3_384_hmac_drbg_t = hmac_drbg<hmac<sha3_384_hasher>, 256U, 384U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha3_384_hash_drbg = drbg_detail::sha3_384_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha3_384_hash_drbg_pr = drbg_detail::sha3_384_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha3_384_hmac_drbg = drbg_detail::sha3_384_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha3_384_hmac_drbg_pr = drbg_detail::sha3_384_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT_DRBG_SHA3_384_DRBG_HPP

include/boost/crypt2/drbg/sha3_512_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA3_512_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha3_512.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha3_512_hash_drbg_t = hash_drbg<sha3_512_hasher, 256U, 512U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha3_512_hmac_drbg_t = hmac_drbg<hmac<sha3_512_hasher>, 256U, 512U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha3_512_hash_drbg = drbg_detail::sha3_512_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha3_512_hash_drbg_pr = drbg_detail::sha3_512_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha3_512_hmac_drbg = drbg_detail::sha3_512_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha3_512_hmac_drbg_pr = drbg_detail::sha3_512_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT_DRBG_SHA3_512_DRBG_HPP

include/boost/crypt2/drbg/sha512_224_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA512_224_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha512_224.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha512_224_hash_drbg_t = hash_drbg<sha512_224_hasher, 192U, 224U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha512_224_hmac_drbg_t = hmac_drbg<hmac<sha512_224_hasher>, 192U, 224U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha512_224_hash_drbg = drbg_detail::sha512_224_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha512_224_hash_drbg_pr = drbg_detail::sha512_224_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha512_224_hmac_drbg = drbg_detail::sha512_224_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha512_224_hmac_drbg_pr = drbg_detail::sha512_224_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT2_DRBG_SHA512_224_DRBG_HPP

include/boost/crypt2/drbg/sha512_256_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA512_256_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha512_256.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha512_256_hash_drbg_t = hash_drbg<sha512_256_hasher, 256U, 256U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha512_256_hmac_drbg_t = hmac_drbg<hmac<sha512_256_hasher>, 256U, 256U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha512_256_hash_drbg = drbg_detail::sha512_256_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha512_256_hash_drbg_pr = drbg_detail::sha512_256_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha512_256_hmac_drbg = drbg_detail::sha512_256_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha512_256_hmac_drbg_pr = drbg_detail::sha512_256_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT2_DRBG_SHA512_256_DRBG_HPP

include/boost/crypt2/drbg/sha512_drbg.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BOOST_CRYPT2_DRBG_SHA512_DRBG_HPP
77

88
#include <boost/crypt2/drbg/detail/hash_drbg.hpp>
9+
#include <boost/crypt2/drbg/detail/hmac_drbg.hpp>
10+
#include <boost/crypt2/mac/hmac.hpp>
911
#include <boost/crypt2/hash/sha512.hpp>
1012

1113
namespace boost::crypt {
@@ -15,11 +17,17 @@ namespace drbg_detail {
1517
template <bool prediction_resistance>
1618
using sha512_hash_drbg_t = hash_drbg<sha512_hasher, 256U, 512U, prediction_resistance>;
1719

20+
template <bool prediction_resistance>
21+
using sha512_hmac_drbg_t = hmac_drbg<hmac<sha512_hasher>, 256U, 512U, prediction_resistance>;
22+
1823
} // namespace drbg_detail
1924

2025
BOOST_CRYPT_EXPORT using sha512_hash_drbg = drbg_detail::sha512_hash_drbg_t<false>;
2126
BOOST_CRYPT_EXPORT using sha512_hash_drbg_pr = drbg_detail::sha512_hash_drbg_t<true>;
2227

28+
BOOST_CRYPT_EXPORT using sha512_hmac_drbg = drbg_detail::sha512_hmac_drbg_t<false>;
29+
BOOST_CRYPT_EXPORT using sha512_hmac_drbg_pr = drbg_detail::sha512_hmac_drbg_t<true>;
30+
2331
} // namespace boost::crypt
2432

2533
#endif // BOOST_CRYPT2_DRBG_SHA512_DRBG_HPP

0 commit comments

Comments
 (0)