aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng/rng.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-07-06 14:09:55 -0400
committerJack Lloyd <[email protected]>2016-07-17 10:43:42 -0400
commit8f2f800c7ea841fa5ab963349178ac3a9f56a513 (patch)
tree6bfd690f9add2e5196f5c2cb4556407332091329 /src/lib/rng/rng.cpp
parentd7864303e89a5e04294f8efd1d0e4ac26a1491e5 (diff)
Address some review comments from @cordney
Use consistent naming for the max output before reseed parameter. The constant (default) value is renamed to BOTAN_RNG_DEFAULT_MAX_OUTPUT_BEFORE_RESEED, since without the DEFAULT_ it reads like a compile time maximum instead. Use uint8_t instead of byte.
Diffstat (limited to 'src/lib/rng/rng.cpp')
-rw-r--r--src/lib/rng/rng.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/rng/rng.cpp b/src/lib/rng/rng.cpp
index 923b417dc..5501c143e 100644
--- a/src/lib/rng/rng.cpp
+++ b/src/lib/rng/rng.cpp
@@ -42,7 +42,7 @@ size_t RandomNumberGenerator::reseed_with_sources(Entropy_Sources& srcs,
return srcs.poll(*this, poll_bits, poll_timeout);
}
-Stateful_RNG::Stateful_RNG(size_t bytes_before_reseed) : m_bytes_before_reseed(bytes_before_reseed)
+Stateful_RNG::Stateful_RNG(size_t max_output_before_reseed) : m_max_output_before_reseed(max_output_before_reseed)
{
}
@@ -79,7 +79,7 @@ void Stateful_RNG::reseed_check(size_t bytes_requested)
{
this->reseed(BOTAN_RNG_RESEED_POLL_BITS);
}
- else if(m_bytes_before_reseed > 0 && m_bytes_since_reseed >= m_bytes_before_reseed)
+ else if(m_max_output_before_reseed > 0 && m_bytes_since_reseed >= m_max_output_before_reseed)
{
this->reseed_with_timeout(BOTAN_RNG_RESEED_POLL_BITS,
BOTAN_RNG_AUTO_RESEED_TIMEOUT);
@@ -107,9 +107,9 @@ RandomNumberGenerator* RandomNumberGenerator::make_rng()
return new AutoSeeded_RNG;
}
-AutoSeeded_RNG::AutoSeeded_RNG(size_t max_bytes_before_reseed)
+AutoSeeded_RNG::AutoSeeded_RNG(size_t max_output_before_reseed)
{
- m_rng.reset(new BOTAN_AUTO_RNG_DRBG(BOTAN_AUTO_RNG_HASH, max_bytes_before_reseed));
+ m_rng.reset(new BOTAN_AUTO_RNG_DRBG(BOTAN_AUTO_RNG_HASH, max_output_before_reseed));
size_t bits = m_rng->reseed(BOTAN_AUTO_RNG_ENTROPY_TARGET);