aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/rng/hmac_rng/hmac_rng.cpp15
-rw-r--r--src/rng/randpool/randpool.cpp7
-rw-r--r--src/rng/x931_rng/x931_rng.cpp2
3 files changed, 4 insertions, 20 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"
diff --git a/src/rng/randpool/randpool.cpp b/src/rng/randpool/randpool.cpp
index 594916a84..1a111e20e 100644
--- a/src/rng/randpool/randpool.cpp
+++ b/src/rng/randpool/randpool.cpp
@@ -31,12 +31,7 @@ enum RANDPOOL_PRF_TAG {
void Randpool::randomize(byte out[], u32bit length)
{
if(!is_seeded())
- {
- reseed(8 * mac->OUTPUT_LENGTH);
-
- if(!is_seeded())
- throw PRNG_Unseeded(name());
- }
+ throw PRNG_Unseeded(name());
update_buffer();
while(length)
diff --git a/src/rng/x931_rng/x931_rng.cpp b/src/rng/x931_rng/x931_rng.cpp
index b947f525d..4b33f4c5e 100644
--- a/src/rng/x931_rng/x931_rng.cpp
+++ b/src/rng/x931_rng/x931_rng.cpp
@@ -15,7 +15,7 @@ namespace Botan {
void ANSI_X931_RNG::randomize(byte out[], u32bit length)
{
if(!is_seeded())
- reseed(8 * cipher->BLOCK_SIZE);
+ throw PRNG_Unseeded(name());
while(length)
{