aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng/hmac_drbg/hmac_drbg.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-03-12 11:48:27 +0000
committerlloyd <[email protected]>2015-03-12 11:48:27 +0000
commitff26efb1c4b8530024dc9b42d75e39536ece6e11 (patch)
tree8f76ffab672673222b1c2bd8121c40fa2d765e62 /src/lib/rng/hmac_drbg/hmac_drbg.h
parenta06d7288968e205ca5f4df7cb3fcb3914353fb5f (diff)
Externalize the state of a RFC 6979 nonce computation.
This lets you amortize quite a few memory allocations (RNG, various BigInts, etc) over many nonce generations. Change generate_rfc6979_nonce to just instantiate one of these states, call the function once, and return. This doesn't have any additional overhead versus the previous implementation of this function. Fix HMAC_DRBG to correctly reset its state to its starting position when you call clear() on it.
Diffstat (limited to 'src/lib/rng/hmac_drbg/hmac_drbg.h')
-rw-r--r--src/lib/rng/hmac_drbg/hmac_drbg.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/rng/hmac_drbg/hmac_drbg.h b/src/lib/rng/hmac_drbg/hmac_drbg.h
index b56e90fc4..979b754b2 100644
--- a/src/lib/rng/hmac_drbg/hmac_drbg.h
+++ b/src/lib/rng/hmac_drbg/hmac_drbg.h
@@ -1,6 +1,6 @@
/*
* HMAC_DRBG (SP800-90A)
-* (C) 2014 Jack Lloyd
+* (C) 2014,2015 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
@@ -33,7 +33,7 @@ class BOTAN_DLL HMAC_DRBG : public RandomNumberGenerator
* @param underlying_rng RNG used generating inputs (eg HMAC_RNG)
*/
HMAC_DRBG(MessageAuthenticationCode* mac,
- RandomNumberGenerator* underlying_rng);
+ RandomNumberGenerator* underlying_rng = nullptr);
private:
void update(const byte input[], size_t input_len);