aboutsummaryrefslogtreecommitdiffstats
path: root/src/algo_factory
diff options
context:
space:
mode:
Diffstat (limited to 'src/algo_factory')
-rw-r--r--src/algo_factory/algo_factory.cpp10
-rw-r--r--src/algo_factory/algo_factory.h9
2 files changed, 12 insertions, 7 deletions
diff --git a/src/algo_factory/algo_factory.cpp b/src/algo_factory/algo_factory.cpp
index ad8b1215f..030a32b9f 100644
--- a/src/algo_factory/algo_factory.cpp
+++ b/src/algo_factory/algo_factory.cpp
@@ -83,11 +83,8 @@ const T* factory_prototype(const std::string& algo_spec,
/**
* Setup caches
*/
-Algorithm_Factory::Algorithm_Factory(const std::vector<Engine*>& engines_in,
- Mutex_Factory& mf)
+Algorithm_Factory::Algorithm_Factory(Mutex_Factory& mf)
{
- engines = engines_in;
-
block_cipher_cache = new Algorithm_Cache<BlockCipher>(mf.make());
stream_cipher_cache = new Algorithm_Cache<StreamCipher>(mf.make());
hash_cache = new Algorithm_Cache<HashFunction>(mf.make());
@@ -107,6 +104,11 @@ Algorithm_Factory::~Algorithm_Factory()
delete mac_cache;
}
+void Algorithm_Factory::add_engine(Engine* engine)
+ {
+ engines.push_back(engine);
+ }
+
/**
* Set the preferred provider for an algorithm
*/
diff --git a/src/algo_factory/algo_factory.h b/src/algo_factory/algo_factory.h
index 3b479c2d7..0b630c721 100644
--- a/src/algo_factory/algo_factory.h
+++ b/src/algo_factory/algo_factory.h
@@ -35,11 +35,9 @@ class BOTAN_DLL Algorithm_Factory
public:
/**
* Constructor
- * @param engines_in the list of engines to use
* @param mf a mutex factory
*/
- Algorithm_Factory(const std::vector<Engine*>& engines_in,
- Mutex_Factory& mf);
+ Algorithm_Factory(Mutex_Factory& mf);
/**
* Destructor
@@ -47,6 +45,11 @@ class BOTAN_DLL Algorithm_Factory
~Algorithm_Factory();
/**
+ * @param engine to add (Algorithm_Factory takes ownership)
+ */
+ void add_engine(class Engine* engine);
+
+ /**
* @param algo_spec the algorithm we are querying
* @returns list of providers of this algorithm
*/