Home
last modified time | relevance | path

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

12345

/third_party/glib/glib/
Dghmac.c98 GHmac *hmac; in g_hmac_new() local
124 hmac = g_slice_new0 (GHmac); in g_hmac_new()
125 hmac->ref_count = 1; in g_hmac_new()
126 hmac->digest_type = digest_type; in g_hmac_new()
127 hmac->digesti = checksum; in g_hmac_new()
128 hmac->digesto = g_checksum_new (digest_type); in g_hmac_new()
139 g_checksum_update (hmac->digesti, key, key_len); in g_hmac_new()
140 g_checksum_get_digest (hmac->digesti, buffer, &len); in g_hmac_new()
141 g_checksum_reset (hmac->digesti); in g_hmac_new()
153 g_checksum_update (hmac->digesti, pad, block_size); in g_hmac_new()
[all …]
Dghmac.h47 GHmac * g_hmac_copy (const GHmac *hmac);
49 GHmac * g_hmac_ref (GHmac *hmac);
51 void g_hmac_unref (GHmac *hmac);
53 void g_hmac_update (GHmac *hmac,
57 const gchar * g_hmac_get_string (GHmac *hmac);
59 void g_hmac_get_digest (GHmac *hmac,
/third_party/node/test/parallel/
Dtest-crypto-hmac.js58 const hmac = crypto.createHmac(algo, keyWrapper(key));
60 hmac.update(chunk);
61 const actual = hmac.digest('hex');
76 hmac: { // HMACs lifted from Wikipedia. property
86 hmac: { // Intermediate test to help debugging. property
96 hmac: { // Intermediate test to help debugging. property
106 hmac: { // HMACs lifted from Wikipedia. property
116 for (const { key, data, hmac } of wikipedia) { field
117 for (const hash in hmac)
118 testHmac(hash, key, data, hmac[hash]);
[all …]
Dtest-crypto-binary-default.js79 hmac: { property
97 hmac: { property
116 hmac: { property
136 hmac: { property
154 hmac: { property
173 hmac: { property
204 hmac: { property
221 for (const hash in testCase.hmac) {
229 testCase.hmac[hash],
242 hmac: '9294727a3638bb1c13f48ef8158bfc9d' property
[all …]
Dtest-https-resume-after-renew.js21 const hmac = Buffer.alloc(16, 'H'); constant
28 return [ 1, hmac, aes, newName, newIV ];
31 return [ 2, hmac, aes ];
Dtest-crypto-update-encoding.js16 const hmac = () => crypto.createHmac('sha256', key); function
20 for (const f of [cipher, decipher, hash, hmac, sign, verify])
/third_party/ffmpeg/libavutil/tests/
Dhmac.c24 static void test(AVHMAC *hmac, const uint8_t *key, int keylen, in test() argument
35 out = av_hmac_calc(hmac, data, datalen, key, keylen, buf, sizeof(buf)); in test()
44 AVHMAC *hmac; in main() local
60 hmac = av_hmac_alloc(i); in main()
61 if (!hmac) in main()
64 test(hmac, key1, hmac->hashlen, data1, sizeof(data1)); in main()
65 test(hmac, key2, sizeof(key2), data2, sizeof(data2)); in main()
66 test(hmac, key3, hmac->hashlen, data3, sizeof(data3)); in main()
67 test(hmac, key3, 80, data4, sizeof(data4)); in main()
68 test(hmac, key3, 80, data5, sizeof(data5)); in main()
[all …]
/third_party/glib/glib/tests/
Dhmac.c398 GHmac *hmac; in test_hmac() local
405 hmac = g_hmac_new (t->digest_type, t->key, t->key_len); in test_hmac()
406 g_hmac_update (hmac, t->data, t->data_len); in test_hmac()
407 g_hmac_get_digest (hmac, digest, &digest_len); in test_hmac()
412 g_hmac_unref (hmac); in test_hmac()
418 GHmac *hmac, *check; in test_hmac_ref_unref() local
420 hmac = g_hmac_new (G_CHECKSUM_SHA1, (guchar*)"aaa", 3); in test_hmac_ref_unref()
421 check = g_hmac_ref (hmac); in test_hmac_ref_unref()
422 g_assert (check == hmac); in test_hmac_ref_unref()
424 g_hmac_unref (hmac); in test_hmac_ref_unref()
[all …]
/third_party/mbedtls/library/
Dpsa_crypto_mac.c35 mbedtls_psa_hmac_operation_t *hmac ) in psa_hmac_abort_internal() argument
37 mbedtls_platform_zeroize( hmac->opad, sizeof( hmac->opad ) ); in psa_hmac_abort_internal()
38 return( psa_hash_abort( &hmac->hash_ctx ) ); in psa_hmac_abort_internal()
42 mbedtls_psa_hmac_operation_t *hmac, in psa_hmac_setup_internal() argument
53 hmac->alg = hash_alg; in psa_hmac_setup_internal()
63 if( block_size > sizeof( hmac->opad ) ) in psa_hmac_setup_internal()
91 hmac->opad[i] = ipad[i] ^ 0x36 ^ 0x5C; in psa_hmac_setup_internal()
92 memset( hmac->opad + key_length, 0x5C, block_size - key_length ); in psa_hmac_setup_internal()
94 status = psa_hash_setup( &hmac->hash_ctx, hash_alg ); in psa_hmac_setup_internal()
98 status = psa_hash_update( &hmac->hash_ctx, ipad, block_size ); in psa_hmac_setup_internal()
[all …]
/third_party/ffmpeg/libavformat/
Drtmpdigest.c37 AVHMAC *hmac; in ff_rtmp_calc_digest() local
39 hmac = av_hmac_alloc(AV_HMAC_SHA256); in ff_rtmp_calc_digest()
40 if (!hmac) in ff_rtmp_calc_digest()
43 av_hmac_init(hmac, key, keylen); in ff_rtmp_calc_digest()
45 av_hmac_update(hmac, src, len); in ff_rtmp_calc_digest()
47 av_hmac_update(hmac, src, gap); in ff_rtmp_calc_digest()
48 av_hmac_update(hmac, src + gap + 32, len - gap - 32); in ff_rtmp_calc_digest()
50 av_hmac_final(hmac, dst, 32); in ff_rtmp_calc_digest()
52 av_hmac_free(hmac); in ff_rtmp_calc_digest()
Dsrtp.c36 if (s->hmac) in ff_srtp_free()
37 av_hmac_free(s->hmac); in ff_srtp_free()
38 s->hmac = NULL; in ff_srtp_free()
93 s->hmac = av_hmac_alloc(AV_HMAC_SHA1); in ff_srtp_set_crypto()
94 if (!s->aes || !s->hmac) in ff_srtp_set_crypto()
128 uint8_t iv[16] = { 0 }, hmac[20]; in ff_srtp_decrypt() local
147 av_hmac_init(s->hmac, rtcp ? s->rtcp_auth : s->rtp_auth, sizeof(s->rtp_auth)); in ff_srtp_decrypt()
149 av_hmac_update(s->hmac, buf, len - hmac_size); in ff_srtp_decrypt()
175 av_hmac_update(s->hmac, rocbuf, 4); in ff_srtp_decrypt()
178 av_hmac_final(s->hmac, hmac, sizeof(hmac)); in ff_srtp_decrypt()
[all …]
/third_party/python/Lib/test/
Dtest_hmac.py3 import hmac
54 h = hmac.HMAC(key, data, digestmod=hashfunc)
59 h = hmac.HMAC(key, data, digestmod=hashname)
64 h = hmac.HMAC(key, digestmod=hashname)
70 h = hmac.new(key, data, digestmod=hashname)
75 h = hmac.new(key, None, digestmod=hashname)
79 h = hmac.new(key, digestmod=hashname)
83 h = hmac.new(key, data, digestmod=hashfunc)
87 hmac.digest(key, data, digest=hashname),
91 hmac.digest(key, data, digest=hashfunc),
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9/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 …]
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/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 …]
/third_party/node/test/common/
Dtls.js154 let hmac = crypto.createHmac(algo, secret);
155 hmac.update(seed);
156 let a = hmac.digest();
159 hmac = crypto.createHmac(algo, secret);
160 hmac.update(a);
161 hmac.update(seed);
162 const b = hmac.digest();
169 hmac = crypto.createHmac(algo, secret);
170 hmac.update(a);
171 a = hmac.digest();
/third_party/grpc/src/core/tsi/alts/crypt/
Daes_gcm.cc189 HMAC_CTX hmac; in aes_gcm_derive_aead_key() local
190 HMAC_CTX_init(&hmac); in aes_gcm_derive_aead_key()
191 if (!HMAC_Init_ex(&hmac, kdf_key, kKdfKeyLen, EVP_sha256(), nullptr) || in aes_gcm_derive_aead_key()
192 !HMAC_Update(&hmac, kdf_counter, kKdfCounterLen) || in aes_gcm_derive_aead_key()
193 !HMAC_Update(&hmac, &ctr, 1) || !HMAC_Final(&hmac, buf, nullptr)) { in aes_gcm_derive_aead_key()
194 HMAC_CTX_cleanup(&hmac); in aes_gcm_derive_aead_key()
197 HMAC_CTX_cleanup(&hmac); in aes_gcm_derive_aead_key()
199 HMAC_CTX* hmac = HMAC_CTX_new(); in aes_gcm_derive_aead_key() local
200 if (hmac == nullptr) { in aes_gcm_derive_aead_key()
203 if (!HMAC_Init_ex(hmac, kdf_key, kKdfKeyLen, EVP_sha256(), nullptr) || in aes_gcm_derive_aead_key()
[all …]
/third_party/openssl/crypto/kdf/
Dhkdf.c295 HMAC_CTX *hmac; in HKDF_Expand() local
311 if ((hmac = HMAC_CTX_new()) == NULL) in HKDF_Expand()
314 if (!HMAC_Init_ex(hmac, prk, prk_len, evp_md, NULL)) in HKDF_Expand()
322 if (!HMAC_Init_ex(hmac, NULL, 0, NULL, NULL)) in HKDF_Expand()
325 if (!HMAC_Update(hmac, prev, dig_len)) in HKDF_Expand()
329 if (!HMAC_Update(hmac, info, info_len)) in HKDF_Expand()
332 if (!HMAC_Update(hmac, &ctr, 1)) in HKDF_Expand()
335 if (!HMAC_Final(hmac, prev, NULL)) in HKDF_Expand()
350 HMAC_CTX_free(hmac); in HKDF_Expand()
/third_party/libwebsockets/lib/tls/mbedtls/
Dlws-genhash.c274 ctx->hmac = mbedtls_md_info_from_type((mbedtls_md_type_t)t); in lws_genhmac_init()
275 if (!ctx->hmac) in lws_genhmac_init()
279 if (mbedtls_md_init_ctx(&ctx->ctx, ctx->hmac)) in lws_genhmac_init()
282 if (mbedtls_md_setup(&ctx->ctx, ctx->hmac, 1)) in lws_genhmac_init()
288 ctx->hmac = NULL; in lws_genhmac_init()
317 ctx->hmac = NULL; in lws_genhmac_destroy()
/third_party/openssl/crypto/pkcs12/
Dp12_mutl.c80 HMAC_CTX *hmac = NULL; in pkcs12_gen_mac() local
128 if ((hmac = HMAC_CTX_new()) == NULL in pkcs12_gen_mac()
129 || !HMAC_Init_ex(hmac, key, md_size, md_type, NULL) in pkcs12_gen_mac()
130 || !HMAC_Update(hmac, p12->authsafes->d.data->data, in pkcs12_gen_mac()
132 || !HMAC_Final(hmac, mac, maclen)) { in pkcs12_gen_mac()
139 HMAC_CTX_free(hmac); in pkcs12_gen_mac()
/third_party/python/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
42 the same meaning as in :func:`~hmac.new`.
55 Update the hmac object with *msg*. Repeated calls are equivalent to a
94 Return a copy ("clone") of the hmac object. This can be used to efficiently
112 The canonical name of this HMAC, always lowercase, e.g. ``hmac-md5``.
/third_party/node/lib/internal/crypto/
Dhash.js107 function Hmac(hmac, key, options) { argument
109 return new Hmac(hmac, key, options);
110 validateString(hmac, 'hmac');
113 this[kHandle].init(hmac, toBuf(key));
/third_party/node/deps/npm/node_modules/http-signature/lib/
Dverify.js62 var hmac = crypto.createHmac(hashAlg, secret); variable
63 hmac.update(parsedSignature.signingString);
73 h1.update(hmac.digest());
/third_party/node/deps/npm/node_modules/aws4/
Daws4.js10 function hmac(key, string, encoding) { function
182 kDate = hmac('AWS4' + this.credentials.secretAccessKey, date)
183 kRegion = hmac(kDate, this.region)
184 kService = hmac(kRegion, this.service)
185 kCredentials = hmac(kService, 'aws4_request')
188 return hmac(kCredentials, this.stringToSign(), 'hex')
/third_party/libwebsockets/lib/cose/
Dcose_sign_alg.c91 goto hmac; in lws_cose_sign_alg_create()
95 goto hmac; in lws_cose_sign_alg_create()
99 goto hmac; in lws_cose_sign_alg_create()
104 hmac: in lws_cose_sign_alg_create()
/third_party/wpa_supplicant/wpa_supplicant-2.9/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 …]

12345