diff options
author | lloyd <[email protected]> | 2008-11-12 21:19:47 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-12 21:19:47 +0000 |
commit | 1c7f4ac5cade236cf53598abf5c043945cbc9a8f (patch) | |
tree | b68fb295f9c01255f7a0e196d9201dbb2c4c64b6 /src/algo_factory/algo_factory.h | |
parent | 36b82adcae6e0f6b2b9e5f588f6c81477847eaaf (diff) |
Remove Library_State::add_engine and Algorithm_Factory::add_engine,
replacing with an updated constructor to Algorithm_Factory taking a
vector of Engine*. The semantics of adding engines at runtime were not
defined nor very clear, it seems best to prohibit this unless and
until it is explicitly thought through (and until a need for it
presents itself).
Diffstat (limited to 'src/algo_factory/algo_factory.h')
-rw-r--r-- | src/algo_factory/algo_factory.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/algo_factory/algo_factory.h b/src/algo_factory/algo_factory.h index fbaf26ebf..c71594ee3 100644 --- a/src/algo_factory/algo_factory.h +++ b/src/algo_factory/algo_factory.h @@ -21,6 +21,8 @@ class StreamCipher; class HashFunction; class MessageAuthenticationCode; +class Engine; + /** * Algorithm Factory */ @@ -29,20 +31,17 @@ class BOTAN_DLL Algorithm_Factory public: /** * Contructor + * @param engines the list of engines to use * @param mf a mutex factory */ - Algorithm_Factory(Mutex_Factory& mf); + Algorithm_Factory(const std::vector<Engine*>& engines, + Mutex_Factory& mf); /** * Destructor */ ~Algorithm_Factory(); - /** - * Add an engine implementation to this factory (how steampunk) - */ - void add_engine(class Engine*); - /* * Provider management */ @@ -54,37 +53,49 @@ class BOTAN_DLL Algorithm_Factory /* * Block cipher operations */ - const BlockCipher* prototype_block_cipher(const std::string& algo_spec, - const std::string& provider = ""); + const BlockCipher* + prototype_block_cipher(const std::string& algo_spec, + const std::string& provider = ""); + BlockCipher* make_block_cipher(const std::string& algo_spec, const std::string& provider = ""); + void add_block_cipher(BlockCipher* hash, const std::string& provider); /* * Stream cipher operations */ - const StreamCipher* prototype_stream_cipher(const std::string& algo_spec, - const std::string& provider = ""); + const StreamCipher* + prototype_stream_cipher(const std::string& algo_spec, + const std::string& provider = ""); + StreamCipher* make_stream_cipher(const std::string& algo_spec, const std::string& provider = ""); + void add_stream_cipher(StreamCipher* hash, const std::string& provider); /* * Hash function operations */ - const HashFunction* prototype_hash_function(const std::string& algo_spec, - const std::string& provider = ""); + const HashFunction* + prototype_hash_function(const std::string& algo_spec, + const std::string& provider = ""); + HashFunction* make_hash_function(const std::string& algo_spec, const std::string& provider = ""); + void add_hash_function(HashFunction* hash, const std::string& provider); /* * MAC operations */ - const MessageAuthenticationCode* prototype_mac(const std::string& algo_spec, - const std::string& provider = ""); + const MessageAuthenticationCode* + prototype_mac(const std::string& algo_spec, + const std::string& provider = ""); + MessageAuthenticationCode* make_mac(const std::string& algo_spec, const std::string& provider = ""); + void add_mac(MessageAuthenticationCode* mac, const std::string& provider); |