| /src/crypto/openssl/providers/implementations/rands/ |
| H A D | drbg_hmac.c | 54 static int do_hmac(PROV_DRBG_HMAC *hmac, unsigned char inbyte, in do_hmac() argument 59 EVP_MAC_CTX *ctx = hmac->ctx; in do_hmac() 61 if (!EVP_MAC_init(ctx, hmac->K, hmac->blocklen, NULL) in do_hmac() 63 || !EVP_MAC_update(ctx, hmac->V, hmac->blocklen) in do_hmac() 68 || !EVP_MAC_final(ctx, hmac->K, NULL, sizeof(hmac->K))) in do_hmac() 72 return EVP_MAC_init(ctx, hmac->K, hmac->blocklen, NULL) in do_hmac() 73 && EVP_MAC_update(ctx, hmac->V, hmac->blocklen) in do_hmac() 74 && EVP_MAC_final(ctx, hmac->V, NULL, sizeof(hmac->V)); in do_hmac() 91 static int drbg_hmac_update(PROV_DRBG_HMAC *hmac, in drbg_hmac_update() argument 97 if (!do_hmac(hmac, 0x00, in1, in1len, in2, in2len, in3, in3len)) in drbg_hmac_update() [all …]
|
| /src/contrib/libfido2/tools/ |
| H A D | test.sh | 54 dd if=/dev/urandom bs=32 count=1 | base64 > hmac-salt 148 get_assert no.tld "-h" wrap-cred hmac-salt wrap-assert 151 get_assert no.tld "-h -t pin=true" wrap-cred hmac-salt wrap-assert 155 get_assert no.tld "-h -t pin=false" wrap-cred hmac-salt wrap-assert 158 get_assert no.tld "-h -t up=true" wrap-cred hmac-salt wrap-assert 162 get_assert no.tld "-h -t up=true -t pin=true" wrap-cred hmac-salt wrap-assert 168 get_assert no.tld "-h -t up=true -t pin=false" wrap-cred hmac-salt wrap-assert 172 ! get_assert no.tld "-h -t up=false" wrap-cred hmac-salt wrap-assert 173 ! get_assert no.tld "-h -t up=false -t pin=true" wrap-cred hmac-salt wrap-assert 174 ! get_assert no.tld "-h -t up=false -t pin=false" wrap-cred hmac-salt wrap-assert [all …]
|
| /src/contrib/wpa/src/tls/ |
| H A 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 …]
|
| /src/crypto/openssl/providers/implementations/kdfs/ |
| H A D | hmacdrbg_kdf.c | 142 KDF_HMAC_DRBG *hmac = (KDF_HMAC_DRBG *)vctx; in hmac_drbg_kdf_get_ctx_params() local 143 PROV_DRBG_HMAC *drbg = &hmac->base; in hmac_drbg_kdf_get_ctx_params() 180 KDF_HMAC_DRBG *hmac = (KDF_HMAC_DRBG *)vctx; in hmac_drbg_kdf_set_ctx_params() local 181 PROV_DRBG_HMAC *drbg = &hmac->base; in hmac_drbg_kdf_set_ctx_params() 182 OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(hmac->provctx); in hmac_drbg_kdf_set_ctx_params() 196 OPENSSL_free(hmac->entropy); in hmac_drbg_kdf_set_ctx_params() 197 hmac->entropy = ptr; in hmac_drbg_kdf_set_ctx_params() 198 hmac->entropylen = size; in hmac_drbg_kdf_set_ctx_params() 199 hmac->init = 0; in hmac_drbg_kdf_set_ctx_params() 207 OPENSSL_free(hmac->nonce); in hmac_drbg_kdf_set_ctx_params() [all …]
|
| H A D | hkdf.c | 568 HMAC_CTX *hmac; in HKDF_Expand() local 587 if ((hmac = HMAC_CTX_new()) == NULL) in HKDF_Expand() 590 if (!HMAC_Init_ex(hmac, prk, prk_len, evp_md, NULL)) in HKDF_Expand() 599 if (!HMAC_Init_ex(hmac, NULL, 0, NULL, NULL)) in HKDF_Expand() 602 if (!HMAC_Update(hmac, prev, dig_len)) in HKDF_Expand() 606 if (!HMAC_Update(hmac, info, info_len)) in HKDF_Expand() 609 if (!HMAC_Update(hmac, &ctr, 1)) in HKDF_Expand() 612 if (!HMAC_Final(hmac, prev, NULL)) in HKDF_Expand() 625 HMAC_CTX_free(hmac); in HKDF_Expand()
|
| /src/contrib/libfido2/src/ |
| H A D | config.c | 17 config_prepare_hmac(uint8_t subcmd, const cbor_item_t *item, fido_blob_t *hmac) in config_prepare_hmac() argument 32 if ((hmac->ptr = malloc(cbor_len + sizeof(prefix))) == NULL) { in config_prepare_hmac() 36 memcpy(hmac->ptr, prefix, sizeof(prefix)); in config_prepare_hmac() 37 memcpy(hmac->ptr + sizeof(prefix), cbor, cbor_len); in config_prepare_hmac() 38 hmac->len = cbor_len + sizeof(prefix); in config_prepare_hmac() 49 fido_blob_t *ecdh = NULL, f, hmac; in config_tx() local 54 memset(&hmac, 0, sizeof(hmac)); in config_tx() 73 if (config_prepare_hmac(subcmd, argv[1], &hmac) < 0) { in config_tx() 81 if ((r = cbor_add_uv_params(dev, cmd, &hmac, pk, ecdh, pin, in config_tx() 102 free(hmac.ptr); in config_tx()
|
| /src/sbin/setkey/ |
| H A D | sample.cf | 38 # hmac-sha2-512 whose key is "this is the test key". 53 -A hmac-sha2-512 "this is the test key" ; 57 -A hmac-sha2-512 "this is the test key" ; 62 # Security protocol is old AH tunnel mode, i.e. RFC1826, with hmac-sha2-256 78 -A hmac-sha2-256 "this is the test" ; 81 -A hmac-sha2-256 "this is the test" ; 95 -A hmac-sha2-256 "this is the test" ; 98 -A hmac-sha2-256 "this is the test" ; 103 # is hmac-sha2-512. Authentication algorithm for AH is hmac-sha2-256. 121 -A hmac-sha2-512 "this is the test key" ; [all …]
|
| /src/crypto/openssl/demos/mac/ |
| H A D | build.info | 8 hmac-sha512 \ 16 INCLUDE[hmac-sha512]=../../include 17 SOURCE[hmac-sha512]=hmac-sha512.c 18 DEPEND[hmac-sha512]=../../libcrypto
|
| H A D | Makefile | 8 hmac-sha512 \ 19 hmac-sha512: hmac-sha512.o
|
| /src/tools/regression/ipsec/ |
| H A D | ipsec6.t | 54 hmac-md5:0123456789012345 \ 55 hmac-sha1:01234567890123456789 \ 56 hmac-ripemd160:01234567890123456789 \ 57 hmac-sha2-256:01234567890123456789012345678901 \ 58 hmac-sha2-384:012345678901234567890123456789012345678901234567 \ 59 hmac-sha2-512:0123456789012345678901234567890123456789012345678901234567890123; do
|
| H A D | ipsec.t | 54 hmac-md5:0123456789012345 \ 55 hmac-sha1:01234567890123456789 \ 56 hmac-ripemd160:01234567890123456789 \ 57 hmac-sha2-256:01234567890123456789012345678901 \ 58 hmac-sha2-384:012345678901234567890123456789012345678901234567 \ 59 hmac-sha2-512:0123456789012345678901234567890123456789012345678901234567890123; do
|
| /src/tests/sys/geom/class/eli/ |
| H A D | conf.sh | 45 for aalgo in hmac/sha1 hmac/ripemd160 hmac/sha256 \ 46 hmac/sha384 hmac/sha512; do
|
| /src/crypto/openssl/crypto/rsa/ |
| H A D | rsa_pk1.c | 288 HMAC_CTX *hmac = NULL; in ossl_rsa_prf() local 301 hmac = HMAC_CTX_new(); in ossl_rsa_prf() 302 if (hmac == NULL) { in ossl_rsa_prf() 320 if (HMAC_Init_ex(hmac, kdk, SHA256_DIGEST_LENGTH, md, NULL) <= 0) { in ossl_rsa_prf() 326 if (HMAC_Init_ex(hmac, NULL, 0, NULL, NULL) <= 0) { in ossl_rsa_prf() 334 if (HMAC_Update(hmac, be_iter, sizeof(be_iter)) <= 0) { in ossl_rsa_prf() 338 if (HMAC_Update(hmac, (unsigned char *)label, llen) <= 0) { in ossl_rsa_prf() 342 if (HMAC_Update(hmac, be_bitlen, sizeof(be_bitlen)) <= 0) { in ossl_rsa_prf() 354 if (HMAC_Final(hmac, hmac_out, &md_len) <= 0) { in ossl_rsa_prf() 360 if (HMAC_Final(hmac, to + pos, &md_len) <= 0) { in ossl_rsa_prf() [all …]
|
| /src/sys/crypto/ccp/ |
| H A D | ccp.c | 242 axf = s->hmac.auth_hash; in ccp_init_hmac_digest() 246 axf->Final(s->hmac.ipad, &auth_ctx); in ccp_init_hmac_digest() 250 memcpy(s->hmac.ipad, key, klen); in ccp_init_hmac_digest() 252 memset(s->hmac.ipad + klen, 0, axf->blocksize - klen); in ccp_init_hmac_digest() 253 memcpy(s->hmac.opad, s->hmac.ipad, axf->blocksize); in ccp_init_hmac_digest() 256 s->hmac.ipad[i] ^= HMAC_IPAD_VAL; in ccp_init_hmac_digest() 257 s->hmac.opad[i] ^= HMAC_OPAD_VAL; in ccp_init_hmac_digest() 491 s->hmac.auth_hash = auth_hash; in ccp_newsession() 492 s->hmac.auth_mode = auth_mode; in ccp_newsession() 494 s->hmac.hash_len = auth_hash->hashsize; in ccp_newsession() [all …]
|
| /src/crypto/krb5/src/lib/crypto/builtin/ |
| H A D | Makefile.in | 12 hmac.o \ 18 $(OUTPRE)hmac.$(OBJEXT) \ 24 $(srcdir)/hmac.c \
|
| H A D | deps | 15 hmac.so hmac.po $(OUTPRE)hmac.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ 25 hmac.c
|
| /src/crypto/krb5/src/lib/crypto/openssl/ |
| H A D | Makefile.in | 8 hmac.o \ 15 $(OUTPRE)hmac.$(OBJEXT) \ 22 $(srcdir)/hmac.c \
|
| /src/contrib/ldns/ |
| H A D | keys.c | 428 unsigned char *hmac; in ldns_key_new_frm_fp_l() local 647 hmac = ldns_key_new_frm_fp_hmac_l(fp, line_nr, &hmac_size); in ldns_key_new_frm_fp_l() 648 if (!hmac) { in ldns_key_new_frm_fp_l() 653 ldns_key_set_hmac_key(k, hmac); in ldns_key_new_frm_fp_l() 1102 unsigned char *hmac; in ldns_key_new_frm_algorithm() local 1199 hmac = LDNS_XMALLOC(unsigned char, size); in ldns_key_new_frm_algorithm() 1200 if(!hmac) { in ldns_key_new_frm_algorithm() 1205 if (RAND_bytes(hmac, (int) size) != 1) { in ldns_key_new_frm_algorithm() 1206 LDNS_FREE(hmac); in ldns_key_new_frm_algorithm() 1213 memcpy(&hmac[offset], &i, sizeof(i)); in ldns_key_new_frm_algorithm() [all …]
|
| /src/contrib/wpa/src/eap_common/ |
| H A 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 …]
|
| /src/tests/sys/netipsec/tunnel/ |
| H A D | aesni_aes_cbc_128_hmac_sha1.sh | 16 ist_test 4 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890" 36 ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890"
|
| H A D | aesni_aes_cbc_256_hmac_sha2_256.sh | 16 …ist_test 4 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "123456789012345678901234… 36 …ist_test 6 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "123456789012345678901234…
|
| H A D | aes_cbc_256_hmac_sha2_256.sh | 16 …ist_test 4 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "123456789012345678901234… 36 …ist_test 6 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "123456789012345678901234…
|
| H A D | aes_cbc_128_hmac_sha1.sh | 16 ist_test 4 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890" 36 ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890"
|
| /src/sys/dev/cxgbe/crypto/ |
| H A D | t4_crypto.c | 225 struct ccr_session_hmac hmac; member 492 axf = s->hmac.auth_hash; in ccr_hash() 503 iopad_size = roundup2(s->hmac.partial_digest_len, 16); in ccr_hash() 566 V_SCMD_AUTH_MODE(s->hmac.auth_mode) | in ccr_hash() 573 memcpy(crwr->key_ctx.key, s->hmac.pads, kctx_len); in ccr_hash() 581 V_KEY_CONTEXT_MK_SIZE(s->hmac.mk_size) | V_KEY_CONTEXT_VALID(1)); in ccr_hash() 611 crypto_copydata(crp, crp->crp_digest_start, s->hmac.hash_len, in ccr_hash_done() 613 if (timingsafe_bcmp((cpl + 1), hash, s->hmac.hash_len) != 0) in ccr_hash_done() 616 crypto_copyback(crp, crp->crp_digest_start, s->hmac.hash_len, in ccr_hash_done() 850 axf = s->hmac.auth_hash; in ccr_eta() [all …]
|
| /src/contrib/netbsd-tests/crypto/libcrypto/ |
| H A D | t_hashes.sh | 28 atf_test_case hmac 101 atf_add_test_case hmac
|