/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/deps/openssl/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 | 56 const hmac = crypto.createHmac(algo, keyWrapper(key)); 58 hmac.update(chunk); 59 const actual = hmac.digest('hex'); 74 hmac: { // HMACs lifted from Wikipedia. property 84 hmac: { // Intermediate test to help debugging. property 94 hmac: { // Intermediate test to help debugging. property 104 hmac: { // HMACs lifted from Wikipedia. property 114 for (const { key, data, hmac } of wikipedia) { field 115 for (const hash in hmac) 116 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 ];
|
/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 | 36 mbedtls_psa_hmac_operation_t *hmac) in psa_hmac_abort_internal() argument 38 mbedtls_platform_zeroize(hmac->opad, sizeof(hmac->opad)); in psa_hmac_abort_internal() 39 return psa_hash_abort(&hmac->hash_ctx); in psa_hmac_abort_internal() 43 mbedtls_psa_hmac_operation_t *hmac, in psa_hmac_setup_internal() argument 54 hmac->alg = hash_alg; in psa_hmac_setup_internal() 65 if (block_size > sizeof(hmac->opad)) { in psa_hmac_setup_internal() 97 hmac->opad[i] = ipad[i] ^ 0x36 ^ 0x5C; in psa_hmac_setup_internal() 99 memset(hmac->opad + key_length, 0x5C, block_size - key_length); in psa_hmac_setup_internal() 101 status = psa_hash_setup(&hmac->hash_ctx, hash_alg); in psa_hmac_setup_internal() 106 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/node/src/crypto/ |
D | crypto_hmac.cc | 89 Hmac* hmac; in HmacInit() local 90 ASSIGN_OR_RETURN_UNWRAP(&hmac, args.Holder()); in HmacInit() 91 Environment* env = hmac->env(); in HmacInit() 95 hmac->HmacInit(*hash_type, key.data<char>(), key.size()); in HmacInit() 105 Decode<Hmac>(args, [](Hmac* hmac, const FunctionCallbackInfo<Value>& args, in HmacUpdate() 110 bool r = hmac->HmacUpdate(data, size); in HmacUpdate() 118 Hmac* hmac; in HmacDigest() argument 119 ASSIGN_OR_RETURN_UNWRAP(&hmac, args.Holder()); in HmacDigest() 129 if (hmac->ctx_) { in HmacDigest() 130 bool ok = HMAC_Final(hmac->ctx_.get(), md_value, &md_len); in HmacDigest() [all …]
|
/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/node/deps/openssl/openssl/crypto/pkcs12/ |
D | p12_mutl.c | 87 HMAC_CTX *hmac = NULL; in pkcs12_gen_mac() local 162 if ((hmac = HMAC_CTX_new()) == NULL in pkcs12_gen_mac() 163 || !HMAC_Init_ex(hmac, key, md_size, md, NULL) in pkcs12_gen_mac() 164 || !HMAC_Update(hmac, p12->authsafes->d.data->data, in pkcs12_gen_mac() 166 || !HMAC_Final(hmac, mac, maclen)) { in pkcs12_gen_mac() 173 HMAC_CTX_free(hmac); in pkcs12_gen_mac()
|
/third_party/openssl/crypto/pkcs12/ |
D | p12_mutl.c | 87 HMAC_CTX *hmac = NULL; in pkcs12_gen_mac() local 157 if ((hmac = HMAC_CTX_new()) == NULL in pkcs12_gen_mac() 158 || !HMAC_Init_ex(hmac, key, md_size, md, NULL) in pkcs12_gen_mac() 159 || !HMAC_Update(hmac, p12->authsafes->d.data->data, in pkcs12_gen_mac() 161 || !HMAC_Final(hmac, mac, maclen)) { in pkcs12_gen_mac() 168 HMAC_CTX_free(hmac); in pkcs12_gen_mac()
|
/third_party/node/lib/internal/crypto/ |
D | hash.js | 129 function Hmac(hmac, key, options) { argument 131 return new Hmac(hmac, key, options); 132 validateString(hmac, 'hmac'); 136 this[kHandle].init(hmac, key);
|
/third_party/node/deps/openssl/openssl/providers/implementations/kdfs/ |
D | hkdf.c | 510 HMAC_CTX *hmac; in HKDF_Expand() local 529 if ((hmac = HMAC_CTX_new()) == NULL) in HKDF_Expand() 532 if (!HMAC_Init_ex(hmac, prk, prk_len, evp_md, NULL)) in HKDF_Expand() 541 if (!HMAC_Init_ex(hmac, NULL, 0, NULL, NULL)) in HKDF_Expand() 544 if (!HMAC_Update(hmac, prev, dig_len)) in HKDF_Expand() 548 if (!HMAC_Update(hmac, info, info_len)) in HKDF_Expand() 551 if (!HMAC_Update(hmac, &ctr, 1)) in HKDF_Expand() 554 if (!HMAC_Final(hmac, prev, NULL)) in HKDF_Expand() 569 HMAC_CTX_free(hmac); in HKDF_Expand()
|
/third_party/openssl/providers/implementations/kdfs/ |
D | hkdf.c | 510 HMAC_CTX *hmac; in HKDF_Expand() local 529 if ((hmac = HMAC_CTX_new()) == NULL) in HKDF_Expand() 532 if (!HMAC_Init_ex(hmac, prk, prk_len, evp_md, NULL)) in HKDF_Expand() 541 if (!HMAC_Init_ex(hmac, NULL, 0, NULL, NULL)) in HKDF_Expand() 544 if (!HMAC_Update(hmac, prev, dig_len)) in HKDF_Expand() 548 if (!HMAC_Update(hmac, info, info_len)) in HKDF_Expand() 551 if (!HMAC_Update(hmac, &ctr, 1)) in HKDF_Expand() 554 if (!HMAC_Final(hmac, prev, NULL)) in HKDF_Expand() 569 HMAC_CTX_free(hmac); in HKDF_Expand()
|
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/eap_common/ |
D | eap_sim_common.c | 172 unsigned char hmac[SHA1_MAC_LEN]; in eap_sim_verify_mac() local 199 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac); in eap_sim_verify_mac() 201 hmac, EAP_SIM_MAC_LEN); in eap_sim_verify_mac() 204 return (os_memcmp_const(hmac, mac, EAP_SIM_MAC_LEN) == 0) ? 0 : 1; in eap_sim_verify_mac() 211 unsigned char hmac[SHA1_MAC_LEN]; in eap_sim_add_mac() local 227 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac); in eap_sim_add_mac() 228 os_memcpy(mac, hmac, EAP_SIM_MAC_LEN); in eap_sim_add_mac() 366 unsigned char hmac[SHA256_MAC_LEN]; in eap_sim_verify_mac_sha256() local 393 hmac_sha256_vector(k_aut, EAP_AKA_PRIME_K_AUT_LEN, 2, addr, len, hmac); in eap_sim_verify_mac_sha256() 395 hmac, EAP_SIM_MAC_LEN); in eap_sim_verify_mac_sha256() [all …]
|
/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/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()
|