aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/mac/mac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/mac/mac.cpp')
-rw-r--r--src/lib/mac/mac.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/mac/mac.cpp b/src/lib/mac/mac.cpp
index 0bb1939c7..af59bd4c6 100644
--- a/src/lib/mac/mac.cpp
+++ b/src/lib/mac/mac.cpp
@@ -6,10 +6,37 @@
*/
#include <botan/mac.h>
+#include <botan/internal/mac_utils.h>
#include <botan/mem_ops.h>
+#if defined(BOTAN_HAS_CBC_MAC)
+ #include <botan/cbc_mac.h>
+#endif
+
+#if defined(BOTAN_HAS_CMAC)
+ #include <botan/cmac.h>
+#endif
+
+#if defined(BOTAN_HAS_HMAC)
+ #include <botan/hmac.h>
+#endif
+
+#if defined(BOTAN_HAS_POLY1305)
+ #include <botan/poly1305.h>
+#endif
+
+#if defined(BOTAN_HAS_SIPHASH)
+ #include <botan/siphash.h>
+#endif
+
+#if defined(BOTAN_HAS_ANSI_X919_MAC)
+ #include <botan/x919_mac.h>
+#endif
+
namespace Botan {
+MessageAuthenticationCode::~MessageAuthenticationCode() {}
+
/*
* Default (deterministic) MAC verification operation
*/
@@ -23,4 +50,29 @@ bool MessageAuthenticationCode::verify_mac(const byte mac[], size_t length)
return same_mem(our_mac.data(), mac, length);
}
+
+#if defined(BOTAN_HAS_CBC_MAC)
+BOTAN_REGISTER_NAMED_T(MessageAuthenticationCode, "CBC-MAC", CBC_MAC, CBC_MAC::make);
+#endif
+
+#if defined(BOTAN_HAS_CMAC)
+BOTAN_REGISTER_NAMED_T(MessageAuthenticationCode, "CMAC", CMAC, CMAC::make);
+#endif
+
+#if defined(BOTAN_HAS_HMAC)
+BOTAN_REGISTER_NAMED_T(MessageAuthenticationCode, "HMAC", HMAC, HMAC::make);
+#endif
+
+#if defined(BOTAN_HAS_POLY1305)
+BOTAN_REGISTER_MAC_NOARGS(Poly1305);
+#endif
+
+#if defined(BOTAN_HAS_SIPHASH)
+BOTAN_REGISTER_NAMED_T_2LEN(MessageAuthenticationCode, SipHash, "SipHash", "base", 2, 4);
+#endif
+
+#if defined(BOTAN_HAS_ANSI_X919_MAC)
+BOTAN_REGISTER_MAC_NAMED_NOARGS(ANSI_X919_MAC, "X9.19-MAC");
+#endif
+
}