/external/chromium_org/crypto/ |
D | hmac_unittest.cc | 77 crypto::HMAC hmac(crypto::HMAC::SHA1); in TEST() local 78 ASSERT_TRUE(hmac.Init(kClientKey, kKeySize)); in TEST() 81 EXPECT_TRUE(hmac.Sign(message_data, calculated_hmac, kSHA1DigestSize)); in TEST() 146 crypto::HMAC hmac(crypto::HMAC::SHA1); in TEST() local 147 ASSERT_TRUE(hmac.Init(reinterpret_cast<const unsigned char*>(cases[i].key), in TEST() 151 EXPECT_TRUE(hmac.Sign(data_string, digest, kSHA1DigestSize)); in TEST() 172 crypto::HMAC hmac(crypto::HMAC::SHA256); in TEST() local 173 ASSERT_TRUE(hmac.Init(key, sizeof(key))); in TEST() 176 EXPECT_EQ(kSHA256DigestSize, hmac.DigestLength()); in TEST() 177 EXPECT_TRUE(hmac.Sign(data, calculated_hmac, kSHA256DigestSize)); in TEST() [all …]
|
D | hkdf.cc | 55 HMAC hmac(HMAC::SHA256); in HKDF() local 56 result = hmac.Init(prk, sizeof(prk)); in HKDF() 66 result = hmac.Sign(base::StringPiece(buf.get(), j), digest, sizeof(digest)); in HKDF()
|
/external/dropbear/libtomcrypt/src/mac/hmac/ |
D | hmac_init.c | 30 int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned long keylen) in hmac_init() argument 37 LTC_ARGCHK(hmac != NULL); in hmac_init() 44 hmac->hash = hash; in hmac_init() 59 hmac->key = XMALLOC(HMAC_BLOCKSIZE); in hmac_init() 60 if (hmac->key == NULL) { in hmac_init() 68 if ((err = hash_memory(hash, key, keylen, hmac->key, &z)) != CRYPT_OK) { in hmac_init() 72 zeromem((hmac->key) + hashsize, (size_t)(HMAC_BLOCKSIZE - hashsize)); in hmac_init() 76 XMEMCPY(hmac->key, key, (size_t)keylen); in hmac_init() 78 zeromem((hmac->key) + keylen, (size_t)(HMAC_BLOCKSIZE - keylen)); in hmac_init() 84 buf[i] = hmac->key[i] ^ 0x36; in hmac_init() [all …]
|
D | hmac_done.c | 29 int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen) in hmac_done() argument 35 LTC_ARGCHK(hmac != NULL); in hmac_done() 39 hash = hmac->hash; in hmac_done() 61 if ((err = hash_descriptor[hash].done(&hmac->md, isha)) != CRYPT_OK) { in hmac_done() 67 buf[i] = hmac->key[i] ^ 0x5C; in hmac_done() 71 if ((err = hash_descriptor[hash].init(&hmac->md)) != CRYPT_OK) { in hmac_done() 74 if ((err = hash_descriptor[hash].process(&hmac->md, buf, HMAC_BLOCKSIZE)) != CRYPT_OK) { in hmac_done() 77 if ((err = hash_descriptor[hash].process(&hmac->md, isha, hashsize)) != CRYPT_OK) { in hmac_done() 80 if ((err = hash_descriptor[hash].done(&hmac->md, buf)) != CRYPT_OK) { in hmac_done() 92 XFREE(hmac->key); in hmac_done() [all …]
|
D | hmac_memory_multi.c | 39 hmac_state *hmac; in hmac_memory_multi() local 51 hmac = XMALLOC(sizeof(hmac_state)); in hmac_memory_multi() 52 if (hmac == NULL) { in hmac_memory_multi() 56 if ((err = hmac_init(hmac, hash, key, keylen)) != CRYPT_OK) { in hmac_memory_multi() 65 if ((err = hmac_process(hmac, curptr, curlen)) != CRYPT_OK) { in hmac_memory_multi() 75 if ((err = hmac_done(hmac, out, outlen)) != CRYPT_OK) { in hmac_memory_multi() 80 zeromem(hmac, sizeof(hmac_state)); in hmac_memory_multi() 82 XFREE(hmac); in hmac_memory_multi()
|
D | hmac_memory.c | 36 hmac_state *hmac; in hmac_memory() local 56 hmac = XMALLOC(sizeof(hmac_state)); in hmac_memory() 57 if (hmac == NULL) { in hmac_memory() 61 if ((err = hmac_init(hmac, hash, key, keylen)) != CRYPT_OK) { in hmac_memory() 65 if ((err = hmac_process(hmac, in, inlen)) != CRYPT_OK) { in hmac_memory() 69 if ((err = hmac_done(hmac, out, outlen)) != CRYPT_OK) { in hmac_memory() 76 zeromem(hmac, sizeof(hmac_state)); in hmac_memory() 79 XFREE(hmac); in hmac_memory()
|
D | hmac_process.c | 27 int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen) in hmac_process() argument 30 LTC_ARGCHK(hmac != NULL); in hmac_process() 32 if ((err = hash_is_valid(hmac->hash)) != CRYPT_OK) { in hmac_process() 35 return hash_descriptor[hmac->hash].process(&hmac->md, in, inlen); in hmac_process()
|
D | hmac_file.c | 37 hmac_state hmac; in hmac_file() 52 if ((err = hmac_init(&hmac, hash, key, keylen)) != CRYPT_OK) { in hmac_file() 64 if ((err = hmac_process(&hmac, buf, (unsigned long)x)) != CRYPT_OK) { in hmac_file() 76 if ((err = hmac_done(&hmac, out, outlen)) != CRYPT_OK) { in hmac_file()
|
/external/chromium/crypto/ |
D | hmac_unittest.cc | 55 crypto::HMAC hmac(crypto::HMAC::SHA1); in TEST() local 56 ASSERT_TRUE(hmac.Init(kClientKey, kKeySize)); in TEST() 59 EXPECT_TRUE(hmac.Sign(message_data, calculated_hmac, kSHA1DigestSize)); in TEST() 124 crypto::HMAC hmac(crypto::HMAC::SHA1); in TEST() local 125 ASSERT_TRUE(hmac.Init(reinterpret_cast<const unsigned char*>(cases[i].key), in TEST() 129 EXPECT_TRUE(hmac.Sign(data_string, digest, kSHA1DigestSize)); in TEST() 150 crypto::HMAC hmac(crypto::HMAC::SHA256); in TEST() local 151 ASSERT_TRUE(hmac.Init(key, sizeof(key))); in TEST() 154 EXPECT_TRUE(hmac.Sign(data, calculated_hmac, kSHA256DigestSize)); in TEST() 190 crypto::HMAC hmac(crypto::HMAC::SHA1); in TEST() local [all …]
|
/external/dropbear/libtomcrypt/src/misc/pkcs5/ |
D | pkcs_5_2.c | 40 hmac_state *hmac; in pkcs_5_alg2() local 53 hmac = XMALLOC(sizeof(hmac_state)); in pkcs_5_alg2() 54 if (hmac == NULL || buf[0] == NULL) { in pkcs_5_alg2() 55 if (hmac != NULL) { in pkcs_5_alg2() 56 XFREE(hmac); in pkcs_5_alg2() 78 if ((err = hmac_init(hmac, hash_idx, password, password_len)) != CRYPT_OK) { in pkcs_5_alg2() 81 if ((err = hmac_process(hmac, salt, salt_len)) != CRYPT_OK) { in pkcs_5_alg2() 84 if ((err = hmac_process(hmac, buf[1], 4)) != CRYPT_OK) { in pkcs_5_alg2() 88 if ((err = hmac_done(hmac, buf[0], &x)) != CRYPT_OK) { in pkcs_5_alg2() 115 zeromem(hmac, sizeof(hmac_state)); in pkcs_5_alg2() [all …]
|
/external/smack/src/org/xbill/DNS/ |
D | TSIG.java | 218 HMAC hmac = null; in generate() local 220 hmac = new HMAC(digest, digestBlockLength, key); in generate() 229 if (hmac != null) { in generate() 230 hmac.update(out.toByteArray()); in generate() 231 hmac.update(old.getSignature()); in generate() 236 if (hmac != null) in generate() 237 hmac.update(b); in generate() 254 if (hmac != null) in generate() 255 hmac.update(out.toByteArray()); in generate() 258 if (hmac != null) in generate() [all …]
|
/external/wpa_supplicant_8/src/tls/ |
D | tlsv1_record.c | 155 struct crypto_hash *hmac; in tlsv1_record_send() local 207 hmac = crypto_hash_init(rl->hash_alg, rl->write_mac_secret, in tlsv1_record_send() 209 if (hmac == NULL) { in tlsv1_record_send() 214 crypto_hash_update(hmac, rl->write_seq_num, TLS_SEQ_NUM_LEN); in tlsv1_record_send() 216 crypto_hash_update(hmac, ct_start, TLS_RECORD_HEADER_LEN); in tlsv1_record_send() 217 crypto_hash_update(hmac, payload, payload_len); in tlsv1_record_send() 222 crypto_hash_finish(hmac, NULL, NULL); in tlsv1_record_send() 226 if (crypto_hash_finish(hmac, pos, &clen) < 0) { in tlsv1_record_send() 284 struct crypto_hash *hmac; in tlsv1_record_receive() local 436 hmac = crypto_hash_init(rl->hash_alg, rl->read_mac_secret, in tlsv1_record_receive() [all …]
|
/external/chromium_org/third_party/openssl/openssl/crypto/pkcs12/ |
D | p12_mutl.c | 71 HMAC_CTX hmac; in PKCS12_gen_mac() local 99 HMAC_CTX_init(&hmac); in PKCS12_gen_mac() 100 if (!HMAC_Init_ex(&hmac, key, md_size, md_type, NULL) in PKCS12_gen_mac() 101 || !HMAC_Update(&hmac, p12->authsafes->d.data->data, in PKCS12_gen_mac() 103 || !HMAC_Final(&hmac, mac, maclen)) in PKCS12_gen_mac() 105 HMAC_CTX_cleanup(&hmac); in PKCS12_gen_mac() 108 HMAC_CTX_cleanup(&hmac); in PKCS12_gen_mac()
|
/external/openssl/crypto/pkcs12/ |
D | p12_mutl.c | 71 HMAC_CTX hmac; in PKCS12_gen_mac() local 99 HMAC_CTX_init(&hmac); in PKCS12_gen_mac() 100 if (!HMAC_Init_ex(&hmac, key, md_size, md_type, NULL) in PKCS12_gen_mac() 101 || !HMAC_Update(&hmac, p12->authsafes->d.data->data, in PKCS12_gen_mac() 103 || !HMAC_Final(&hmac, mac, maclen)) in PKCS12_gen_mac() 105 HMAC_CTX_cleanup(&hmac); in PKCS12_gen_mac() 108 HMAC_CTX_cleanup(&hmac); in PKCS12_gen_mac()
|
/external/chromium/chrome/browser/sync/util/ |
D | nigori.cc | 146 HMAC hmac(HMAC::SHA256); in Permute() local 147 if (!hmac.Init(raw_mac_key)) in Permute() 151 if (!hmac.Sign(ciphertext, &hash[0], hash.size())) in Permute() 187 HMAC hmac(HMAC::SHA256); in Encrypt() local 188 if (!hmac.Init(raw_mac_key)) in Encrypt() 192 if (!hmac.Sign(ciphertext, &hash[0], hash.size())) in Encrypt() 224 HMAC hmac(HMAC::SHA256); in Decrypt() local 225 if (!hmac.Init(raw_mac_key)) in Decrypt() 229 if (!hmac.Sign(ciphertext, &expected[0], expected.size())) in Decrypt()
|
/external/chromium_org/sync/util/ |
D | nigori.cc | 141 HMAC hmac(HMAC::SHA256); in Permute() local 142 if (!hmac.Init(raw_mac_key)) in Permute() 146 if (!hmac.Sign(ciphertext, &hash[0], hash.size())) in Permute() 177 HMAC hmac(HMAC::SHA256); in Encrypt() local 178 if (!hmac.Init(raw_mac_key)) in Encrypt() 182 if (!hmac.Sign(ciphertext, &hash[0], hash.size())) in Encrypt() 215 HMAC hmac(HMAC::SHA256); in Decrypt() local 216 if (!hmac.Init(raw_mac_key)) in Decrypt() 220 if (!hmac.Sign(ciphertext, &expected[0], expected.size())) in Decrypt()
|
/external/chromium_org/content/public/browser/ |
D | media_device_id.cc | 18 crypto::HMAC hmac(crypto::HMAC::SHA256); in GetHMACForMediaDeviceID() local 19 const size_t digest_length = hmac.DigestLength(); in GetHMACForMediaDeviceID() 22 bool result = hmac.Init(security_origin.spec()) && in GetHMACForMediaDeviceID() 23 hmac.Sign(raw_unique_id + salt, &digest[0], digest.size()); in GetHMACForMediaDeviceID()
|
/external/srtp/crypto/hash/ |
D | hmac.c | 58 extern auth_type_t hmac; in hmac_alloc() 82 (*a)->type = &hmac; in hmac_alloc() 89 hmac.ref_count++; in hmac_alloc() 96 extern auth_type_t hmac; in hmac_dealloc() 106 hmac.ref_count--; in hmac_dealloc() 255 hmac = { variable
|
/external/chromium_org/chrome/browser/extensions/api/music_manager_private/ |
D | device_id.cc | 21 crypto::HMAC hmac(crypto::HMAC::SHA256); in ComputeHmacSha256() local 22 const size_t digest_length = hmac.DigestLength(); in ComputeHmacSha256() 24 bool result = hmac.Init(key) && in ComputeHmacSha256() 25 hmac.Sign(text, &digest[0], digest.size()); in ComputeHmacSha256()
|
/external/chromium_org/google_apis/cup/ |
D | client_update_protocol.cc | 73 crypto::HMAC hmac(crypto::HMAC::SHA1); in SymSign() local 74 if (!hmac.Init(&key[0], key.size())) in SymSign() 77 std::vector<uint8> result(hmac.DigestLength()); in SymSign() 78 if (!hmac.Sign(ByteVectorToSP(hashes), &result[0], result.size())) in SymSign() 91 crypto::HMAC hmac(crypto::HMAC::SHA1); in SymSignVerify() local 92 if (!hmac.Init(&key[0], key.size())) in SymSignVerify() 95 return hmac.Verify(ByteVectorToSP(hashes), ByteVectorToSP(server_proof)); in SymSignVerify()
|
/external/dropbear/ |
D | packet.c | 318 hmac_state hmac; in checkmac() local 329 if (hmac_init(&hmac, in checkmac() 339 if (hmac_process(&hmac, tempbuf, 4) != CRYPT_OK) { in checkmac() 345 if (hmac_process(&hmac, buf_getptr(sourcebuf, len), len) != CRYPT_OK) { in checkmac() 350 if (hmac_done(&hmac, tempbuf, &bufsize) != CRYPT_OK) { in checkmac() 526 hmac_state hmac; in writemac() local 533 if (hmac_init(&hmac, in writemac() 542 if (hmac_process(&hmac, seqbuf, 4) != CRYPT_OK) { in writemac() 548 if (hmac_process(&hmac, in writemac() 556 if (hmac_done(&hmac, tempbuf, &bufsize) in writemac()
|
/external/chromium_org/third_party/libjingle/source/talk/p2p/base/ |
D | stun.cc | 210 char hmac[kStunMessageIntegritySize]; in ValidateMessageIntegrity() local 214 hmac, sizeof(hmac)); in ValidateMessageIntegrity() 215 ASSERT(ret == sizeof(hmac)); in ValidateMessageIntegrity() 216 if (ret != sizeof(hmac)) in ValidateMessageIntegrity() 221 hmac, sizeof(hmac)) == 0); in ValidateMessageIntegrity() 244 char hmac[kStunMessageIntegritySize]; in AddMessageIntegrity() local 248 hmac, sizeof(hmac)); in AddMessageIntegrity() 249 ASSERT(ret == sizeof(hmac)); in AddMessageIntegrity() 250 if (ret != sizeof(hmac)) { in AddMessageIntegrity() 257 msg_integrity_attr->CopyBytes(hmac, sizeof(hmac)); in AddMessageIntegrity()
|
/external/openssh/ |
D | ssh_config | 41 # MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
|
/external/wpa_supplicant_8/src/eap_common/ |
D | eap_sim_common.c | 168 unsigned char hmac[SHA1_MAC_LEN]; in eap_sim_verify_mac() local 196 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac); in eap_sim_verify_mac() 198 hmac, EAP_SIM_MAC_LEN); in eap_sim_verify_mac() 201 return (os_memcmp(hmac, mac, EAP_SIM_MAC_LEN) == 0) ? 0 : 1; in eap_sim_verify_mac() 208 unsigned char hmac[SHA1_MAC_LEN]; in eap_sim_add_mac() local 224 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac); in eap_sim_add_mac() 225 os_memcpy(mac, hmac, EAP_SIM_MAC_LEN); in eap_sim_add_mac() 363 unsigned char hmac[SHA256_MAC_LEN]; in eap_sim_verify_mac_sha256() local 391 hmac_sha256_vector(k_aut, EAP_AKA_PRIME_K_AUT_LEN, 2, addr, len, hmac); in eap_sim_verify_mac_sha256() 393 hmac, EAP_SIM_MAC_LEN); in eap_sim_verify_mac_sha256() [all …]
|
/external/dropbear/libtomcrypt/ |
D | Android.mk | 31 src/mac/hmac/hmac_done.c src/mac/hmac/hmac_file.c src/mac/hmac/hmac_init.c src/mac/hmac/hmac_memory… 32 src/mac/hmac/hmac_memory_multi.c src/mac/hmac/hmac_process.c src/mac/hmac/hmac_test.c \
|