diff options
author | lloyd <[email protected]> | 2008-09-30 05:46:54 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-30 05:46:54 +0000 |
commit | c9749d5d4693b5d93171f6085b29fc72c1e12ba0 (patch) | |
tree | d4c8c958863dbcc18751abd5b084c89ce6a5296c /src/core/libstate | |
parent | 75ef07ee5378341adf054bd729232167c73e9e47 (diff) |
Remove lookup dependency on CMAC: takes a BlockCipher as constructor arg
Diffstat (limited to 'src/core/libstate')
-rw-r--r-- | src/core/libstate/def_alg.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/libstate/def_alg.cpp b/src/core/libstate/def_alg.cpp index 6a12f79f2..ade7e8d08 100644 --- a/src/core/libstate/def_alg.cpp +++ b/src/core/libstate/def_alg.cpp @@ -542,9 +542,12 @@ Default_Engine::find_mac(const std::string& algo_spec) const HANDLE_TYPE_ONE_STRING("CBC-MAC", CBC_MAC); #endif -#if defined(BOTAN_HAS_CMAC) - HANDLE_TYPE_ONE_STRING("CMAC", CMAC); -#endif + if(algo_name == "CMAC") + { + if(name.size() == 2) + return new CMAC(find_block_cipher(name[1])); + throw Invalid_Algorithm_Name(algo_spec); + } #if defined(BOTAN_HAS_HMAC) HANDLE_TYPE_ONE_STRING("HMAC", HMAC); |