aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/mac/cbc_mac/cbc_mac.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-01-31 15:30:49 +0000
committerlloyd <[email protected]>2015-01-31 15:30:49 +0000
commit00c9b3f4834603946065c15b9b2e9fa5e973b979 (patch)
treeb0f82333a1eeab624409db9515e511838f6fa2d6 /src/lib/mac/cbc_mac/cbc_mac.cpp
parent710229be83cdbc061949c61942896b5af9e134d8 (diff)
Use registry for streams and MACs. Start updating callers.
Diffstat (limited to 'src/lib/mac/cbc_mac/cbc_mac.cpp')
-rw-r--r--src/lib/mac/cbc_mac/cbc_mac.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/mac/cbc_mac/cbc_mac.cpp b/src/lib/mac/cbc_mac/cbc_mac.cpp
index e8fc394fa..d893b922f 100644
--- a/src/lib/mac/cbc_mac/cbc_mac.cpp
+++ b/src/lib/mac/cbc_mac/cbc_mac.cpp
@@ -5,12 +5,20 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
+#include <botan/internal/mac_utils.h>
#include <botan/cbc_mac.h>
-#include <botan/internal/xor_buf.h>
-#include <algorithm>
namespace Botan {
+CBC_MAC* CBC_MAC::make(const Spec& spec)
+ {
+ if(spec.arg_count() == 1)
+ return new CBC_MAC(Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0)));
+ return nullptr;
+ }
+
+BOTAN_REGISTER_NAMED_T(MessageAuthenticationCode, "CBC-MAC", CBC_MAC, CBC_MAC::make);
+
/*
* Update an CBC-MAC Calculation
*/