Home
last modified time | relevance | path

Searched refs:nonce_len (Results 1 – 25 of 32) sorted by relevance

12

/freebsd/contrib/wpa/src/crypto/
H A Daes-eax.c28 int aes_128_eax_encrypt(const u8 *key, const u8 *nonce, size_t nonce_len, in aes_128_eax_encrypt() argument
38 if (nonce_len > data_len) in aes_128_eax_encrypt()
39 buf_len = nonce_len; in aes_128_eax_encrypt()
53 os_memcpy(buf + 16, nonce, nonce_len); in aes_128_eax_encrypt()
54 if (omac1_aes_128(key, buf, 16 + nonce_len, nonce_mac)) in aes_128_eax_encrypt()
92 int aes_128_eax_decrypt(const u8 *key, const u8 *nonce, size_t nonce_len, in aes_128_eax_decrypt() argument
102 if (nonce_len > data_len) in aes_128_eax_decrypt()
103 buf_len = nonce_len; in aes_128_eax_decrypt()
117 os_memcpy(buf + 16, nonce, nonce_len); in aes_128_eax_decrypt()
118 if (omac1_aes_128(key, buf, 16 + nonce_len, nonce_mac)) { in aes_128_eax_decrypt()
H A Daes_wrap.h41 const u8 *nonce, size_t nonce_len,
45 const u8 *nonce, size_t nonce_len,
/freebsd/contrib/wpa/src/common/
H A Ddpp_auth.c61 size_t nonce_len, in dpp_auth_build_req() argument
152 WPA_PUT_LE16(pos, nonce_len - 1); in dpp_auth_build_req()
154 os_memcpy(pos, auth->i_nonce, nonce_len - 1); in dpp_auth_build_req()
155 pos += nonce_len - 1; in dpp_auth_build_req()
163 WPA_PUT_LE16(pos, nonce_len); in dpp_auth_build_req()
165 os_memcpy(pos, auth->i_nonce, nonce_len); in dpp_auth_build_req()
166 pos += nonce_len; in dpp_auth_build_req()
236 size_t nonce_len, in dpp_auth_build_resp() argument
315 WPA_PUT_LE16(pos, nonce_len); in dpp_auth_build_resp()
317 os_memcpy(pos, r_nonce, nonce_len); in dpp_auth_build_resp()
[all …]
H A Ddpp_reconfig.c138 4 + auth->curve->nonce_len; in dpp_reconfig_build_req()
175 wpabuf_put_le16(msg, auth->curve->nonce_len); in dpp_reconfig_build_req()
176 wpabuf_put_data(msg, auth->c_nonce, auth->curve->nonce_len); in dpp_reconfig_build_req()
310 if (random_get_bytes(auth->c_nonce, auth->curve->nonce_len)) { in dpp_reconfig_init()
340 clear_len = 4 + auth->curve->nonce_len + in dpp_reconfig_build_resp()
348 wpabuf_put_le16(clear, auth->curve->nonce_len); in dpp_reconfig_build_resp()
349 wpabuf_put_data(clear, auth->c_nonce, auth->curve->nonce_len); in dpp_reconfig_build_resp()
362 4 + auth->curve->nonce_len + in dpp_reconfig_build_resp()
388 wpabuf_put_le16(msg, auth->curve->nonce_len); in dpp_reconfig_build_resp()
389 wpabuf_put_data(msg, auth->e_nonce, auth->curve->nonce_len); in dpp_reconfig_build_resp()
[all …]
H A Ddpp_crypto.c447 size_t nonce_len = auth->curve->nonce_len; in dpp_derive_bk_ke() local
462 os_memcpy(nonces, auth->i_nonce, nonce_len); in dpp_derive_bk_ke()
463 os_memcpy(&nonces[nonce_len], auth->r_nonce, nonce_len); in dpp_derive_bk_ke()
480 res = dpp_hmac_vector(hash_len, nonces, 2 * nonce_len, in dpp_derive_bk_ke()
892 size_t nonce_len; in dpp_gen_r_auth() local
897 nonce_len = auth->curve->nonce_len; in dpp_gen_r_auth()
924 len[num_elem] = nonce_len; in dpp_gen_r_auth()
928 len[num_elem] = nonce_len; in dpp_gen_r_auth()
975 size_t nonce_len; in dpp_gen_i_auth() local
980 nonce_len = auth->curve->nonce_len; in dpp_gen_i_auth()
[all …]
H A Ddpp.c786 size_t nonce_len; in dpp_build_conf_req_attr() local
797 nonce_len = auth->curve->nonce_len; in dpp_build_conf_req_attr()
798 if (random_get_bytes(auth->e_nonce, nonce_len)) { in dpp_build_conf_req_attr()
802 wpa_hexdump(MSG_DEBUG, "DPP: E-nonce", auth->e_nonce, nonce_len); in dpp_build_conf_req_attr()
807 clear_len = 4 + nonce_len + 4 + json_len; in dpp_build_conf_req_attr()
838 wpabuf_put_le16(clear, nonce_len - 1); in dpp_build_conf_req_attr()
839 wpabuf_put_data(clear, auth->e_nonce, nonce_len - 1); in dpp_build_conf_req_attr()
850 wpabuf_put_le16(clear, nonce_len); in dpp_build_conf_req_attr()
851 wpabuf_put_data(clear, auth->e_nonce, nonce_len); in dpp_build_conf_req_attr()
2337 if (!e_nonce || e_nonce_len != auth->curve->nonce_len) { in dpp_conf_req_rx()
[all …]
H A Ddpp.h141 size_t nonce_len; member
/freebsd/contrib/bearssl/src/aead/
H A Dccm.c58 br_ccm_reset(br_ccm_context *ctx, const void *nonce, size_t nonce_len, in br_ccm_reset() argument
64 if (nonce_len < 7 || nonce_len > 13) { in br_ccm_reset()
70 q = 15 - (unsigned)nonce_len; in br_ccm_reset()
79 memcpy(tmp + 1, nonce, nonce_len); in br_ccm_reset()
123 memcpy(ctx->ctr + 1, nonce, nonce_len); in br_ccm_reset()
124 memset(ctx->ctr + 1 + nonce_len, 0, q); in br_ccm_reset()
/freebsd/contrib/wpa/src/eap_server/
H A Deap_server_eke.c321 if (random_get_bytes(data->nonce_s, data->sess.nonce_len)) { in eap_eke_build_confirm()
327 data->nonce_s, data->sess.nonce_len); in eap_eke_build_confirm()
329 os_memcpy(nonces, data->nonce_p, data->sess.nonce_len); in eap_eke_build_confirm()
330 os_memcpy(nonces + data->sess.nonce_len, data->nonce_s, in eap_eke_build_confirm()
331 data->sess.nonce_len); in eap_eke_build_confirm()
333 if (eap_eke_prot(&data->sess, nonces, 2 * data->sess.nonce_len, in eap_eke_build_confirm()
570 if (decrypt_len < (size_t) data->sess.nonce_len) { in eap_eke_process_commit()
576 data->nonce_p, data->sess.nonce_len); in eap_eke_process_commit()
619 if (decrypt_len < (size_t) data->sess.nonce_len) { in eap_eke_process_confirm()
625 nonce, data->sess.nonce_len); in eap_eke_process_confirm()
[all …]
/freebsd/contrib/wpa/src/eap_peer/
H A Deap_eke.c464 if (random_get_bytes(data->nonce_p, data->sess.nonce_len)) { in eap_eke_process_commit()
470 data->nonce_p, data->sess.nonce_len); in eap_eke_process_commit()
472 if (eap_eke_prot(&data->sess, data->nonce_p, data->sess.nonce_len, in eap_eke_process_commit()
539 if (decrypt_len != (size_t) 2 * data->sess.nonce_len) { in eap_eke_process_confirm()
545 nonces, 2 * data->sess.nonce_len); in eap_eke_process_confirm()
546 if (os_memcmp(data->nonce_p, nonces, data->sess.nonce_len) != 0) { in eap_eke_process_confirm()
552 os_memcpy(data->nonce_s, nonces + data->sess.nonce_len, in eap_eke_process_confirm()
553 data->sess.nonce_len); in eap_eke_process_confirm()
555 data->nonce_s, data->sess.nonce_len); in eap_eke_process_confirm()
588 if (eap_eke_prot(&data->sess, data->nonce_s, data->sess.nonce_len, in eap_eke_process_confirm()
[all …]
/freebsd/contrib/wpa/src/eap_common/
H A Deap_eke_common.c494 data_len = label_len + id_s_len + id_p_len + 2 * sess->nonce_len; in eap_eke_derive_ka()
505 os_memcpy(pos, nonce_p, sess->nonce_len); in eap_eke_derive_ka()
506 pos += sess->nonce_len; in eap_eke_derive_ka()
507 os_memcpy(pos, nonce_s, sess->nonce_len); in eap_eke_derive_ka()
539 data_len = label_len + id_s_len + id_p_len + 2 * sess->nonce_len; in eap_eke_derive_msk()
550 os_memcpy(pos, nonce_p, sess->nonce_len); in eap_eke_derive_msk()
551 pos += sess->nonce_len; in eap_eke_derive_msk()
552 os_memcpy(pos, nonce_s, sess->nonce_len); in eap_eke_derive_msk()
708 sess->nonce_len = eap_eke_nonce_len(prf); in eap_eke_session_init()
713 if (sess->prf_len < 0 || sess->nonce_len < 0 || sess->auth_len < 0 || in eap_eke_session_init()
H A Dikev2_common.c318 payloads->nonce_len = pdatalen; in ikev2_parse_payloads()
373 const u8 *nonce, size_t nonce_len, in ikev2_derive_auth_data() argument
402 sign_len = wpabuf_len(sign_msg) + nonce_len + prf->hash_len; in ikev2_derive_auth_data()
409 os_memcpy(pos, nonce, nonce_len); in ikev2_derive_auth_data()
410 pos += nonce_len; in ikev2_derive_auth_data()
H A Dikev2_common.h290 const u8 *nonce, size_t nonce_len,
309 size_t nonce_len; member
H A Deap_eke_common.h74 int nonce_len; member
/freebsd/sys/crypto/
H A Dchacha20_poly1305.h40 const uint8_t *nonce, const size_t nonce_len, const uint8_t *key);
44 const uint8_t *nonce, const size_t nonce_len, const uint8_t *key);
H A Dchacha20_poly1305.c40 const uint8_t *nonce, const size_t nonce_len, const uint8_t *key) in chacha20_poly1305_encrypt() argument
50 exf->reinit(ctx, nonce, nonce_len); in chacha20_poly1305_encrypt()
87 const uint8_t *nonce, const size_t nonce_len, const uint8_t *key) in chacha20_poly1305_decrypt() argument
105 exf->reinit(ctx, nonce, nonce_len); in chacha20_poly1305_decrypt()
/freebsd/crypto/openssl/providers/implementations/rands/
H A Dtest_rng.c46 size_t entropy_len, entropy_pos, nonce_len; member
136 memcpy(out, t->nonce, t->nonce_len); in test_rng_nonce()
137 return t->nonce_len; in test_rng_nonce()
202 t->nonce_len = size; in test_rng_set_ctx_params()
H A Ddrbg_hmac.c117 * nonce = nonce data (Can be NULL) of length nonce_len.
124 const unsigned char *nonce, size_t nonce_len, in drbg_hmac_instantiate() argument
139 return drbg_hmac_update(drbg, ent, ent_len, nonce, nonce_len, pstr, in drbg_hmac_instantiate()
H A Ddrbg_hash.c243 * nonce is a string of bytes of length nonce_len.
250 const unsigned char *nonce, size_t nonce_len, in drbg_hash_instantiate() argument
261 ent, ent_len, nonce, nonce_len, pstr, pstr_len) in drbg_hash_instantiate()
/freebsd/crypto/openssl/crypto/evp/
H A De_chacha20_poly1305.c159 int aad, mac_inited, tag_len, nonce_len; member
186 if (actx->nonce_len <= CHACHA_CTR_SIZE) in chacha20_poly1305_init_key()
187 memcpy(temp + CHACHA_CTR_SIZE - actx->nonce_len, iv, in chacha20_poly1305_init_key()
188 actx->nonce_len); in chacha20_poly1305_init_key()
515 actx->nonce_len = 12; in chacha20_poly1305_ctrl()
534 *(int *)ptr = actx->nonce_len; in chacha20_poly1305_ctrl()
540 actx->nonce_len = arg; in chacha20_poly1305_ctrl()
/freebsd/sys/crypto/aesni/
H A Daesni_ccm.c92 const unsigned char *nonce, size_t nonce_len, in cbc_mac_start() argument
99 int L = sizeof(__m128i) - 1 - nonce_len; in cbc_mac_start()
111 bcopy(nonce, byte_ptr + 1, nonce_len); in cbc_mac_start()
/freebsd/contrib/bearssl/test/
H A Dtest_crypto.c7690 size_t plain_len, key_len, nonce_len, aad_len; in test_EAX_inner() local
7699 nonce_len = hextobin(nonce, KAT_EAX[u + 2]); in test_EAX_inner()
7713 br_eax_reset(&ec, nonce, nonce_len); in test_EAX_inner()
7721 br_eax_reset(&ec, nonce, nonce_len); in test_EAX_inner()
7741 br_eax_reset(&ec, nonce, nonce_len); in test_EAX_inner()
7755 br_eax_reset(&ec, nonce, nonce_len); in test_EAX_inner()
7772 br_eax_reset(&ec, nonce, nonce_len); in test_EAX_inner()
7791 br_eax_reset(&ec, nonce, nonce_len); in test_EAX_inner()
7805 br_eax_reset(&ec, nonce, nonce_len); in test_EAX_inner()
7832 br_eax_reset_pre_aad(&ec, &st, nonce, nonce_len); in test_EAX_inner()
[all …]
/freebsd/contrib/bearssl/inc/
H A Dbearssl_aead.h965 int br_ccm_reset(br_ccm_context *ctx, const void *nonce, size_t nonce_len,
/freebsd/crypto/openssl/test/
H A Dcmp_vfy_test.c460 int nonce_len = OSSL_CMP_SENDERNONCE_LENGTH; in setup_check_update() local
469 nonce_data, nonce_len))) { in setup_check_update()
/freebsd/sys/contrib/openzfs/module/icp/algs/modes/
H A Dccm.c758 ccm_init(ccm_ctx_t *ctx, unsigned char *nonce, size_t nonce_len, in ccm_init() argument
777 ccm_format_initial_blocks(nonce, nonce_len, in ccm_init()

12