diff options
Diffstat (limited to 'old/botan/src/mac/mac.cpp')
-rw-r--r-- | old/botan/src/mac/mac.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/old/botan/src/mac/mac.cpp b/old/botan/src/mac/mac.cpp new file mode 100644 index 0000000..96df255 --- /dev/null +++ b/old/botan/src/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 <botan/mac.h> + +namespace Botan { + +/** +* Default (deterministic) MAC verification operation +*/ +bool MessageAuthenticationCode::verify_mac(const byte mac[], u32bit length) + { + SecureVector<byte> our_mac = final(); + if(our_mac.size() != length) + return false; + for(u32bit j = 0; j != length; ++j) + if(mac[j] != our_mac[j]) + return false; + return true; + } + +} |