diff options
author | lloyd <[email protected]> | 2008-11-10 02:53:24 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-10 02:53:24 +0000 |
commit | cabd8859a0cd87cf78ef1a48a8d59bf4a6fae81c (patch) | |
tree | cb9a786f4129e4861bd63b7c5152981304e945bf /src/libstate/lookup.cpp | |
parent | ba1271baf1ccbc0302971e7300229d0dec0405ab (diff) |
Remove support for block cipher padding methods in engine. Like S2K,
they were not used at all outside of the core library implementations.
One change is that now get_bc_pad returns a new object, instead of a
pointer to a const shared padding method. This does imply a bit more
dynamic memory overhead, but the modes are pretty light (stateless, for
the most part), so this doesn't seem like a big deal. So modify ECB and
CBC classes to add destructors to delete the padding object.
Diffstat (limited to 'src/libstate/lookup.cpp')
-rw-r--r-- | src/libstate/lookup.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/libstate/lookup.cpp b/src/libstate/lookup.cpp index 700a62a7a..956f508e4 100644 --- a/src/libstate/lookup.cpp +++ b/src/libstate/lookup.cpp @@ -54,19 +54,6 @@ MessageAuthenticationCode* get_mac(const std::string& name) } /************************************************* -* Get a block cipher padding method by name * -*************************************************/ -const BlockCipherModePaddingMethod* get_bc_pad(const std::string& name) - { - const BlockCipherModePaddingMethod* pad = - retrieve_bc_pad(global_state(), name); - - if(pad) - return pad; - throw Algorithm_Not_Found(name); - } - -/************************************************* * Query if an algorithm exists * *************************************************/ bool have_algorithm(const std::string& name) @@ -300,24 +287,6 @@ const MessageAuthenticationCode* retrieve_mac(Library_State& libstate, } /************************************************* -* Retrieve a block cipher padding method * -*************************************************/ -const BlockCipherModePaddingMethod* retrieve_bc_pad(Library_State& libstate, - const std::string& name) - { - Library_State::Engine_Iterator i(libstate); - - while(const Engine* engine = i.next()) - { - const BlockCipherModePaddingMethod* algo = engine->bc_pad(name); - if(algo) - return algo; - } - - return 0; - } - -/************************************************* * Add a new block cipher * *************************************************/ void add_algorithm(Library_State& libstate, BlockCipher* algo) @@ -395,26 +364,6 @@ void add_algorithm(Library_State& libstate, } /************************************************* -* Add a padding method to the lookup table * -*************************************************/ -void add_algorithm(Library_State& libstate, - BlockCipherModePaddingMethod* algo) - { - Library_State::Engine_Iterator i(libstate); - - while(Engine* engine = i.next()) - { - if(engine->can_add_algorithms()) - { - engine->add_algorithm(algo); - return; - } - } - - throw Invalid_State("add_algorithm: Couldn't find the Default_Engine"); - } - -/************************************************* * Get a cipher object * *************************************************/ Keyed_Filter* get_cipher(const std::string& algo_spec, |