diff options
author | lloyd <[email protected]> | 2008-11-11 19:08:06 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-11 19:08:06 +0000 |
commit | 25d7b7aa9e9896df45f12fa59db4c44411bc21f0 (patch) | |
tree | c7ef12dbca65449bde6d4f5183dc2f400914e426 /src/algo_factory/algo_factory.h | |
parent | 1954e73dbf4e4984d33a45d6ce05ee5aecb84714 (diff) |
Use cache in Algorithm_Factory for ciphers
Diffstat (limited to 'src/algo_factory/algo_factory.h')
-rw-r--r-- | src/algo_factory/algo_factory.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/algo_factory/algo_factory.h b/src/algo_factory/algo_factory.h index 2bbfde7d1..64b2128ec 100644 --- a/src/algo_factory/algo_factory.h +++ b/src/algo_factory/algo_factory.h @@ -45,35 +45,39 @@ class BOTAN_DLL Algorithm_Factory }; friend class Engine_Iterator; - std::vector<std::string> providers_of(const SCAN_Name& request); + std::vector<std::string> providers_of(const std::string& algo_spec); // Block cipher operations const BlockCipher* prototype_block_cipher(const SCAN_Name& request); BlockCipher* make_block_cipher(const SCAN_Name& request); - void add_block_cipher(BlockCipher* hash); + void add_block_cipher(BlockCipher* hash, const std::string& provider); // Stream cipher operations const StreamCipher* prototype_stream_cipher(const SCAN_Name& request); StreamCipher* make_stream_cipher(const SCAN_Name& request); - void add_stream_cipher(StreamCipher* hash); + void add_stream_cipher(StreamCipher* hash, const std::string& provider); // Hash function operations const HashFunction* prototype_hash_function(const SCAN_Name& request); HashFunction* make_hash_function(const SCAN_Name& request); - void add_hash_function(HashFunction* hash); + void add_hash_function(HashFunction* hash, const std::string& provider); // MAC operations const MessageAuthenticationCode* prototype_mac(const SCAN_Name& request); MessageAuthenticationCode* make_mac(const SCAN_Name& request); - void add_mac(MessageAuthenticationCode* mac); - + void add_mac(MessageAuthenticationCode* mac, + const std::string& provider); private: Mutex_Factory& mutex_factory; class Engine* get_engine_n(u32bit) const; std::vector<class Engine*> engines; + + Algorithm_Cache<BlockCipher> block_cipher_cache; + Algorithm_Cache<StreamCipher> stream_cipher_cache; Algorithm_Cache<HashFunction> hash_cache; + Algorithm_Cache<MessageAuthenticationCode> mac_cache; }; } |