/third_party/openssl/providers/implementations/rands/ |
D | drbg_hmac.c | 57 static int do_hmac(PROV_DRBG_HMAC *hmac, unsigned char inbyte, in do_hmac() argument 62 EVP_MAC_CTX *ctx = hmac->ctx; in do_hmac() 64 if (!EVP_MAC_init(ctx, hmac->K, hmac->blocklen, NULL) in do_hmac() 66 || !EVP_MAC_update(ctx, hmac->V, hmac->blocklen) in do_hmac() 71 || !EVP_MAC_final(ctx, hmac->K, NULL, sizeof(hmac->K))) in do_hmac() 75 return EVP_MAC_init(ctx, hmac->K, hmac->blocklen, NULL) in do_hmac() 76 && EVP_MAC_update(ctx, hmac->V, hmac->blocklen) in do_hmac() 77 && EVP_MAC_final(ctx, hmac->V, NULL, sizeof(hmac->V)); in do_hmac() 99 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data; in drbg_hmac_update() local 102 if (!do_hmac(hmac, 0x00, in1, in1len, in2, in2len, in3, in3len)) in drbg_hmac_update() [all …]
|
/third_party/node/test/parallel/ |
D | test-crypto-hmac.js | 58 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 …]
|
D | test-crypto-binary-default.js | 79 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 …]
|
D | test-https-resume-after-renew.js | 21 const hmac = Buffer.alloc(16, 'H'); constant 28 return [ 1, hmac, aes, newName, newIV ]; 31 return [ 2, hmac, aes ];
|
D | test-crypto-update-encoding.js | 16 const hmac = () => crypto.createHmac('sha256', key); function 20 for (const f of [cipher, decipher, hash, hmac, sign, verify])
|
/third_party/ffmpeg/libavutil/tests/ |
D | hmac.c | 24 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/mbedtls/library/ |
D | psa_crypto_mac.c | 35 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/python/Lib/test/ |
D | test_hmac.py | 3 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/ffmpeg/libavformat/ |
D | rtmpdigest.c | 37 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()
|
D | srtp.c | 36 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/wpa_supplicant/wpa_supplicant-2.9/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 …]
|
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/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 …]
|
/third_party/node/test/common/ |
D | tls.js | 154 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/openssl/demos/mac/ |
D | Makefile | 14 all: gmac hmac-sha512 cmac-aes256 poly1305 17 hmac-sha512: hmac-sha512.o 21 gmac hmac-sha512 cmac-aes256 poly1305: 25 $(RM) gmac hmac-sha512 cmac-aes256 poly1305 *.o
|
/third_party/libwebsockets/lib/tls/mbedtls/ |
D | lws-genhash.c | 274 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/python/Doc/library/ |
D | hmac.rst | 1 :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/openssl/crypto/pkcs12/ |
D | p12_mutl.c | 87 HMAC_CTX *hmac = NULL; in pkcs12_gen_mac() local 152 if ((hmac = HMAC_CTX_new()) == NULL in pkcs12_gen_mac() 153 || !HMAC_Init_ex(hmac, key, md_size, md, NULL) in pkcs12_gen_mac() 154 || !HMAC_Update(hmac, p12->authsafes->d.data->data, in pkcs12_gen_mac() 156 || !HMAC_Final(hmac, mac, maclen)) { in pkcs12_gen_mac() 163 HMAC_CTX_free(hmac); in pkcs12_gen_mac()
|
/third_party/node/lib/internal/crypto/ |
D | hash.js | 107 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/aws4/ |
D | aws4.js | 10 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/node/deps/npm/node_modules/http-signature/lib/ |
D | verify.js | 62 var hmac = crypto.createHmac(hashAlg, secret); variable 63 hmac.update(parsedSignature.signingString); 73 h1.update(hmac.digest());
|
/third_party/openssl/providers/implementations/kdfs/ |
D | hkdf.c | 468 HMAC_CTX *hmac; in HKDF_Expand() local 487 if ((hmac = HMAC_CTX_new()) == NULL) in HKDF_Expand() 490 if (!HMAC_Init_ex(hmac, prk, prk_len, evp_md, NULL)) in HKDF_Expand() 499 if (!HMAC_Init_ex(hmac, NULL, 0, NULL, NULL)) in HKDF_Expand() 502 if (!HMAC_Update(hmac, prev, dig_len)) in HKDF_Expand() 506 if (!HMAC_Update(hmac, info, info_len)) in HKDF_Expand() 509 if (!HMAC_Update(hmac, &ctr, 1)) in HKDF_Expand() 512 if (!HMAC_Final(hmac, prev, NULL)) in HKDF_Expand() 527 HMAC_CTX_free(hmac); in HKDF_Expand()
|
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/eap_common/ |
D | eap_sim_common.c | 168 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 …]
|
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/eap_common/ |
D | eap_sim_common.c | 168 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 …]
|
/third_party/libwebsockets/lib/cose/ |
D | cose_sign_alg.c | 91 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()
|
D | cose_validate_alg.c | 91 goto hmac; in lws_cose_val_alg_create() 95 goto hmac; in lws_cose_val_alg_create() 99 goto hmac; in lws_cose_val_alg_create() 104 hmac: in lws_cose_val_alg_create()
|