/freebsd/crypto/openssl/providers/implementations/rands/ |
H A D | drbg_hmac.c | 46 * hmac is an object that holds the input/output Key and Value (K and V). 52 * hmac->K = HMAC(hmac->K, hmac->V || inbyte || [in1] || [in2] || [in3]) 53 * hmac->V = HMAC(hmac->K, hmac->V) 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 in do_hmac() 99 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data; drbg_hmac_update() local 127 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data; drbg_hmac_instantiate() local 198 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data; drbg_hmac_generate() local 252 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data; drbg_hmac_uninstantiate() local 267 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data; drbg_hmac_verify_zeroization() local 276 PROV_DRBG_HMAC *hmac; drbg_hmac_new() local 307 PROV_DRBG_HMAC *hmac; drbg_hmac_free() local 320 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data; drbg_hmac_get_ctx_params() local 359 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)ctx->data; drbg_hmac_set_ctx_params() local [all...] |
/freebsd/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 …]
|
/freebsd/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 …]
|
/freebsd/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()
|
H A D | bio.c | 68 fido_blob_t hmac; in bio_tx() local 73 memset(&hmac, 0, sizeof(hmac)); in bio_tx() 86 &hmac) < 0) { in bio_tx() 98 if ((r = cbor_add_uv_params(dev, cmd, &hmac, pk, ecdh, pin, in bio_tx() 105 (argv[4] = cbor_encode_pin_auth(dev, token, &hmac)) == NULL) { in bio_tx() 125 free(hmac.ptr); in bio_tx()
|
/freebsd/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 …]
|
/freebsd/crypto/openssl/demos/mac/ |
H A 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
|
/freebsd/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
|
/freebsd/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
|
/freebsd/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 …]
|
/freebsd/crypto/openssl/crypto/pkcs12/ |
H A 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()
|
/freebsd/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 …]
|
/freebsd/crypto/openssl/providers/implementations/kdfs/ |
H A D | hkdf.c | 518 HMAC_CTX *hmac; in HKDF_Expand() local 537 if ((hmac = HMAC_CTX_new()) == NULL) in HKDF_Expand() 540 if (!HMAC_Init_ex(hmac, prk, prk_len, evp_md, NULL)) in HKDF_Expand() 549 if (!HMAC_Init_ex(hmac, NULL, 0, NULL, NULL)) in HKDF_Expand() 552 if (!HMAC_Update(hmac, prev, dig_len)) in HKDF_Expand() 556 if (!HMAC_Update(hmac, info, info_len)) in HKDF_Expand() 559 if (!HMAC_Update(hmac, &ctr, 1)) in HKDF_Expand() 562 if (!HMAC_Final(hmac, prev, NULL)) in HKDF_Expand() 577 HMAC_CTX_free(hmac); in HKDF_Expand()
|
/freebsd/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 …]
|
/freebsd/tests/sys/netipsec/tunnel/ |
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 | 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_128_hmac_sha1.sh | 16 ist_test 4 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890" 36 ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890"
|
/freebsd/sys/dev/cxgbe/crypto/ |
H A D | t4_crypto.c | 224 struct ccr_session_hmac hmac; member 490 axf = s->hmac.auth_hash; in ccr_hash() 501 iopad_size = roundup2(s->hmac.partial_digest_len, 16); in ccr_hash() 564 V_SCMD_AUTH_MODE(s->hmac.auth_mode) | in ccr_hash() 571 memcpy(crwr->key_ctx.key, s->hmac.pads, kctx_len); in ccr_hash() 579 V_KEY_CONTEXT_MK_SIZE(s->hmac.mk_size) | V_KEY_CONTEXT_VALID(1)); in ccr_hash() 609 crypto_copydata(crp, crp->crp_digest_start, s->hmac.hash_len, in ccr_hash_done() 611 if (timingsafe_bcmp((cpl + 1), hash, s->hmac.hash_len) != 0) in ccr_hash_done() 614 crypto_copyback(crp, crp->crp_digest_start, s->hmac.hash_len, in ccr_hash_done() 848 axf = s->hmac in ccr_eta() [all...] |
/freebsd/contrib/netbsd-tests/crypto/libcrypto/ |
H A D | t_hashes.sh | 28 atf_test_case hmac 101 atf_add_test_case hmac
|
/freebsd/crypto/heimdal/lib/gssapi/ntlm/ |
H A D | crypto.c | 149 unsigned char hmac[16]; in v2_sign_message() local 158 encode_le_uint32(seq, hmac); in v2_sign_message() 159 HMAC_Update(c, hmac, 4); in v2_sign_message() 161 HMAC_Final(c, hmac, &hmaclen); in v2_sign_message() 166 RC4(sealkey, 8, hmac, &out[4]); in v2_sign_message() 168 memcpy(&out[4], hmac, 8); in v2_sign_message()
|
/freebsd/sys/netinet/ |
H A D | sctp_auth.c | 632 alloc_size = sizeof(*new_list) + num_hmacs * sizeof(new_list->hmac[0]); in sctp_alloc_hmaclist() 670 if (list->hmac[i] == hmac_id) { in sctp_auth_add_hmacid() 676 list->hmac[list->num_algo++] = hmac_id; in sctp_auth_add_hmacid() 696 new_list->hmac[i] = list->hmac[i]; in sctp_copy_hmaclist() 728 if (peer->hmac[i] == local->hmac[j]) { in sctp_negotiate_hmacid() 732 peer->hmac[i]); in sctp_negotiate_hmacid() 733 return (peer->hmac[i]); in sctp_negotiate_hmacid() 755 hmac_id = htons(list->hmac[i]); in sctp_serialize_hmaclist() 1129 if (list->hmac[i] == id) in sctp_auth_is_supported_hmac() 1511 memset(auth->hmac, 0, SCTP_SIZE32(digestlen)); in sctp_fill_hmac_digest_m() [all …]
|
/freebsd/contrib/libfido2/ |
H A D | NEWS | 4 ** winhello: fix restrictive parsing of the hmac-secret on assertions. 46 ** winhello: support hmac-secret in fido_dev_get_assert(). 155 ** Use CTAP2 canonical CBOR when combining hmac-secret and credProtect. 195 ** assert/hmac: encode public key as per spec, gh#60. 197 ** fido2-{assert,cred}: support for hmac-secret extension. 246 ** Added support for FIDO 2's hmac-secret extension.
|
/freebsd/crypto/openssl/providers/implementations/signature/ |
H A D | mac_legacy_sig.c | 93 MAC_NEWCTX(hmac, "HMAC") 241 MAC_SETTABLE_CTX_PARAMS(hmac, "HMAC") 264 MAC_SIGNATURE_FUNCTIONS(hmac)
|