The example code below is returning the wrong digest. I am not sure why
this is happening. Any help would greatly be appreciated.
Example Code:
string s = "The quick brown fox jumps over the lazy dog";
const byte key [] = "key";
string o;
CryptoPP::HMAC<CryptoPP::SHA> hash;
hash.SetKey(key, sizeof(key));
CryptoPP::StringSource(s, true, new CryptoPP::HashFilter(hash,
newCryptoPP::StringSink(o)));
The Correct Output Should be:
HMAC_SHA1("key", "The quick brown fox jumps over the lazy dog") =
0xde7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9
The output I am seeing is:
0xde7c9b85b8b78aa6bc8a7a36f7a90701c9db4d9
I am off by one digit.
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.