diff options
Diffstat (limited to 'src/lib/engine/core_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 |
3 files changed, 0 insertions, 90 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 |