aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng/randpool/randpool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rng/randpool/randpool.cpp')
-rw-r--r--src/rng/randpool/randpool.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rng/randpool/randpool.cpp b/src/rng/randpool/randpool.cpp
index f9e05c246..77a5228c6 100644
--- a/src/rng/randpool/randpool.cpp
+++ b/src/rng/randpool/randpool.cpp
@@ -105,12 +105,15 @@ void Randpool::reseed(u32bit poll_bits)
{
Entropy_Accumulator_BufferedComputation accum(*mac, poll_bits);
- for(u32bit i = 0; i != entropy_sources.size(); ++i)
+ if(!entropy_sources.empty())
{
- entropy_sources[i]->poll(accum);
+ u32bit poll_attempt = 0;
- if(accum.polling_goal_achieved())
- break;
+ while(!accum.polling_goal_achieved() && poll_attempt < poll_bits)
+ {
+ entropy_sources[poll_attempt % entropy_sources.size()]->poll(accum);
+ ++poll_attempt;
+ }
}
SecureVector<byte> mac_val = mac->final();