Lines Matching refs:HMAC
7 #include "crypto/hmac.h"
21 // Expected HMAC result using kMessage and kClientKey.
55 crypto::HMAC hmac(crypto::HMAC::SHA1);
56 ASSERT_TRUE(hmac.Init(kClientKey, kKeySize));
59 EXPECT_TRUE(hmac.Sign(message_data, calculated_hmac, kSHA1DigestSize));
124 crypto::HMAC hmac(crypto::HMAC::SHA1);
125 ASSERT_TRUE(hmac.Init(reinterpret_cast<const unsigned char*>(cases[i].key),
129 EXPECT_TRUE(hmac.Sign(data_string, digest, kSHA1DigestSize));
150 crypto::HMAC hmac(crypto::HMAC::SHA256);
151 ASSERT_TRUE(hmac.Init(key, sizeof(key)));
154 EXPECT_TRUE(hmac.Sign(data, calculated_hmac, kSHA256DigestSize));
158 // Based on NSS's FIPS HMAC power-up self-test.
173 // HMAC-SHA-1 known answer (20 bytes).
180 // HMAC-SHA-256 known answer (32 bytes).
190 crypto::HMAC hmac(crypto::HMAC::SHA1);
191 ASSERT_TRUE(hmac.Init(kKnownSecretKey, kKnownSecretKeySize));
194 EXPECT_TRUE(hmac.Sign(message_data, calculated_hmac, kSHA1DigestSize));
197 crypto::HMAC hmac2(crypto::HMAC::SHA256);
228 crypto::HMAC hmac(crypto::HMAC::SHA1);
229 ASSERT_TRUE(hmac.Init(reinterpret_cast<const unsigned char*>(key), key_len));
233 EXPECT_TRUE(hmac.Sign(data_string, digest, kSHA1DigestSize));