Home
last modified time | relevance | path

Searched refs:nonce (Results 1 – 23 of 23) sorted by relevance

/hal_espressif-latest/components/bt/porting/ext/tinycrypt/src/
Dctr_mode.c42 uint8_t nonce[TC_AES_BLOCK_SIZE]; in tc_ctr_mode() local
58 (void)_copy(nonce, sizeof(nonce), ctr, sizeof(nonce)); in tc_ctr_mode()
61 block_num = (nonce[12] << 24) | (nonce[13] << 16) | in tc_ctr_mode()
62 (nonce[14] << 8) | (nonce[15]); in tc_ctr_mode()
66 if (tc_aes_encrypt(buffer, nonce, sched)) { in tc_ctr_mode()
68 nonce[12] = (uint8_t)(block_num >> 24); in tc_ctr_mode()
69 nonce[13] = (uint8_t)(block_num >> 16); in tc_ctr_mode()
70 nonce[14] = (uint8_t)(block_num >> 8); in tc_ctr_mode()
71 nonce[15] = (uint8_t)(block_num); in tc_ctr_mode()
81 ctr[12] = nonce[12]; ctr[13] = nonce[13]; in tc_ctr_mode()
[all …]
Dccm_mode.c39 int tc_ccm_config(TCCcmMode_t c, TCAesKeySched_t sched, uint8_t *nonce, in tc_ccm_config() argument
46 nonce == (uint8_t *) 0) { in tc_ccm_config()
56 c->nonce = nonce; in tc_ccm_config()
98 uint8_t nonce[TC_AES_BLOCK_SIZE]; in ccm_ctr_mode() local
114 (void) _copy(nonce, sizeof(nonce), ctr, sizeof(nonce)); in ccm_ctr_mode()
117 block_num = (uint16_t) ((nonce[14] << 8)|(nonce[15])); in ccm_ctr_mode()
121 nonce[14] = (uint8_t)(block_num >> 8); in ccm_ctr_mode()
122 nonce[15] = (uint8_t)(block_num); in ccm_ctr_mode()
123 if (!tc_aes_encrypt(buffer, nonce, sched)) { in ccm_ctr_mode()
132 ctr[14] = nonce[14]; ctr[15] = nonce[15]; in ccm_ctr_mode()
[all …]
/hal_espressif-latest/components/bt/esp_ble_mesh/mesh_common/tinycrypt/src/
Dctr_mode.c42 uint8_t nonce[TC_AES_BLOCK_SIZE]; in tc_ctr_mode() local
58 (void)_copy(nonce, sizeof(nonce), ctr, sizeof(nonce)); in tc_ctr_mode()
61 block_num = (nonce[12] << 24) | (nonce[13] << 16) | in tc_ctr_mode()
62 (nonce[14] << 8) | (nonce[15]); in tc_ctr_mode()
66 if (tc_aes_encrypt(buffer, nonce, sched)) { in tc_ctr_mode()
68 nonce[12] = (uint8_t)(block_num >> 24); in tc_ctr_mode()
69 nonce[13] = (uint8_t)(block_num >> 16); in tc_ctr_mode()
70 nonce[14] = (uint8_t)(block_num >> 8); in tc_ctr_mode()
71 nonce[15] = (uint8_t)(block_num); in tc_ctr_mode()
81 ctr[12] = nonce[12]; ctr[13] = nonce[13]; in tc_ctr_mode()
[all …]
Dccm_mode.c39 int tc_ccm_config(TCCcmMode_t c, TCAesKeySched_t sched, uint8_t *nonce, in tc_ccm_config() argument
46 nonce == (uint8_t *) 0) { in tc_ccm_config()
56 c->nonce = nonce; in tc_ccm_config()
98 uint8_t nonce[TC_AES_BLOCK_SIZE]; in ccm_ctr_mode() local
114 (void) _copy(nonce, sizeof(nonce), ctr, sizeof(nonce)); in ccm_ctr_mode()
117 block_num = (uint16_t) ((nonce[14] << 8) | (nonce[15])); in ccm_ctr_mode()
121 nonce[14] = (uint8_t)(block_num >> 8); in ccm_ctr_mode()
122 nonce[15] = (uint8_t)(block_num); in ccm_ctr_mode()
123 if (!tc_aes_encrypt(buffer, nonce, sched)) { in ccm_ctr_mode()
132 ctr[14] = nonce[14]; ctr[15] = nonce[15]; in ccm_ctr_mode()
[all …]
/hal_espressif-latest/components/wpa_supplicant/src/crypto/
Dccmp.c20 u8 *aad, size_t *aad_len, u8 *nonce) in ccmp_aad_nonce() argument
26 nonce[0] = 0; in ccmp_aad_nonce()
43 nonce[0] = qc[0] & 0x0f; in ccmp_aad_nonce()
46 nonce[0] |= 0x10; /* Management */ in ccmp_aad_nonce()
71 os_memcpy(nonce + 1, hdr->addr2, ETH_ALEN); in ccmp_aad_nonce()
72 nonce[7] = data[7]; /* PN5 */ in ccmp_aad_nonce()
73 nonce[8] = data[6]; /* PN4 */ in ccmp_aad_nonce()
74 nonce[9] = data[5]; /* PN3 */ in ccmp_aad_nonce()
75 nonce[10] = data[4]; /* PN2 */ in ccmp_aad_nonce()
76 nonce[11] = data[1]; /* PN1 */ in ccmp_aad_nonce()
[all …]
Daes-ccm.c29 static void aes_ccm_auth_start(void *aes, size_t M, size_t L, const u8 *nonce, in aes_ccm_auth_start() argument
41 os_memcpy(&b[1], nonce, 15 - L); in aes_ccm_auth_start()
85 static void aes_ccm_encr_start(size_t L, const u8 *nonce, u8 *a) in aes_ccm_encr_start() argument
89 os_memcpy(&a[1], nonce, 15 - L); in aes_ccm_encr_start()
149 int aes_ccm_ae(const u8 *key, size_t key_len, const u8 *nonce, in aes_ccm_ae() argument
164 aes_ccm_auth_start(aes, M, L, nonce, aad, aad_len, plain_len, x); in aes_ccm_ae()
168 aes_ccm_encr_start(L, nonce, a); in aes_ccm_ae()
179 int aes_ccm_ad(const u8 *key, size_t key_len, const u8 *nonce, in aes_ccm_ad() argument
196 aes_ccm_encr_start(L, nonce, a); in aes_ccm_ad()
202 aes_ccm_auth_start(aes, M, L, nonce, aad, aad_len, crypt_len, x); in aes_ccm_ad()
Daes-ctr.c25 int aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce, in aes_ctr_encrypt() argument
37 os_memcpy(counter, nonce, AES_BLOCK_SIZE); in aes_ctr_encrypt()
67 int aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, in aes_128_ctr_encrypt() argument
70 return aes_ctr_encrypt(key, 16, nonce, data, data_len); in aes_128_ctr_encrypt()
Daes_wrap.h36 int __must_check aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce,
38 int __must_check aes_128_ctr_encrypt(const u8 *key, const u8 *nonce,
41 const u8 *nonce, size_t nonce_len,
45 const u8 *nonce, size_t nonce_len,
65 int __must_check aes_ccm_ae(const u8 *key, size_t key_len, const u8 *nonce,
68 int __must_check aes_ccm_ad(const u8 *key, size_t key_len, const u8 *nonce,
/hal_espressif-latest/components/bt/esp_ble_mesh/mesh_core/
Dcrypto.c195 static int bt_mesh_ccm_decrypt(const uint8_t key[16], uint8_t nonce[13], in bt_mesh_ccm_decrypt()
212 memcpy(pmsg + 1, nonce, 13); in bt_mesh_ccm_decrypt()
227 memcpy(pmsg + 1, nonce, 13); in bt_mesh_ccm_decrypt()
284 memcpy(pmsg + 1, nonce, 13); in bt_mesh_ccm_decrypt()
320 memcpy(pmsg + 1, nonce, 13); in bt_mesh_ccm_decrypt()
354 static int bt_mesh_ccm_encrypt(const uint8_t key[16], uint8_t nonce[13], in bt_mesh_ccm_encrypt()
366 BT_DBG("nonce %s", bt_hex(nonce, 13)); in bt_mesh_ccm_encrypt()
377 memcpy(pmsg + 1, nonce, 13); in bt_mesh_ccm_encrypt()
392 memcpy(pmsg + 1, nonce, 13); in bt_mesh_ccm_encrypt()
467 memcpy(pmsg + 1, nonce, 13); in bt_mesh_ccm_encrypt()
[all …]
Dcrypto.h97 uint8_t nonce[13]) in bt_mesh_prov_nonce()
104 memcpy(nonce, tmp + 3, 13); in bt_mesh_prov_nonce()
164 int bt_mesh_prov_decrypt(const uint8_t key[16], uint8_t nonce[13],
167 int bt_mesh_prov_encrypt(const uint8_t key[16], uint8_t nonce[13],
Dprov.c1186 uint8_t nonce[13] = {0}; in prov_data() local
1207 err = bt_mesh_prov_nonce(link.dhkey, link.prov_salt, nonce); in prov_data()
1214 BT_DBG("Nonce: %s", bt_hex(nonce, 13)); in prov_data()
1216 err = bt_mesh_prov_decrypt(session_key, nonce, data, pdu); in prov_data()
Dprovisioner_prov.c2387 uint8_t nonce[13] = {0}; local
2398 err = bt_mesh_prov_nonce(link[idx].dhkey, link[idx].prov_salt, nonce);
2403 BT_DBG("Nonce: %s", bt_hex(nonce, 13));
2491 err = bt_mesh_prov_encrypt(session_key, nonce, pdu, net_buf_simple_add(&buf, 33));
/hal_espressif-latest/components/bt/porting/ext/tinycrypt/include/tinycrypt/
Dccm_mode.h93 uint8_t *nonce; /* nonce required by CCM */ member
111 int tc_ccm_config(TCCcmMode_t c, TCAesKeySched_t sched, uint8_t *nonce,
/hal_espressif-latest/components/bt/esp_ble_mesh/mesh_common/tinycrypt/include/tinycrypt/
Dccm_mode.h93 uint8_t *nonce; /* nonce required by CCM */ member
111 int tc_ccm_config(TCCcmMode_t c, TCAesKeySched_t sched, uint8_t *nonce,
/hal_espressif-latest/components/wpa_supplicant/esp_supplicant/src/crypto/
Dcrypto_mbedtls.c659 int aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce, in aes_ctr_encrypt() argument
672 ret = mbedtls_aes_crypt_ctr(&ctx, data_len, &offset, (u8 *)nonce, in aes_ctr_encrypt()
679 int aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, in aes_128_ctr_encrypt() argument
682 return aes_ctr_encrypt(key, 16, nonce, data, data_len); in aes_128_ctr_encrypt()
814 int aes_ccm_ae(const u8 *key, size_t key_len, const u8 *nonce, in aes_ccm_ae() argument
830 ret = mbedtls_ccm_encrypt_and_tag(&ccm, plain_len, nonce, 13, aad, in aes_ccm_ae()
839 int aes_ccm_ad(const u8 *key, size_t key_len, const u8 *nonce, in aes_ccm_ad() argument
856 nonce, 13, aad, aad_len, in aes_ccm_ad()
/hal_espressif-latest/components/wpa_supplicant/src/eap_peer/
Deap_tlv_common.h76 u8 nonce[32]; member
Deap_fast.c601 _bind->nonce, sizeof(_bind->nonce)); in eap_fast_validate_crypto_binding()
631 os_memcpy(rbind->nonce, _bind->nonce, sizeof(_bind->nonce)); in eap_fast_write_crypto_binding()
632 inc_byte_array(rbind->nonce, sizeof(rbind->nonce)); in eap_fast_write_crypto_binding()
640 rbind->nonce, sizeof(rbind->nonce)); in eap_fast_write_crypto_binding()
/hal_espressif-latest/components/wpa_supplicant/src/wps/
Dwps_validate.c870 static int wps_validate_r_snonce1(const u8 *nonce, int mandatory) in wps_validate_r_snonce1() argument
872 if (nonce == NULL) { in wps_validate_r_snonce1()
884 static int wps_validate_r_snonce2(const u8 *nonce, int mandatory) in wps_validate_r_snonce2() argument
886 if (nonce == NULL) { in wps_validate_r_snonce2()
898 static int wps_validate_e_snonce1(const u8 *nonce, int mandatory) in wps_validate_e_snonce1() argument
900 if (nonce == NULL) { in wps_validate_e_snonce1()
912 static int wps_validate_e_snonce2(const u8 *nonce, int mandatory) in wps_validate_e_snonce2() argument
914 if (nonce == NULL) { in wps_validate_e_snonce2()
/hal_espressif-latest/components/wpa_supplicant/src/ap/
Dwpa_auth.h54 u8 nonce[16]; member
68 u8 nonce[16]; /* copied from pull */ member
Dwpa_auth_i.h202 const u8 *key_rsc, const u8 *nonce,
Dwpa_auth.c1008 const u8 *key_rsc, const u8 *nonce, in __wpa_send_eapol() argument
1022 wpa_auth,sm, key_rsc, kde, nonce, kde_len, keyidx, encr, force_version); in __wpa_send_eapol()
1095 if (nonce) in __wpa_send_eapol()
1096 memcpy(key->key_nonce, nonce, WPA_NONCE_LEN); in __wpa_send_eapol()
1193 const u8 *key_rsc, const u8 *nonce, in wpa_send_eapol() argument
1203 __wpa_send_eapol(wpa_auth, sm, key_info, key_rsc, nonce, kde, kde_len, in wpa_send_eapol()
/hal_espressif-latest/components/bt/porting/ext/tinycrypt/documentation/
Dtinycrypt.rst151 step: entropy seed, personalization and a nonce (which is not implemented).
200 the nonce size, which is: 15-q bytes. The maximum payload length for those
207 The nonce size is: 13 bytes.
233 same nonce for two different messages which are encrypted with the same
/hal_espressif-latest/components/wpa_supplicant/src/rsn_supp/
Dwpa.c547 int ver, const u8 *nonce, in wpa_supplicant_send_2_of_4() argument
635 os_memcpy(reply->key_nonce, nonce, WPA_NONCE_LEN); in wpa_supplicant_send_2_of_4()