aboutsummaryrefslogtreecommitdiffstats
path: root/src/entropy/proc_walk/es_ftw.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-21 23:57:47 +0000
committerlloyd <[email protected]>2008-11-21 23:57:47 +0000
commitb4dab19af8894d8a79ecc3dffeed5ca39f740b5a (patch)
treece6a1755b4a9a96f6ea7acec433a422f5c1e34d3 /src/entropy/proc_walk/es_ftw.h
parent518eecd2718fecef6b545dd783156976cc1b9e76 (diff)
Last minute es_ftw optimizations / logic changes. Performance of seeding
was too slow, it was noticably slowing down AutoSeeded_RNG. Reduce the amount of output gathered to 32 times the size of the output buffer, and instead of using Buffered_EntropySource, just xor the read file data directly into the output buffer. Read up to 4096 bytes per file, but only count the first 128 towards the total goal (/proc/config.gz being a major culprit - large, random looking, and entirely or almost static).
Diffstat (limited to 'src/entropy/proc_walk/es_ftw.h')
-rw-r--r--src/entropy/proc_walk/es_ftw.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/entropy/proc_walk/es_ftw.h b/src/entropy/proc_walk/es_ftw.h
index a0d480aae..5b127943f 100644
--- a/src/entropy/proc_walk/es_ftw.h
+++ b/src/entropy/proc_walk/es_ftw.h
@@ -6,18 +6,21 @@
#ifndef BOTAN_ENTROPY_SRC_FTW_H__
#define BOTAN_ENTROPY_SRC_FTW_H__
-#include <botan/buf_es.h>
+#include <botan/entropy_src.h>
namespace Botan {
/*************************************************
* File Tree Walking Entropy Source *
*************************************************/
-class BOTAN_DLL FTW_EntropySource : public Buffered_EntropySource
+class BOTAN_DLL FTW_EntropySource : public EntropySource
{
public:
std::string name() const { return "Proc Walker"; }
+ u32bit slow_poll(byte buf[], u32bit len);
+ u32bit fast_poll(byte buf[], u32bit len);
+
FTW_EntropySource(const std::string& root_dir);
~FTW_EntropySource();
@@ -28,12 +31,8 @@ class BOTAN_DLL FTW_EntropySource : public Buffered_EntropySource
virtual ~File_Descriptor_Source() {}
};
private:
- void do_fast_poll();
- void do_slow_poll();
-
- void poll(u32bit max_read);
- const std::string path;
+ std::string path;
File_Descriptor_Source* dir;
};