aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac/x919_mac/x919_mac.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-30 06:47:38 +0000
committerlloyd <[email protected]>2008-09-30 06:47:38 +0000
commit66869d7e0fcaf120f5c22eee43277fabd00e94fd (patch)
tree5161b89557a8a8cd8f69ee7459368391872980fb /src/mac/x919_mac/x919_mac.cpp
parent33bb3dca54ecef2599b756d27b66781e14d06ae3 (diff)
Remove lookup.h from X9.31 PRNG, X9.19 MAC, SSLv3 MAC, PBKDF1
Diffstat (limited to 'src/mac/x919_mac/x919_mac.cpp')
-rw-r--r--src/mac/x919_mac/x919_mac.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/mac/x919_mac/x919_mac.cpp b/src/mac/x919_mac/x919_mac.cpp
index 92ec7b7b8..5e03b2e6c 100644
--- a/src/mac/x919_mac/x919_mac.cpp
+++ b/src/mac/x919_mac/x919_mac.cpp
@@ -4,7 +4,6 @@
*************************************************/
#include <botan/x919_mac.h>
-#include <botan/lookup.h>
#include <botan/xor_buf.h>
#include <algorithm>
@@ -70,19 +69,33 @@ void ANSI_X919_MAC::clear() throw()
position = 0;
}
+std::string ANSI_X919_MAC::name() const
+ {
+ return "X9.19-MAC";
+ }
+
+MessageAuthenticationCode* ANSI_X919_MAC::clone() const
+ {
+ return new ANSI_X919_MAC(e->clone());
+ }
+
/*************************************************
* ANSI X9.19 MAC Constructor *
*************************************************/
-ANSI_X919_MAC::ANSI_X919_MAC() : MessageAuthenticationCode(8, 8, 16, 8)
+ANSI_X919_MAC::ANSI_X919_MAC(BlockCipher* e_in) :
+ MessageAuthenticationCode(e_in->BLOCK_SIZE,
+ e_in->MINIMUM_KEYLENGTH,
+ 2*e_in->MAXIMUM_KEYLENGTH,
+ 2*e_in->KEYLENGTH_MULTIPLE),
+ e(e_in), d(e->clone()), position(0)
{
- e = get_block_cipher("DES");
- d = get_block_cipher("DES");
- position = 0;
+ if(e->name() != "DES")
+ throw Invalid_Argument("ANSI X9.19 MAC only supports DES");
}
/*************************************************
* ANSI X9.19 MAC Destructor *
-*************************************************/
+le*************************************************/
ANSI_X919_MAC::~ANSI_X919_MAC()
{
delete e;