diff options
author | Jack Lloyd <[email protected]> | 2015-09-21 14:59:01 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-09-21 14:59:01 -0400 |
commit | 04319af23bf8ed467b17f9b74c814343e051ab6b (patch) | |
tree | 630d1a0cc931e77e7e1f07319e5cf89d00af4458 /src/lib/mac | |
parent | 408ea0a9b8ed0f575f8ee26891473920b42ef026 (diff) |
Remove use of lookup.h in favor of new T::create API.
Diffstat (limited to 'src/lib/mac')
-rw-r--r-- | src/lib/mac/cbc_mac/cbc_mac.cpp | 3 | ||||
-rw-r--r-- | src/lib/mac/cmac/cmac.cpp | 5 | ||||
-rw-r--r-- | src/lib/mac/hmac/hmac.cpp | 5 | ||||
-rw-r--r-- | src/lib/mac/x919_mac/x919_mac.cpp | 8 |
4 files changed, 9 insertions, 12 deletions
diff --git a/src/lib/mac/cbc_mac/cbc_mac.cpp b/src/lib/mac/cbc_mac/cbc_mac.cpp index 8133b9a6f..449865255 100644 --- a/src/lib/mac/cbc_mac/cbc_mac.cpp +++ b/src/lib/mac/cbc_mac/cbc_mac.cpp @@ -6,7 +6,6 @@ */ #include <botan/cbc_mac.h> -#include <botan/lookup.h> namespace Botan { @@ -14,7 +13,7 @@ CBC_MAC* CBC_MAC::make(const Spec& spec) { if(spec.arg_count() == 1) { - if(auto bc = make_block_cipher(spec.arg(0))) + if(auto bc = BlockCipher::create(spec.arg(0))) return new CBC_MAC(bc.release()); } return nullptr; diff --git a/src/lib/mac/cmac/cmac.cpp b/src/lib/mac/cmac/cmac.cpp index 0e42e3823..27edda233 100644 --- a/src/lib/mac/cmac/cmac.cpp +++ b/src/lib/mac/cmac/cmac.cpp @@ -6,7 +6,6 @@ */ #include <botan/cmac.h> -#include <botan/lookup.h> namespace Botan { @@ -14,8 +13,8 @@ CMAC* CMAC::make(const Spec& spec) { if(spec.arg_count() == 1) { - if(BlockCipher* bc = get_block_cipher(spec.arg(0))) - return new CMAC(bc); + if(auto bc = BlockCipher::create(spec.arg(0))) + return new CMAC(bc.release()); } return nullptr; } diff --git a/src/lib/mac/hmac/hmac.cpp b/src/lib/mac/hmac/hmac.cpp index 40da31887..f445ab0cf 100644 --- a/src/lib/mac/hmac/hmac.cpp +++ b/src/lib/mac/hmac/hmac.cpp @@ -7,7 +7,6 @@ */ #include <botan/hmac.h> -#include <botan/lookup.h> namespace Botan { @@ -15,8 +14,8 @@ HMAC* HMAC::make(const Spec& spec) { if(spec.arg_count() == 1) { - if(HashFunction* h = get_hash_function(spec.arg(0))) - return new HMAC(h); + if(auto h = HashFunction::create(spec.arg(0))) + return new HMAC(h.release()); } return nullptr; } diff --git a/src/lib/mac/x919_mac/x919_mac.cpp b/src/lib/mac/x919_mac/x919_mac.cpp index 2e1fa374f..205d812c2 100644 --- a/src/lib/mac/x919_mac/x919_mac.cpp +++ b/src/lib/mac/x919_mac/x919_mac.cpp @@ -6,7 +6,6 @@ */ #include <botan/x919_mac.h> -#include <botan/lookup.h> namespace Botan { @@ -86,10 +85,11 @@ MessageAuthenticationCode* ANSI_X919_MAC::clone() const /* * ANSI X9.19 MAC Constructor */ -ANSI_X919_MAC::ANSI_X919_MAC() : m_state(8), m_position(0) +ANSI_X919_MAC::ANSI_X919_MAC() : + m_des1(BlockCipher::create("DES")), + m_des2(BlockCipher::create("DES")), + m_state(8), m_position(0) { - m_des1.reset(get_block_cipher("DES")); - m_des2.reset(m_des1->clone()); } } |