diff options
Diffstat (limited to 'src/lib/engine')
-rw-r--r-- | src/lib/engine/core_engine/core_engine.h | 15 | ||||
-rw-r--r-- | src/lib/engine/core_engine/core_modes.cpp | 74 | ||||
-rw-r--r-- | src/lib/engine/core_engine/info.txt | 1 | ||||
-rw-r--r-- | src/lib/engine/dyn_engine/dyn_engine.h | 7 | ||||
-rw-r--r-- | src/lib/engine/engine.cpp | 7 | ||||
-rw-r--r-- | src/lib/engine/engine.h | 12 |
6 files changed, 0 insertions, 116 deletions
diff --git a/src/lib/engine/core_engine/core_engine.h b/src/lib/engine/core_engine/core_engine.h index 40afff515..9c914da66 100644 --- a/src/lib/engine/core_engine/core_engine.h +++ b/src/lib/engine/core_engine/core_engine.h @@ -36,9 +36,6 @@ class Core_Engine : public Engine Modular_Exponentiator* mod_exp(const BigInt& n, Power_Mod::Usage_Hints) const override; - Keyed_Filter* get_cipher(const std::string&, Cipher_Dir, - Algorithm_Factory&); - BlockCipher* find_block_cipher(const SCAN_Name&, Algorithm_Factory&) const override; @@ -55,18 +52,6 @@ class Core_Engine : public Engine Algorithm_Factory& af) const override; }; -/** -* Create a cipher mode filter object -* @param block_cipher a block cipher object -* @param direction are we encrypting or decrypting? -* @param mode the name of the cipher mode to use -* @param padding the mode padding to use (only used for ECB, CBC) -*/ -Keyed_Filter* get_cipher_mode(const BlockCipher* block_cipher, - Cipher_Dir direction, - const std::string& mode, - const std::string& padding); - } #endif diff --git a/src/lib/engine/core_engine/core_modes.cpp b/src/lib/engine/core_engine/core_modes.cpp deleted file mode 100644 index 02a55bcd6..000000000 --- a/src/lib/engine/core_engine/core_modes.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* -* Core Engine -* (C) 1999-2007,2011,2013 Jack Lloyd -* -* Botan is released under the Simplified BSD License (see license.txt) -*/ - -#include <botan/internal/core_engine.h> -#include <botan/parsing.h> -#include <botan/filters.h> -#include <botan/algo_factory.h> -#include <botan/mode_pad.h> -#include <botan/transform_filter.h> -#include <botan/cipher_mode.h> - -#if defined(BOTAN_HAS_OFB) - #include <botan/ofb.h> -#endif - -#if defined(BOTAN_HAS_CTR_BE) - #include <botan/ctr.h> -#endif - -namespace Botan { - -/* -* Get a cipher object -*/ -Keyed_Filter* Core_Engine::get_cipher(const std::string& algo_spec, - Cipher_Dir direction, - Algorithm_Factory& af) - { - std::vector<std::string> algo_parts = split_on(algo_spec, '/'); - if(algo_parts.empty()) - throw Invalid_Algorithm_Name(algo_spec); - - const std::string cipher_name = algo_parts[0]; - - // check if it is a stream cipher first (easy case) - const StreamCipher* stream_cipher = af.prototype_stream_cipher(cipher_name); - if(stream_cipher) - return new StreamCipher_Filter(stream_cipher->clone()); - - const BlockCipher* block_cipher = af.prototype_block_cipher(cipher_name); - if(!block_cipher) - return nullptr; - - if(algo_parts.size() >= 4) - return nullptr; // 4 part mode, not something we know about - - if(algo_parts.size() < 2) - throw Lookup_Error("Cipher specification '" + algo_spec + - "' is missing mode identifier"); - - const std::string mode = algo_parts[1]; - -#if defined(BOTAN_HAS_OFB) - if(mode == "OFB") - return new StreamCipher_Filter(new OFB(block_cipher->clone())); -#endif - -#if defined(BOTAN_HAS_CTR_BE) - if(mode == "CTR-BE") - return new StreamCipher_Filter(new CTR_BE(block_cipher->clone())); -#endif - - std::unique_ptr<Cipher_Mode> c(get_cipher_mode(algo_spec, direction)); - if(c) - return new Transform_Filter(c.release()); - - throw Algorithm_Not_Found(algo_spec); - } - -} diff --git a/src/lib/engine/core_engine/info.txt b/src/lib/engine/core_engine/info.txt index 44843e26a..1343ad5e7 100644 --- a/src/lib/engine/core_engine/info.txt +++ b/src/lib/engine/core_engine/info.txt @@ -5,7 +5,6 @@ core_engine.h </header:internal> <source> -core_modes.cpp def_pk_ops.cpp def_powm.cpp lookup_block.cpp diff --git a/src/lib/engine/dyn_engine/dyn_engine.h b/src/lib/engine/dyn_engine/dyn_engine.h index 02a9d6343..d559a518a 100644 --- a/src/lib/engine/dyn_engine/dyn_engine.h +++ b/src/lib/engine/dyn_engine/dyn_engine.h @@ -68,13 +68,6 @@ class BOTAN_DLL Dynamically_Loaded_Engine : public Engine return engine->mod_exp(n, hints); } - Keyed_Filter* get_cipher(const std::string& algo_spec, - Cipher_Dir dir, - Algorithm_Factory& af) - { - return engine->get_cipher(algo_spec, dir, af); - } - PK_Ops::Key_Agreement* get_key_agreement_op(const Private_Key& key, RandomNumberGenerator& rng) const override { diff --git a/src/lib/engine/engine.cpp b/src/lib/engine/engine.cpp index 8c164804b..15543b289 100644 --- a/src/lib/engine/engine.cpp +++ b/src/lib/engine/engine.cpp @@ -51,13 +51,6 @@ Engine::mod_exp(const BigInt&, return nullptr; } -Keyed_Filter* Engine::get_cipher(const std::string&, - Cipher_Dir, - Algorithm_Factory&) - { - return nullptr; - } - PK_Ops::Key_Agreement* Engine::get_key_agreement_op(const Private_Key&, RandomNumberGenerator&) const { diff --git a/src/lib/engine/engine.h b/src/lib/engine/engine.h index d28bc28ab..ba8c02f93 100644 --- a/src/lib/engine/engine.h +++ b/src/lib/engine/engine.h @@ -21,7 +21,6 @@ namespace Botan { class Algorithm_Factory; -class Keyed_Filter; class RandomNumberGenerator; /** @@ -94,17 +93,6 @@ class BOTAN_DLL Engine Power_Mod::Usage_Hints hints) const; /** - * Return a new cipher object - * @param algo_spec the algorithm name/specification - * @param dir specifies if encryption or decryption is desired - * @param af an algorithm factory object - * @return newly allocated object, or NULL - */ - virtual Keyed_Filter* get_cipher(const std::string& algo_spec, - Cipher_Dir dir, - Algorithm_Factory& af); - - /** * Return a new operator object for this key, if possible * @param key the key we want an operator for * @return newly allocated operator object, or NULL |