aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng/auto_rng/auto_rng.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-01-31 12:30:31 +0000
committerlloyd <[email protected]>2009-01-31 12:30:31 +0000
commitb118c41af387f765effcca47c08fc2dcc3844778 (patch)
tree5b63b0ee31cdb8226249e3488b065e51ddfc18e3 /src/rng/auto_rng/auto_rng.cpp
parent3f5c33c9ece2e7373dde96af045cd5a4853697be (diff)
parentf985e438ca768e59626ff08b143a6c80cf671b9e (diff)
propagate from branch 'net.randombit.botan' (head 4518ef63a5e28e22a61d21a6066d0d4a5cf0616e)
to branch 'net.randombit.botan.entropy-poll-redesign' (head c8e07f10a193b25bab726af99ea2ea77a0f30eaf)
Diffstat (limited to 'src/rng/auto_rng/auto_rng.cpp')
-rw-r--r--src/rng/auto_rng/auto_rng.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/rng/auto_rng/auto_rng.cpp b/src/rng/auto_rng/auto_rng.cpp
index 845d958e2..620cc1f61 100644
--- a/src/rng/auto_rng/auto_rng.cpp
+++ b/src/rng/auto_rng/auto_rng.cpp
@@ -76,19 +76,15 @@ namespace {
*/
void add_entropy_sources(RandomNumberGenerator* rng)
{
+
+ // Add a high resolution timer, if available
#if defined(BOTAN_HAS_TIMER_HARDWARE)
rng->add_entropy_source(new Hardware_Timer);
-#endif
-
-#if defined(BOTAN_HAS_TIMER_POSIX)
+#elif defined(BOTAN_HAS_TIMER_POSIX)
rng->add_entropy_source(new POSIX_Timer);
-#endif
-
-#if defined(BOTAN_HAS_TIMER_UNIX)
+#elif defined(BOTAN_HAS_TIMER_UNIX)
rng->add_entropy_source(new Unix_Timer);
-#endif
-
-#if defined(BOTAN_HAS_TIMER_WIN32)
+#elif defined(BOTAN_HAS_TIMER_WIN32)
rng->add_entropy_source(new Win32_Timer);
#endif
@@ -114,7 +110,6 @@ void add_entropy_sources(RandomNumberGenerator* rng)
rng->add_entropy_source(new FTW_EntropySource("/proc"));
#endif
-
#if defined(BOTAN_HAS_ENTROPY_SRC_WIN32)
rng->add_entropy_source(new Win32_EntropySource);
#endif
@@ -132,7 +127,7 @@ void add_entropy_sources(RandomNumberGenerator* rng)
}
-AutoSeeded_RNG::AutoSeeded_RNG()
+AutoSeeded_RNG::AutoSeeded_RNG(u32bit poll_bits)
{
rng = 0;
@@ -152,7 +147,7 @@ AutoSeeded_RNG::AutoSeeded_RNG()
add_entropy_sources(rng);
- rng->reseed();
+ rng->reseed(poll_bits);
}
}