Lines Matching refs:hmac
7 #include "crypto/hmac.h"
77 crypto::HMAC hmac(crypto::HMAC::SHA1);
78 ASSERT_TRUE(hmac.Init(kClientKey, kKeySize));
81 EXPECT_TRUE(hmac.Sign(message_data, calculated_hmac, kSHA1DigestSize));
146 crypto::HMAC hmac(crypto::HMAC::SHA1);
147 ASSERT_TRUE(hmac.Init(reinterpret_cast<const unsigned char*>(cases[i].key),
151 EXPECT_TRUE(hmac.Sign(data_string, digest, kSHA1DigestSize));
172 crypto::HMAC hmac(crypto::HMAC::SHA256);
173 ASSERT_TRUE(hmac.Init(key, sizeof(key)));
176 EXPECT_EQ(kSHA256DigestSize, hmac.DigestLength());
177 EXPECT_TRUE(hmac.Sign(data, calculated_hmac, kSHA256DigestSize));
213 crypto::HMAC hmac(crypto::HMAC::SHA1);
214 ASSERT_TRUE(hmac.Init(kKnownSecretKey, kKnownSecretKeySize));
217 EXPECT_EQ(kSHA1DigestSize, hmac.DigestLength());
218 EXPECT_TRUE(hmac.Sign(message_data, calculated_hmac, kSHA1DigestSize));
220 EXPECT_TRUE(hmac.Verify(
224 EXPECT_TRUE(hmac.VerifyTruncated(
238 crypto::HMAC hmac(crypto::HMAC::SHA1);
240 hmac.Init(reinterpret_cast<const unsigned char*>(kSimpleKey),
246 EXPECT_TRUE(hmac.Sign(data_string, digest, kSHA1DigestSize));
252 crypto::HMAC hmac(crypto::HMAC::SHA1);
254 hmac.Init(reinterpret_cast<const unsigned char*>(kSimpleKey),
259 EXPECT_TRUE(hmac.Verify(
265 EXPECT_FALSE(hmac.Verify(
272 EXPECT_FALSE(hmac.Verify(
286 crypto::HMAC hmac(crypto::HMAC::SHA1);
287 ASSERT_TRUE(hmac.Init(NULL, 0));
290 EXPECT_TRUE(hmac.Sign(data, digest, kSHA1DigestSize));
293 EXPECT_TRUE(hmac.Verify(