aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libstate.h4
-rw-r--r--include/modules.h27
2 files changed, 21 insertions, 10 deletions
diff --git a/include/libstate.h b/include/libstate.h
index 6b4c2cac1..a7972b7b3 100644
--- a/include/libstate.h
+++ b/include/libstate.h
@@ -35,11 +35,13 @@ class Library_State
void set_prng(RandomNumberGenerator*);
void randomize(byte[], u32bit);
- void add_entropy_source(EntropySource*, bool = false);
+ void add_entropy_source(EntropySource*, bool = true);
void add_entropy(const byte[], u32bit);
void add_entropy(EntropySource&, bool);
u32bit seed_prng(bool, u32bit);
+ void load(class Modules&);
+
void set_timer(class Timer*);
u64bit system_clock() const;
diff --git a/include/modules.h b/include/modules.h
index 48aeb11fb..81de52faf 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -6,6 +6,9 @@
#ifndef BOTAN_MODULE_FACTORIES_H__
#define BOTAN_MODULE_FACTORIES_H__
+#include <string>
+#include <vector>
+
namespace Botan {
/*************************************************
@@ -14,14 +17,14 @@ namespace Botan {
class Modules
{
public:
- void load(class Library_State&) const;
+ virtual class Mutex_Factory* mutex_factory() const = 0;
+ virtual class Timer* timer() const = 0;
- virtual class Mutex_Factory* mutex_factory() const { return 0; }
- virtual class Timer* timer() const { return 0; }
+ virtual std::string default_allocator() const = 0;
- virtual void set_allocators(class Library_State&, bool) const {}
- virtual void set_entropy_sources(class Library_State&) const {}
- virtual void set_engines(class Library_State&, bool) const {}
+ virtual std::vector<class Allocator*> allocators() const = 0;
+ virtual std::vector<class EntropySource*> entropy_sources() const = 0;
+ virtual std::vector<class Engine*> engines() const = 0;
virtual ~Modules() {}
};
@@ -35,9 +38,15 @@ class Builtin_Modules : public Modules
class Mutex_Factory* mutex_factory() const;
class Timer* timer() const;
- void set_allocators(class Library_State&, bool) const;
- void set_entropy_sources(class Library_State&) const;
- void set_engines(class Library_State&, bool) const;
+ std::string default_allocator() const;
+
+ std::vector<class Allocator*> allocators() const;
+ std::vector<class EntropySource*> entropy_sources() const;
+ std::vector<class Engine*> engines() const;
+
+ Builtin_Modules(bool sl) : should_lock(sl) {}
+ private:
+ const bool should_lock;
};
}