From 25d7b7aa9e9896df45f12fa59db4c44411bc21f0 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 11 Nov 2008 19:08:06 +0000 Subject: Use cache in Algorithm_Factory for ciphers --- src/algo_factory/algo_factory.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/algo_factory/algo_factory.h') 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 providers_of(const SCAN_Name& request); + std::vector 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 engines; + + Algorithm_Cache block_cipher_cache; + Algorithm_Cache stream_cipher_cache; Algorithm_Cache hash_cache; + Algorithm_Cache mac_cache; }; } -- cgit v1.2.3