aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng/hmac_rng
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-01-27 06:06:59 +0000
committerlloyd <[email protected]>2009-01-27 06:06:59 +0000
commit497e3656c1141098ab76dc0fb7922e9e9d5b6bc8 (patch)
tree70621faf857e67f18a755c915e708b7b713e40f9 /src/rng/hmac_rng
parentc055f425107cf20c1b8b7c692d5133509dfad52e (diff)
Major change in RNG semantics: you must call reseed before calling
randomize, or PRNG_Unseeded will be thrown.
Diffstat (limited to 'src/rng/hmac_rng')
-rw-r--r--src/rng/hmac_rng/hmac_rng.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/rng/hmac_rng/hmac_rng.cpp b/src/rng/hmac_rng/hmac_rng.cpp
index 245a4039e..f495dda4d 100644
--- a/src/rng/hmac_rng/hmac_rng.cpp
+++ b/src/rng/hmac_rng/hmac_rng.cpp
@@ -36,19 +36,8 @@ void hmac_prf(MessageAuthenticationCode* prf,
*/
void HMAC_RNG::randomize(byte out[], u32bit length)
{
- /* Attempt to seed if we are currently not seeded, or if the
- counter is greater than 2^20
-
- If HMAC_RNG is wrapped in an X9.31/AES PRNG (the default), this
- means a reseed will be kicked off every 16 MiB of RNG output.
- */
- if(!is_seeded() || counter >= 0x100000)
- {
- reseed(8 * prf->OUTPUT_LENGTH);
-
- if(!is_seeded())
- throw PRNG_Unseeded(name() + " seeding attempt failed");
- }
+ if(!is_seeded())
+ throw PRNG_Unseeded(name());
/*
HMAC KDF as described in E-t-E, using a CTXinfo of "rng"