aboutsummaryrefslogtreecommitdiffstats
path: root/include/buf_es.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-18 18:33:19 +0000
committerlloyd <[email protected]>2006-05-18 18:33:19 +0000
commita2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch)
treead3d6c4fcc8dd0f403f8105598943616246fe172 /include/buf_es.h
Initial checkin1.5.6
Diffstat (limited to 'include/buf_es.h')
-rw-r--r--include/buf_es.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/buf_es.h b/include/buf_es.h
new file mode 100644
index 000000000..cb8057314
--- /dev/null
+++ b/include/buf_es.h
@@ -0,0 +1,39 @@
+/*************************************************
+* Buffered EntropySource Header File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#ifndef BOTAN_BUFFERED_ES_H__
+#define BOTAN_BUFFERED_ES_H__
+
+#include <botan/base.h>
+
+namespace Botan {
+
+/*************************************************
+* Buffered EntropySource *
+*************************************************/
+class Buffered_EntropySource : public EntropySource
+ {
+ public:
+ u32bit slow_poll(byte[], u32bit);
+ u32bit fast_poll(byte[], u32bit);
+ protected:
+ Buffered_EntropySource();
+ u32bit copy_out(byte[], u32bit, u32bit);
+
+ void add_bytes(const void*, u32bit);
+ void add_bytes(u64bit);
+ void add_timestamp();
+
+ virtual void do_slow_poll() = 0;
+ virtual void do_fast_poll();
+ private:
+ SecureVector<byte> buffer;
+ u32bit write_pos, read_pos;
+ bool done_slow_poll;
+ };
+
+}
+
+#endif