Home
last modified time | relevance | path

Searched refs:hmac (Results 1 – 25 of 103) sorted by relevance

12345

/external/python/cpython2/Lib/test/
Dtest_hmac.py3 import hmac
15 h = hmac.HMAC(key, data)
49 h = hmac.HMAC(key, data, digestmod=hashlib.sha1)
83 h = hmac.HMAC(key, data, digestmod=hashfunc)
219 hmac.HMAC('a', 'b', digestmod=MockCrazyHash)
224 hmac.HMAC('a', 'b', digestmod=MockCrazyHash)
235 h = hmac.HMAC("key")
242 h = hmac.HMAC("key", "hash this!")
249 h = hmac.HMAC("key", "", hashlib.sha1)
258 h = hmac.HMAC("key")
[all …]
/external/python/cpython3/Lib/test/
Dtest_hmac.py3 import hmac
26 h = hmac.HMAC(key, data, digestmod=hashlib.md5)
33 h = hmac.HMAC(key, data, digestmod='md5')
41 hmac.digest(key, data, digest='md5'),
46 hmac.digest(key, data, digest='md5'),
81 h = hmac.HMAC(key, data, digestmod=hashlib.sha1)
88 h = hmac.HMAC(key, data, digestmod='sha1')
96 hmac.digest(key, data, digest='sha1'),
133 h = hmac.HMAC(key, data, digestmod=hashfunc)
139 h = hmac.HMAC(key, data, digestmod=hash_name)
[all …]
/external/libchrome/crypto/
Dhmac_unittest.cc80 crypto::HMAC hmac(crypto::HMAC::SHA1); in TEST() local
81 ASSERT_TRUE(hmac.Init(kClientKey, kKeySize)); in TEST()
84 EXPECT_TRUE(hmac.Sign(message_data, calculated_hmac, kSHA1DigestSize)); in TEST()
149 crypto::HMAC hmac(crypto::HMAC::SHA1); in TEST() local
150 ASSERT_TRUE(hmac.Init(reinterpret_cast<const unsigned char*>(cases[i].key), in TEST()
154 EXPECT_TRUE(hmac.Sign(data_string, digest, kSHA1DigestSize)); in TEST()
175 crypto::HMAC hmac(crypto::HMAC::SHA256); in TEST() local
176 ASSERT_TRUE(hmac.Init(key, sizeof(key))); in TEST()
179 EXPECT_EQ(kSHA256DigestSize, hmac.DigestLength()); in TEST()
180 EXPECT_TRUE(hmac.Sign(data, calculated_hmac, kSHA256DigestSize)); in TEST()
[all …]
/external/boringssl/src/ssl/test/runner/
Dhkdf.go27 hmac := hmac.New(hash, salt)
28 hmac.Write(ikm)
29 return hmac.Sum(nil)
44 hmac := hmac.New(hash, prk)
46 hmac.Reset()
48 hmac.Write(lastBlock)
49 hmac.Write(info)
50 hmac.Write([]byte{counter})
51 block := hmac.Sum(nil)
/external/tcpdump/tests/
Dikev2pI2.out6 (t: #2 type=integ id=hmac-sha )
7 (t: #3 type=prf id=hmac-sha )
11 (t: #2 type=integ id=hmac-sha )
12 (t: #3 type=prf id=hmac-md5 )
16 (t: #2 type=integ id=hmac-sha )
17 (t: #3 type=prf id=hmac-sha )
21 (t: #2 type=integ id=hmac-sha )
22 (t: #3 type=prf id=hmac-md5 )
26 (t: #2 type=integ id=hmac-sha )
27 (t: #3 type=prf id=hmac-sha )
[all …]
Dikev2four.out9 (t: #5 type=prf id=hmac-sha )
10 (t: #6 type=prf id=hmac-md5 )
12 (t: #8 type=integ id=hmac-sha )
13 (t: #9 type=integ id=hmac-md5 )
33 (t: #5 type=prf id=hmac-sha )
34 (t: #6 type=prf id=hmac-md5 )
36 (t: #8 type=integ id=hmac-sha )
37 (t: #9 type=integ id=hmac-md5 )
50 (t: #2 type=prf id=hmac-sha )
51 (t: #3 type=integ id=hmac-sha )
Dikev2fourv4.out9 (t: #5 type=prf id=hmac-sha )
10 (t: #6 type=prf id=hmac-md5 )
12 (t: #8 type=integ id=hmac-sha )
13 (t: #9 type=integ id=hmac-md5 )
33 (t: #5 type=prf id=hmac-sha )
34 (t: #6 type=prf id=hmac-md5 )
36 (t: #8 type=integ id=hmac-sha )
37 (t: #9 type=integ id=hmac-md5 )
50 (t: #2 type=prf id=hmac-sha )
51 (t: #3 type=integ id=hmac-sha )
Dikev2fourv.out9 (t: #5 type=prf id=hmac-sha )
10 (t: #6 type=prf id=hmac-md5 )
12 (t: #8 type=integ id=hmac-sha )
13 (t: #9 type=integ id=hmac-md5 )
33 (t: #5 type=prf id=hmac-sha )
34 (t: #6 type=prf id=hmac-md5 )
36 (t: #8 type=integ id=hmac-sha )
37 (t: #9 type=integ id=hmac-md5 )
50 (t: #2 type=prf id=hmac-sha )
51 (t: #3 type=integ id=hmac-sha )
Dikev2pI2-segfault-v.out6 (t: #2 type=integ id=hmac-sha )
7 (t: #3 type=prf id=hmac-sha )
/external/boringssl/src/crypto/hkdf/
Dhkdf.c68 HMAC_CTX hmac; in HKDF_expand() local
77 HMAC_CTX_init(&hmac); in HKDF_expand()
78 if (!HMAC_Init_ex(&hmac, prk, prk_len, digest, NULL)) { in HKDF_expand()
86 if (i != 0 && (!HMAC_Init_ex(&hmac, NULL, 0, NULL, NULL) || in HKDF_expand()
87 !HMAC_Update(&hmac, previous, digest_len))) { in HKDF_expand()
90 if (!HMAC_Update(&hmac, info, info_len) || in HKDF_expand()
91 !HMAC_Update(&hmac, &ctr, 1) || in HKDF_expand()
92 !HMAC_Final(&hmac, previous, NULL)) { in HKDF_expand()
107 HMAC_CTX_cleanup(&hmac); in HKDF_expand()
/external/wpa_supplicant_8/src/tls/
Dtlsv1_record.c155 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/bouncycastle/bcpkix/src/main/java/org/bouncycastle/cms/
DPasswordRecipient.java21 private final String hmac; field in PasswordRecipient.PRF
24 private PRF(String hmac, AlgorithmIdentifier prfAlgID) in PRF() argument
26 this.hmac = hmac; in PRF()
32 return hmac; in getName()
/external/grpc-grpc/src/core/tsi/alts/crypt/
Daes_gcm.cc191 HMAC_CTX hmac; in aes_gcm_derive_aead_key() local
192 HMAC_CTX_init(&hmac); in aes_gcm_derive_aead_key()
193 if (!HMAC_Init_ex(&hmac, kdf_key, kKdfKeyLen, EVP_sha256(), nullptr) || in aes_gcm_derive_aead_key()
194 !HMAC_Update(&hmac, kdf_counter, kKdfCounterLen) || in aes_gcm_derive_aead_key()
195 !HMAC_Update(&hmac, &ctr, 1) || !HMAC_Final(&hmac, buf, nullptr)) { in aes_gcm_derive_aead_key()
196 HMAC_CTX_cleanup(&hmac); in aes_gcm_derive_aead_key()
199 HMAC_CTX_cleanup(&hmac); in aes_gcm_derive_aead_key()
201 HMAC_CTX* hmac = HMAC_CTX_new(); in aes_gcm_derive_aead_key() local
202 if (hmac == nullptr) { in aes_gcm_derive_aead_key()
205 if (!HMAC_Init_ex(hmac, kdf_key, kKdfKeyLen, EVP_sha256(), nullptr) || in aes_gcm_derive_aead_key()
[all …]
/external/python/cpython3/Doc/library/
Dhmac.rst1 :mod:`hmac` --- Keyed-Hashing for Message Authentication
4 .. module:: hmac
10 **Source code:** :source:`Lib/hmac.py`
19 Return a new hmac object. *key* is a bytes or bytearray object giving the
40 the same meaning as in :func:`~hmac.new`.
53 Update the hmac object with *msg*. Repeated calls are equivalent to a
92 Return a copy ("clone") of the hmac object. This can be used to efficiently
110 The canonical name of this HMAC, always lowercase, e.g. ``hmac-md5``.
/external/python/cpython2/Doc/library/
Dhmac.rst1 :mod:`hmac` --- Keyed-Hashing for Message Authentication
4 .. module:: hmac
12 **Source code:** :source:`Lib/hmac.py`
21 Return a new hmac object. If *msg* is present, the method call ``update(msg)``
30 Update the hmac object with the string *msg*. Repeated calls are equivalent to
65 Return a copy ("clone") of the hmac object. This can be used to efficiently
/external/rappor/client/java/com/google/android/rappor/
DHmacDrbg.java32 private Mac hmac; field in HmacDrbg
118 hmac = Mac.getInstance("HmacSHA256"); in setKey()
120 hmac.init(secretKey); in setKey()
132 return hmac.doFinal(x); in hash()
/external/webrtc/webrtc/p2p/base/
Dstun.cc193 char hmac[kStunMessageIntegritySize]; in ValidateMessageIntegrity() local
197 hmac, sizeof(hmac)); in ValidateMessageIntegrity()
198 ASSERT(ret == sizeof(hmac)); in ValidateMessageIntegrity()
199 if (ret != sizeof(hmac)) in ValidateMessageIntegrity()
204 hmac, in ValidateMessageIntegrity()
205 sizeof(hmac)) == 0; in ValidateMessageIntegrity()
228 char hmac[kStunMessageIntegritySize]; in AddMessageIntegrity() local
232 hmac, sizeof(hmac)); in AddMessageIntegrity()
233 ASSERT(ret == sizeof(hmac)); in AddMessageIntegrity()
234 if (ret != sizeof(hmac)) { in AddMessageIntegrity()
[all …]
/external/u-boot/board/gdsys/p1022/
Dcontrolcenterd-id.c733 static int check_hmac(struct key_program *hmac, in check_hmac() argument
739 type = get_unaligned_be32(hmac->code); in check_hmac()
750 return memcmp(computed_hmac, hmac->code + 4, 20); in check_hmac()
772 struct key_program *result = NULL, *hmac = NULL; in load_sd_key_program() local
826 hmac = malloc(sizeof(struct key_program) + header.code_size); in load_sd_key_program()
827 if (!hmac) in load_sd_key_program()
829 *hmac = header; in load_sd_key_program()
831 if (ccdm_mmc_read(mmc, code_offset, hmac->code, in load_sd_key_program()
832 hmac->code_size) < 0) in load_sd_key_program()
834 if (verify_program(hmac)) in load_sd_key_program()
[all …]
/external/python/oauth2client/tests/contrib/
Dtest_xsrfutil.py54 with mock.patch('oauth2client.contrib.xsrfutil.hmac') as hmac:
55 hmac.new = mock.MagicMock(name='new', return_value=digester)
60 hmac.new.assert_called_once_with(TEST_KEY)
83 with mock.patch('oauth2client.contrib.xsrfutil.hmac') as hmac:
84 hmac.new = mock.MagicMock(name='new', return_value=digester)
93 hmac.new.assert_called_once_with(TEST_KEY)
/external/wpa_supplicant_8/src/eap_common/
Deap_sim_common.c168 unsigned char hmac[SHA1_MAC_LEN]; in eap_sim_verify_mac() local
195 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac); in eap_sim_verify_mac()
197 hmac, EAP_SIM_MAC_LEN); in eap_sim_verify_mac()
200 return (os_memcmp_const(hmac, mac, EAP_SIM_MAC_LEN) == 0) ? 0 : 1; in eap_sim_verify_mac()
207 unsigned char hmac[SHA1_MAC_LEN]; in eap_sim_add_mac() local
223 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac); in eap_sim_add_mac()
224 os_memcpy(mac, hmac, EAP_SIM_MAC_LEN); in eap_sim_add_mac()
362 unsigned char hmac[SHA256_MAC_LEN]; in eap_sim_verify_mac_sha256() local
389 hmac_sha256_vector(k_aut, EAP_AKA_PRIME_K_AUT_LEN, 2, addr, len, hmac); in eap_sim_verify_mac_sha256()
391 hmac, EAP_SIM_MAC_LEN); in eap_sim_verify_mac_sha256()
[all …]
/external/u-boot/board/gdsys/a38x/
Dkeyprogram.c107 struct key_program *result = NULL, *hmac = NULL; in parse_and_check_keyprog() local
116 if (extract_subprogram(&progdata, MAGIC_HMAC, &hmac)) in parse_and_check_keyprog()
119 free(hmac); in parse_and_check_keyprog()
/external/iproute2/ip/
Diproute_lwtunnel.c418 static struct ipv6_sr_hdr *parse_srh(char *segbuf, int hmac, bool encap) in parse_srh() argument
435 if (hmac) in parse_srh()
446 if (hmac) in parse_srh()
455 if (hmac) { in parse_srh()
461 tlv->hmackeyid = htonl(hmac); in parse_srh()
477 __u32 hmac = 0; in parse_encap_seg6() local
501 get_u32(&hmac, *argv, 0); in parse_encap_seg6()
508 srh = parse_srh(segbuf, hmac, encap); in parse_encap_seg6()
541 __u32 hmac = 0; in parse_encap_seg6local() local
607 get_u32(&hmac, *argv, 0); in parse_encap_seg6local()
[all …]
/external/boringssl/src/crypto/fipsmodule/tls/
Dkdf.c94 uint8_t hmac[EVP_MAX_MD_SIZE]; in tls1_P_hash() local
102 !HMAC_Final(&ctx, hmac, &len)) { in tls1_P_hash()
112 out[i] ^= hmac[i]; in tls1_P_hash()
/external/openssh/
Dssh_config43 # MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
/external/scapy/scapy/contrib/
Dcarp.py18 import struct, hmac, hashlib
59 h = hmac.new(pw, digestmod = hashlib.sha1)

12345