aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng/hmac_drbg
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-28 15:53:25 -0400
committerJack Lloyd <[email protected]>2016-10-28 15:53:35 -0400
commite70115926ffb2577736eb5fb6712f431d1438f2d (patch)
treedae600d9f9b6c0e74c8404d5e9c6f3d4983927a8 /src/lib/rng/hmac_drbg
parenta9676895238f6b5c09f275e0357070c2eab488a6 (diff)
HMAC_DRBG - Fix constructor init order. Use create_or_throw to simplify.
Diffstat (limited to 'src/lib/rng/hmac_drbg')
-rw-r--r--src/lib/rng/hmac_drbg/hmac_drbg.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/rng/hmac_drbg/hmac_drbg.h b/src/lib/rng/hmac_drbg/hmac_drbg.h
index 9210cbca2..189edbcdf 100644
--- a/src/lib/rng/hmac_drbg/hmac_drbg.h
+++ b/src/lib/rng/hmac_drbg/hmac_drbg.h
@@ -123,13 +123,10 @@ class BOTAN_DLL HMAC_DRBG final : public Stateful_RNG
* Constructor taking a string for the hash
*/
HMAC_DRBG(const std::string& hmac_hash) :
- Stateful_RNG(), m_max_number_of_bytes_per_request(64 * 1024),
- m_mac(MessageAuthenticationCode::create("HMAC(" + hmac_hash + ")"))
+ Stateful_RNG(),
+ m_mac(MessageAuthenticationCode::create_or_throw("HMAC(" + hmac_hash + ")")),
+ m_max_number_of_bytes_per_request(64 * 1024)
{
- if(!m_mac)
- {
- throw Algorithm_Not_Found(hmac_hash);
- }
clear();
}