diff options
author | Jack Lloyd <[email protected]> | 2016-07-06 14:09:55 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-07-17 10:43:42 -0400 |
commit | 8f2f800c7ea841fa5ab963349178ac3a9f56a513 (patch) | |
tree | 6bfd690f9add2e5196f5c2cb4556407332091329 /src/lib/rng/hmac_drbg | |
parent | d7864303e89a5e04294f8efd1d0e4ac26a1491e5 (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/hmac_drbg')
-rw-r--r-- | src/lib/rng/hmac_drbg/hmac_drbg.cpp | 8 | ||||
-rw-r--r-- | src/lib/rng/hmac_drbg/hmac_drbg.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/rng/hmac_drbg/hmac_drbg.cpp b/src/lib/rng/hmac_drbg/hmac_drbg.cpp index 6fdd7daf9..7325804e3 100644 --- a/src/lib/rng/hmac_drbg/hmac_drbg.cpp +++ b/src/lib/rng/hmac_drbg/hmac_drbg.cpp @@ -11,8 +11,8 @@ namespace Botan { HMAC_DRBG::HMAC_DRBG(MessageAuthenticationCode* hmac, - size_t max_bytes_before_reseed) : - Stateful_RNG(max_bytes_before_reseed), + size_t max_output_before_reseed) : + Stateful_RNG(max_output_before_reseed), m_mac(hmac) { m_V.resize(m_mac->output_length()); @@ -20,8 +20,8 @@ HMAC_DRBG::HMAC_DRBG(MessageAuthenticationCode* hmac, } HMAC_DRBG::HMAC_DRBG(const std::string& hmac_hash, - size_t max_bytes_before_reseed) : - Stateful_RNG(max_bytes_before_reseed) + size_t max_output_before_reseed) : + Stateful_RNG(max_output_before_reseed) { const std::string hmac = "HMAC(" + hmac_hash + ")"; diff --git a/src/lib/rng/hmac_drbg/hmac_drbg.h b/src/lib/rng/hmac_drbg/hmac_drbg.h index 8ee598470..0e294dbdb 100644 --- a/src/lib/rng/hmac_drbg/hmac_drbg.h +++ b/src/lib/rng/hmac_drbg/hmac_drbg.h @@ -23,10 +23,10 @@ class BOTAN_DLL HMAC_DRBG final : public Stateful_RNG * Initialize an HMAC_DRBG instance with the given hash function */ HMAC_DRBG(const std::string& hmac_hash, - size_t max_bytes_before_reseed = BOTAN_RNG_MAX_OUTPUT_BEFORE_RESEED); + size_t max_output_before_reseed = BOTAN_RNG_DEFAULT_MAX_OUTPUT_BEFORE_RESEED); HMAC_DRBG(MessageAuthenticationCode* hmac, - size_t max_bytes_before_reseed = BOTAN_RNG_MAX_OUTPUT_BEFORE_RESEED); + size_t max_output_before_reseed = BOTAN_RNG_DEFAULT_MAX_OUTPUT_BEFORE_RESEED); std::string name() const override; |