aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-04-07 01:41:17 +0000
committerlloyd <[email protected]>2008-04-07 01:41:17 +0000
commita48d895cf5e6874f4ae60c803bda17d62edb7a7b (patch)
tree2a9531c1ee40403b5a0ff218280bbbe6c9cb2db9 /include
parentd4121aee5eeab8328bb6a59ba0c2f16e2d3a72fa (diff)
In Botan, the Timer base class provides access to a high-resolution
timer with an unspecified update rate and epoch. It is only used inside the entropy sources to provide some timing-dependent randomness. However, it is easier and basically 'as good' to treat the timers as entropy sources in their own right and feed their output directly into an entropy pool. This commit removes Library_State::system_clock and all calls to that function.
Diffstat (limited to 'include')
-rw-r--r--include/buf_es.h1
-rw-r--r--include/libstate.h3
-rw-r--r--include/modules.h2
-rw-r--r--include/timers.h6
-rw-r--r--include/util.h3
5 files changed, 5 insertions, 10 deletions
diff --git a/include/buf_es.h b/include/buf_es.h
index 53749d25a..8c0312c77 100644
--- a/include/buf_es.h
+++ b/include/buf_es.h
@@ -24,7 +24,6 @@ class Buffered_EntropySource : public EntropySource
void add_bytes(const void*, u32bit);
void add_bytes(u64bit);
- void add_timestamp();
virtual void do_slow_poll() = 0;
virtual void do_fast_poll();
diff --git a/include/libstate.h b/include/libstate.h
index 312d68873..dc9835799 100644
--- a/include/libstate.h
+++ b/include/libstate.h
@@ -55,8 +55,6 @@ class Library_State
void add_entropy(EntropySource&, bool);
u32bit seed_prng(bool, u32bit);
- u64bit system_clock() const;
-
class Config& config() const;
class Mutex* get_mutex() const;
@@ -78,7 +76,6 @@ class Library_State
class Mutex* engine_lock;
class Mutex* rng_lock;
- class Timer* timer;
mutable class Config* config_obj;
class X509_GlobalState* x509_state_obj;
diff --git a/include/modules.h b/include/modules.h
index 1ec76478c..a5036ded3 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -19,7 +19,6 @@ class Modules
{
public:
virtual class Mutex_Factory* mutex_factory() const = 0;
- virtual class Timer* timer() const = 0;
virtual class Charset_Transcoder* transcoder() const = 0;
virtual std::string default_allocator() const = 0;
@@ -38,7 +37,6 @@ class Builtin_Modules : public Modules
{
public:
class Mutex_Factory* mutex_factory() const;
- class Timer* timer() const;
class Charset_Transcoder* transcoder() const;
std::string default_allocator() const;
diff --git a/include/timers.h b/include/timers.h
index 9c836f064..676d7bbd2 100644
--- a/include/timers.h
+++ b/include/timers.h
@@ -6,17 +6,19 @@
#ifndef BOTAN_TIMERS_H__
#define BOTAN_TIMERS_H__
-#include <botan/types.h>
+#include <botan/base.h>
namespace Botan {
/*************************************************
* Timer Interface *
*************************************************/
-class Timer
+class Timer : public EntropySource
{
public:
virtual u64bit clock() const;
+ u32bit slow_poll(byte[], u32bit);
+
virtual ~Timer() {}
protected:
static u64bit combine_timers(u32bit, u32bit, u32bit);
diff --git a/include/util.h b/include/util.h
index 2d9a70433..8cede5de9 100644
--- a/include/util.h
+++ b/include/util.h
@@ -11,10 +11,9 @@
namespace Botan {
/*************************************************
-* Timer Access Functions *
+* Time Access Functions *
*************************************************/
u64bit system_time();
-u64bit system_clock();
/*************************************************
* Memory Locking Functions *