diff options
author | lloyd <[email protected]> | 2008-10-02 15:30:57 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-10-02 15:30:57 +0000 |
commit | 6eaae824eb88873748984ec53f6bf285dd30244c (patch) | |
tree | aac39d26bdae6855cbbe0d50e05abdd08a00c0f8 /src/core | |
parent | 7f7827b694044d9394fb45c18c6fe518a477fc0b (diff) |
Revert part of revision b87599ffaee2d8ed2ec7597634413e73e4fb2fd8 that
added a new mandatory parameter of a Library_State& to get_cipher().
Do this so Monotone does not have to special case.
Other lookup related functions like retrieve_<type> and add_algorithm()
still require a Library_State& however.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/libstate/engine.cpp | 15 | ||||
-rw-r--r-- | src/core/libstate/lookup.h | 9 | ||||
-rw-r--r-- | src/core/selftest/selftest.cpp | 4 |
3 files changed, 11 insertions, 17 deletions
diff --git a/src/core/libstate/engine.cpp b/src/core/libstate/engine.cpp index 4f58fb040..44c3ae5e5 100644 --- a/src/core/libstate/engine.cpp +++ b/src/core/libstate/engine.cpp @@ -383,11 +383,10 @@ void add_algorithm(Library_State& libstate, /************************************************* * Get a cipher object * *************************************************/ -Keyed_Filter* get_cipher(Library_State& libstate, - const std::string& algo_spec, +Keyed_Filter* get_cipher(const std::string& algo_spec, Cipher_Dir direction) { - Library_State::Engine_Iterator i(libstate); + Library_State::Engine_Iterator i(global_state()); while(Engine* engine = i.next()) { @@ -402,13 +401,12 @@ Keyed_Filter* get_cipher(Library_State& libstate, /************************************************* * Get a cipher object * *************************************************/ -Keyed_Filter* get_cipher(Library_State& libstate, - const std::string& algo_spec, +Keyed_Filter* get_cipher(const std::string& algo_spec, const SymmetricKey& key, const InitializationVector& iv, Cipher_Dir direction) { - Keyed_Filter* cipher = get_cipher(libstate, algo_spec, direction); + Keyed_Filter* cipher = get_cipher(algo_spec, direction); cipher->set_key(key); if(iv.length()) @@ -420,12 +418,11 @@ Keyed_Filter* get_cipher(Library_State& libstate, /************************************************* * Get a cipher object * *************************************************/ -Keyed_Filter* get_cipher(Library_State& libstate, - const std::string& algo_spec, +Keyed_Filter* get_cipher(const std::string& algo_spec, const SymmetricKey& key, Cipher_Dir direction) { - return get_cipher(libstate, algo_spec, + return get_cipher(algo_spec, key, InitializationVector(), direction); } diff --git a/src/core/libstate/lookup.h b/src/core/libstate/lookup.h index 016ad4618..f60104d32 100644 --- a/src/core/libstate/lookup.h +++ b/src/core/libstate/lookup.h @@ -58,19 +58,16 @@ BOTAN_DLL KDF* get_kdf(const std::string&); /************************************************* * Get a cipher object * *************************************************/ -BOTAN_DLL Keyed_Filter* get_cipher(Library_State&, - const std::string&, +BOTAN_DLL Keyed_Filter* get_cipher(const std::string&, const SymmetricKey&, const InitializationVector&, Cipher_Dir); -BOTAN_DLL Keyed_Filter* get_cipher(Library_State&, - const std::string&, +BOTAN_DLL Keyed_Filter* get_cipher(const std::string&, const SymmetricKey&, Cipher_Dir); -BOTAN_DLL Keyed_Filter* get_cipher(Library_State&, - const std::string&, Cipher_Dir); +BOTAN_DLL Keyed_Filter* get_cipher(const std::string&, Cipher_Dir); /************************************************* * Check to see if an algorithm exists * diff --git a/src/core/selftest/selftest.cpp b/src/core/selftest/selftest.cpp index 0dede1c9d..ad965fb79 100644 --- a/src/core/selftest/selftest.cpp +++ b/src/core/selftest/selftest.cpp @@ -35,9 +35,9 @@ void cipher_kat(const std::string& in, const std::string& out, const std::string& cipher) { do_kat(in, out, cipher, - get_cipher(global_state(), cipher, key, iv, ENCRYPTION)); + get_cipher(cipher, key, iv, ENCRYPTION)); do_kat(out, in, cipher, - get_cipher(global_state(), cipher, key, iv, DECRYPTION)); + get_cipher(cipher, key, iv, DECRYPTION)); } /************************************************* |