From 197dc467dec28a04c3b2f30da7cef122dfbb13e9 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 1 Jan 2014 21:20:55 +0000 Subject: Shuffle things around. Add NIST X.509 test to build. --- lib/mac/mac.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/mac/mac.cpp (limited to 'lib/mac/mac.cpp') diff --git a/lib/mac/mac.cpp b/lib/mac/mac.cpp new file mode 100644 index 000000000..094aa1b4a --- /dev/null +++ b/lib/mac/mac.cpp @@ -0,0 +1,26 @@ +/* +* Message Authentication Code base class +* (C) 1999-2008 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + +#include +#include + +namespace Botan { + +/* +* Default (deterministic) MAC verification operation +*/ +bool MessageAuthenticationCode::verify_mac(const byte mac[], size_t length) + { + secure_vector our_mac = final(); + + if(our_mac.size() != length) + return false; + + return same_mem(&our_mac[0], &mac[0], length); + } + +} -- cgit v1.2.3