-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 You’re dropping the leading zero of a byte. The error has nothing to do with HMAC-SHA1; the problem is in the code that’s printing the array of bytes. You probably forgot to pad each byte to two digits before printing it.
Chris On Sun, 7 Oct 2012 08:29:45 -0700 (PDT) Nick <[email protected]> wrote: > In addition, I initiated the HMAC-SHA1 process using the following > code which produced the same output listed in my previous post. I > hope this helps. > > > const byte pbData [] = "The quick brown fox jumps over the lazy dog"; > > const byte key [] = "key"; > > byte pbOutputBuffer[CryptoPP::SHA1::DIGESTSIZE]; > > CryptoPP::HMAC<CryptoPP::SHA1>(key, > 3).CalculateDigest(pbOutputBuffer, pbData, 43); > > Correct Output: > > HMAC_SHA1("key", "The quick brown fox jumps over the lazy dog") = > 0xde7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9 > > The procedure above produced: > > 0xde7c9b85b8b78aa6bc8a7a36f7a90701c9db4d9 > > The output is off by one digit. The version of the library I am using > is 5.6.1. > > > > > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEAREDAAYFAlBzT68ACgkQXUF6hOTGP7evpQCfcpRdWA9pfiI4wiNhLULC1YwR aMgAoKHcPMLO7IepSCPk5Yi5aHAfdrcj =9fOf -----END PGP SIGNATURE----- -- 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.
