diff options
author | lloyd <[email protected]> | 2010-10-13 00:56:15 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 00:56:15 +0000 |
commit | 6e706bfefa04fc28d6c204442ca45982993dc550 (patch) | |
tree | c3a151b6ce91cb5add058b224a925e4f3b8cfb5d /src/mac/mac.cpp | |
parent | c59d960db6d69bd9c479ec674768b7ec371830b5 (diff) |
More size_t
Diffstat (limited to 'src/mac/mac.cpp')
-rw-r--r-- | src/mac/mac.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mac/mac.cpp b/src/mac/mac.cpp index cb89e872a..2ef4ab64c 100644 --- a/src/mac/mac.cpp +++ b/src/mac/mac.cpp @@ -6,21 +6,21 @@ */ #include <botan/mac.h> +#include <botan/mem_ops.h> namespace Botan { /* * Default (deterministic) MAC verification operation */ -bool MessageAuthenticationCode::verify_mac(const byte mac[], u32bit length) +bool MessageAuthenticationCode::verify_mac(const byte mac[], size_t 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; + + return same_mem(&our_mac[0], &mac[0], length); } } |