aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng
diff options
context:
space:
mode:
Diffstat (limited to 'src/rng')
-rw-r--r--src/rng/auto_rng/auto_rng.cpp29
-rw-r--r--src/rng/auto_rng/info.txt1
-rw-r--r--src/rng/randpool/randpool.cpp4
3 files changed, 4 insertions, 30 deletions
diff --git a/src/rng/auto_rng/auto_rng.cpp b/src/rng/auto_rng/auto_rng.cpp
index f02a9249f..6906d9d17 100644
--- a/src/rng/auto_rng/auto_rng.cpp
+++ b/src/rng/auto_rng/auto_rng.cpp
@@ -7,7 +7,6 @@
#include <botan/auto_rng.h>
#include <botan/parsing.h>
-#include <botan/timer.h>
#include <botan/hmac.h>
#include <botan/sha2_32.h>
#include <botan/sha2_64.h>
@@ -28,20 +27,8 @@
#include <botan/aes.h>
#endif
-#if defined(BOTAN_HAS_TIMER_HARDWARE)
- #include <botan/tm_hard.h>
-#endif
-
-#if defined(BOTAN_HAS_TIMER_POSIX)
- #include <botan/tm_posix.h>
-#endif
-
-#if defined(BOTAN_HAS_TIMER_UNIX)
- #include <botan/tm_unix.h>
-#endif
-
-#if defined(BOTAN_HAS_TIMER_WIN32)
- #include <botan/tm_win32.h>
+#if defined(BOTAN_HAS_ENTROPY_SRC_HIGH_RESOLUTION_TIMER)
+ #include <botan/hres_timer.h>
#endif
#if defined(BOTAN_HAS_ENTROPY_SRC_DEVICE)
@@ -81,16 +68,8 @@ 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);
-#elif defined(BOTAN_HAS_TIMER_POSIX)
- rng->add_entropy_source(new POSIX_Timer);
-#elif defined(BOTAN_HAS_TIMER_UNIX)
- rng->add_entropy_source(new Unix_Timer);
-#elif defined(BOTAN_HAS_TIMER_WIN32)
- rng->add_entropy_source(new Win32_Timer);
+#if defined(BOTAN_HAS_ENTROPY_SRC_HIGH_RESOLUTION_TIMER)
+ rng->add_entropy_source(new High_Resolution_Timestamp);
#endif
#if defined(BOTAN_HAS_ENTROPY_SRC_DEVICE)
diff --git a/src/rng/auto_rng/info.txt b/src/rng/auto_rng/info.txt
index d5abfc757..357dc17ad 100644
--- a/src/rng/auto_rng/info.txt
+++ b/src/rng/auto_rng/info.txt
@@ -10,5 +10,4 @@ auto_rng.cpp
<requires>
hmac
sha2
-timer
</requires>
diff --git a/src/rng/randpool/randpool.cpp b/src/rng/randpool/randpool.cpp
index fb51db300..8f9a16edc 100644
--- a/src/rng/randpool/randpool.cpp
+++ b/src/rng/randpool/randpool.cpp
@@ -8,7 +8,6 @@
#include <botan/randpool.h>
#include <botan/loadstor.h>
#include <botan/xor_buf.h>
-#include <botan/timer.h>
#include <botan/stl_util.h>
#include <algorithm>
@@ -51,12 +50,9 @@ void Randpool::randomize(byte out[], u32bit length)
*/
void Randpool::update_buffer()
{
- const u64bit timestamp = system_time();
-
for(u32bit i = 0; i != counter.size(); ++i)
if(++counter[i])
break;
- store_be(timestamp, counter + 4);
mac->update(static_cast<byte>(GEN_OUTPUT));
mac->update(counter, counter.size());