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.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/mac/mac.cpp b/src/lib/mac/mac.cpp
index 70807b39f..2fa321a67 100644
--- a/src/lib/mac/mac.cpp
+++ b/src/lib/mac/mac.cpp
@@ -17,6 +17,10 @@
#include <botan/cmac.h>
#endif
+#if defined(BOTAN_HAS_GMAC)
+ #include <botan/gmac.h>
+#endif
+
#if defined(BOTAN_HAS_HMAC)
#include <botan/hmac.h>
#endif
@@ -41,6 +45,17 @@ MessageAuthenticationCode::create(const std::string& algo_spec,
{
const SCAN_Name req(algo_spec);
+#if defined(BOTAN_HAS_GMAC)
+ if(req.algo_name() == "GMAC" && req.arg_count() == 1)
+ {
+ if(provider.empty() || provider == "base")
+ {
+ if(auto bc = BlockCipher::create(req.arg(0)))
+ return std::unique_ptr<MessageAuthenticationCode>(new GMAC(bc.release()));
+ }
+ }
+#endif
+
#if defined(BOTAN_HAS_HMAC)
if(req.algo_name() == "HMAC" && req.arg_count() == 1)
{