diff options
Diffstat (limited to 'src/libstate')
-rw-r--r-- | src/libstate/lookup.cpp | 76 | ||||
-rw-r--r-- | src/libstate/lookup.h | 39 |
2 files changed, 0 insertions, 115 deletions
diff --git a/src/libstate/lookup.cpp b/src/libstate/lookup.cpp index d971618c2..f5d2c5a0c 100644 --- a/src/libstate/lookup.cpp +++ b/src/libstate/lookup.cpp @@ -62,82 +62,6 @@ u32bit output_length_of(const std::string& name) } /* -* Check if a keylength is valid for this algo -*/ -bool valid_keylength_for(u32bit key_len, const std::string& name) - { - Algorithm_Factory& af = global_state().algorithm_factory(); - - if(const BlockCipher* bc = af.prototype_block_cipher(name)) - return bc->valid_keylength(key_len); - - if(const StreamCipher* sc = af.prototype_stream_cipher(name)) - return sc->valid_keylength(key_len); - - if(const MessageAuthenticationCode* mac = af.prototype_mac(name)) - return mac->valid_keylength(key_len); - - throw Algorithm_Not_Found(name); - } - -/* -* Query the MINIMUM_KEYLENGTH of an algorithm -*/ -u32bit min_keylength_of(const std::string& name) - { - Algorithm_Factory& af = global_state().algorithm_factory(); - - if(const BlockCipher* bc = af.prototype_block_cipher(name)) - return bc->MINIMUM_KEYLENGTH; - - if(const StreamCipher* sc = af.prototype_stream_cipher(name)) - return sc->MINIMUM_KEYLENGTH; - - if(const MessageAuthenticationCode* mac = af.prototype_mac(name)) - return mac->MINIMUM_KEYLENGTH; - - throw Algorithm_Not_Found(name); - } - -/* -* Query the MAXIMUM_KEYLENGTH of an algorithm -*/ -u32bit max_keylength_of(const std::string& name) - { - Algorithm_Factory& af = global_state().algorithm_factory(); - - if(const BlockCipher* bc = af.prototype_block_cipher(name)) - return bc->MAXIMUM_KEYLENGTH; - - if(const StreamCipher* sc = af.prototype_stream_cipher(name)) - return sc->MAXIMUM_KEYLENGTH; - - if(const MessageAuthenticationCode* mac = af.prototype_mac(name)) - return mac->MAXIMUM_KEYLENGTH; - - throw Algorithm_Not_Found(name); - } - -/* -* Query the KEYLENGTH_MULTIPLE of an algorithm -*/ -u32bit keylength_multiple_of(const std::string& name) - { - Algorithm_Factory& af = global_state().algorithm_factory(); - - if(const BlockCipher* bc = af.prototype_block_cipher(name)) - return bc->KEYLENGTH_MULTIPLE; - - if(const StreamCipher* sc = af.prototype_stream_cipher(name)) - return sc->KEYLENGTH_MULTIPLE; - - if(const MessageAuthenticationCode* mac = af.prototype_mac(name)) - return mac->KEYLENGTH_MULTIPLE; - - throw Algorithm_Not_Found(name); - } - -/* * Get a cipher object */ Keyed_Filter* get_cipher(const std::string& algo_spec, diff --git a/src/libstate/lookup.h b/src/libstate/lookup.h index 178f80428..f1e1a52ca 100644 --- a/src/libstate/lookup.h +++ b/src/libstate/lookup.h @@ -299,45 +299,6 @@ BOTAN_DLL u32bit block_size_of(const std::string& algo_spec); */ BOTAN_DLL u32bit output_length_of(const std::string& algo_spec); -/** -* Find out the whether a certain key length is allowd for a given -* symmetric algorithm. -* @deprecated Call algorithm_factory() directly -* -* @param key_len the key length in question -* @param algo_spec the name of the algorithm -* @return true if the key length is valid for that algorithm, false otherwise -*/ -BOTAN_DLL bool valid_keylength_for(u32bit key_len, - const std::string& algo_spec); - -/** -* Find out the minimum key size of a certain symmetric algorithm. -* @deprecated Call algorithm_factory() directly -* -* @param algo_spec the name of the algorithm -* @return minimum key length of the specified algorithm -*/ -BOTAN_DLL u32bit min_keylength_of(const std::string& algo_spec); - -/** -* Find out the maximum key size of a certain symmetric algorithm. -* @deprecated Call algorithm_factory() directly -* -* @param algo_spec the name of the algorithm -* @return maximum key length of the specified algorithm -*/ -BOTAN_DLL u32bit max_keylength_of(const std::string& algo_spec); - -/** -* Find out the size any valid key is a multiple of for a certain algorithm. -* @deprecated Call algorithm_factory() directly -* -* @param algo_spec the name of the algorithm -* @return size any valid key is a multiple of -*/ -BOTAN_DLL u32bit keylength_multiple_of(const std::string& algo_spec); - } #endif |