aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate/lookup.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-10 20:51:46 +0000
committerlloyd <[email protected]>2008-11-10 20:51:46 +0000
commit2fe47f9071f37591a2016c16bb9b04f8e191e1c8 (patch)
treeb9fb9041b18fd41b533ec2a3d63fc32d3eb2088d /src/libstate/lookup.cpp
parentb1905058bdc3e96ca4311ac8cfa82aa736f73eb4 (diff)
Move add_algorithm for hashes also to Algorithm_Factory
Diffstat (limited to 'src/libstate/lookup.cpp')
-rw-r--r--src/libstate/lookup.cpp27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/libstate/lookup.cpp b/src/libstate/lookup.cpp
index 52e986ff2..f53b1a099 100644
--- a/src/libstate/lookup.cpp
+++ b/src/libstate/lookup.cpp
@@ -27,6 +27,14 @@ HashFunction* get_hash(const std::string& algo_spec)
}
/*************************************************
+* Add a new hash function *
+*************************************************/
+void add_algorithm(Library_State& libstate, HashFunction* algo)
+ {
+ libstate.algo_factory().add_hash_function(algo);
+ }
+
+/*************************************************
* Query if Botan has the named hash function *
*************************************************/
bool have_hash(const std::string& algo_spec)
@@ -312,25 +320,6 @@ void add_algorithm(Library_State& libstate, StreamCipher* algo)
}
/*************************************************
-* Add a new hash function *
-*************************************************/
-void add_algorithm(Library_State& libstate, HashFunction* algo)
- {
- Algorithm_Factory::Engine_Iterator i(libstate.algo_factory());
-
- 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");
- }
-
-/*************************************************
* Add a new authentication code *
*************************************************/
void add_algorithm(Library_State& libstate,