diff options
author | lloyd <[email protected]> | 2014-11-03 22:16:51 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-11-03 22:16:51 +0000 |
commit | bcd83686c3daed38974d1f9b533c07d35c5a7476 (patch) | |
tree | 3203d6f30423ebf3b7b5b3d4aa2b9ecc9ce5ba5e /src/lib/rng | |
parent | d623823e7e0d2754343ab498f48976e91180d24f (diff) |
Various small fixes and cleanups, new is_prime util
Diffstat (limited to 'src/lib/rng')
-rw-r--r-- | src/lib/rng/hmac_rng/hmac_rng.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/rng/hmac_rng/hmac_rng.cpp b/src/lib/rng/hmac_rng/hmac_rng.cpp index 7d8b54e84..153f85c80 100644 --- a/src/lib/rng/hmac_rng/hmac_rng.cpp +++ b/src/lib/rng/hmac_rng/hmac_rng.cpp @@ -95,6 +95,11 @@ void HMAC_RNG::randomize(byte out[], size_t length) const size_t max_per_prf_iter = m_prf->output_length() / 2; + m_output_since_reseed += length; + + if(m_output_since_reseed >= BOTAN_RNG_MAX_OUTPUT_BEFORE_RESEED) + reseed(BOTAN_RNG_RESEED_POLL_BITS); + /* HMAC KDF as described in E-t-E, using a CTXinfo of "rng" */ @@ -107,11 +112,6 @@ void HMAC_RNG::randomize(byte out[], size_t length) copy_mem(out, &m_K[0], copied); out += copied; length -= copied; - - m_output_since_reseed += copied; - - if(m_output_since_reseed >= BOTAN_RNG_MAX_OUTPUT_BEFORE_RESEED) - reseed(BOTAN_RNG_RESEED_POLL_BITS); } } |