Home
last modified time | relevance | path

Searched refs:AES_BLOCK_SIZE (Results 1 – 25 of 30) sorted by relevance

12

/hostap-latest/src/crypto/
Daes-ccm.c32 u8 aad_buf[2 * AES_BLOCK_SIZE]; in aes_ccm_auth_start()
33 u8 b[AES_BLOCK_SIZE]; in aes_ccm_auth_start()
41 WPA_PUT_BE16(&b[AES_BLOCK_SIZE - L], plain_len); in aes_ccm_auth_start()
43 wpa_hexdump_key(MSG_EXCESSIVE, "CCM B_0", b, AES_BLOCK_SIZE); in aes_ccm_auth_start()
56 if (aad_len > AES_BLOCK_SIZE - 2) { in aes_ccm_auth_start()
57 xor_aes_block(&aad_buf[AES_BLOCK_SIZE], x); in aes_ccm_auth_start()
59 aes_encrypt(aes, &aad_buf[AES_BLOCK_SIZE], x); in aes_ccm_auth_start()
66 size_t last = len % AES_BLOCK_SIZE; in aes_ccm_auth()
69 for (i = 0; i < len / AES_BLOCK_SIZE; i++) { in aes_ccm_auth()
72 data += AES_BLOCK_SIZE; in aes_ccm_auth()
[all …]
Daes-cbc.c27 u8 cbc[AES_BLOCK_SIZE]; in aes_128_cbc_encrypt()
37 os_memcpy(cbc, iv, AES_BLOCK_SIZE); in aes_128_cbc_encrypt()
39 blocks = data_len / AES_BLOCK_SIZE; in aes_128_cbc_encrypt()
41 for (j = 0; j < AES_BLOCK_SIZE; j++) in aes_128_cbc_encrypt()
44 os_memcpy(pos, cbc, AES_BLOCK_SIZE); in aes_128_cbc_encrypt()
45 pos += AES_BLOCK_SIZE; in aes_128_cbc_encrypt()
63 u8 cbc[AES_BLOCK_SIZE], tmp[AES_BLOCK_SIZE]; in aes_128_cbc_decrypt()
73 os_memcpy(cbc, iv, AES_BLOCK_SIZE); in aes_128_cbc_decrypt()
75 blocks = data_len / AES_BLOCK_SIZE; in aes_128_cbc_decrypt()
77 os_memcpy(tmp, pos, AES_BLOCK_SIZE); in aes_128_cbc_decrypt()
[all …]
Daes-siv.c17 static const u8 zero[AES_BLOCK_SIZE];
25 for (i = 0; i < AES_BLOCK_SIZE - 1; i++) in dbl()
27 pad[AES_BLOCK_SIZE - 1] <<= 1; in dbl()
29 pad[AES_BLOCK_SIZE - 1] ^= 0x87; in dbl()
37 for (i = 0; i < AES_BLOCK_SIZE; i++) in xor()
56 os_memset(pad, 0, AES_BLOCK_SIZE); in pad_block()
59 if (len < AES_BLOCK_SIZE) in pad_block()
67 u8 tmp[AES_BLOCK_SIZE], tmp2[AES_BLOCK_SIZE]; in aes_s2v()
76 tmp[AES_BLOCK_SIZE - 1] = 1; in aes_s2v()
97 if (len[i] >= AES_BLOCK_SIZE) { in aes_s2v()
[all …]
Daes-omac1.c21 for (i = 0; i < AES_BLOCK_SIZE - 1; i++) in gf_mulx()
23 pad[AES_BLOCK_SIZE - 1] <<= 1; in gf_mulx()
25 pad[AES_BLOCK_SIZE - 1] ^= 0x87; in gf_mulx()
47 u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; in omac1_aes_vector()
57 os_memset(cbc, 0, AES_BLOCK_SIZE); in omac1_aes_vector()
68 while (left >= AES_BLOCK_SIZE) { in omac1_aes_vector()
69 for (i = 0; i < AES_BLOCK_SIZE; i++) { in omac1_aes_vector()
76 if (i + 1 == AES_BLOCK_SIZE && in omac1_aes_vector()
77 left == AES_BLOCK_SIZE) in omac1_aes_vector()
84 if (left > AES_BLOCK_SIZE) in omac1_aes_vector()
[all …]
Daes-gcm.c19 val = WPA_GET_BE32(block + AES_BLOCK_SIZE - 4); in inc32()
21 WPA_PUT_BE32(block + AES_BLOCK_SIZE - 4, val); in inc32()
146 u8 cb[AES_BLOCK_SIZE], tmp[AES_BLOCK_SIZE]; in aes_gctr()
155 os_memcpy(cb, icb, AES_BLOCK_SIZE); in aes_gctr()
160 xpos += AES_BLOCK_SIZE; in aes_gctr()
161 ypos += AES_BLOCK_SIZE; in aes_gctr()
184 os_memset(H, 0, AES_BLOCK_SIZE); in aes_gcm_init_hash_subkey()
187 H, AES_BLOCK_SIZE); in aes_gcm_init_hash_subkey()
199 os_memset(J0 + iv_len, 0, AES_BLOCK_SIZE - iv_len); in aes_gcm_prepare_j0()
200 J0[AES_BLOCK_SIZE - 1] = 0x01; in aes_gcm_prepare_j0()
[all …]
Dcrypto_internal-cipher.c76 os_memcpy(ctx->u.aes.cbc, iv, AES_BLOCK_SIZE); in crypto_cipher_init()
117 if (len % AES_BLOCK_SIZE) in crypto_cipher_encrypt()
119 blocks = len / AES_BLOCK_SIZE; in crypto_cipher_encrypt()
121 for (j = 0; j < AES_BLOCK_SIZE; j++) in crypto_cipher_encrypt()
125 os_memcpy(crypt, ctx->u.aes.cbc, AES_BLOCK_SIZE); in crypto_cipher_encrypt()
126 plain += AES_BLOCK_SIZE; in crypto_cipher_encrypt()
127 crypt += AES_BLOCK_SIZE; in crypto_cipher_encrypt()
181 if (len % AES_BLOCK_SIZE) in crypto_cipher_decrypt()
183 blocks = len / AES_BLOCK_SIZE; in crypto_cipher_decrypt()
185 os_memcpy(tmp, crypt, AES_BLOCK_SIZE); in crypto_cipher_decrypt()
[all …]
Daes-eax.c34 u8 nonce_mac[AES_BLOCK_SIZE], hdr_mac[AES_BLOCK_SIZE], in aes_128_eax_encrypt()
35 data_mac[AES_BLOCK_SIZE]; in aes_128_eax_encrypt()
69 for (i = 0; i < AES_BLOCK_SIZE; i++) in aes_128_eax_encrypt()
98 u8 nonce_mac[AES_BLOCK_SIZE], hdr_mac[AES_BLOCK_SIZE], in aes_128_eax_decrypt()
99 data_mac[AES_BLOCK_SIZE]; in aes_128_eax_decrypt()
139 for (i = 0; i < AES_BLOCK_SIZE; i++) { in aes_128_eax_decrypt()
Daes-ctr.c32 u8 counter[AES_BLOCK_SIZE], buf[AES_BLOCK_SIZE]; in aes_ctr_encrypt()
37 os_memcpy(counter, nonce, AES_BLOCK_SIZE); in aes_ctr_encrypt()
42 len = (left < AES_BLOCK_SIZE) ? left : AES_BLOCK_SIZE; in aes_ctr_encrypt()
48 for (i = AES_BLOCK_SIZE - 1; i >= 0; i--) { in aes_ctr_encrypt()
Dcrypto_linux.c459 io[0].iov_len = AES_BLOCK_SIZE; in linux_af_alg_skcipher_oper()
480 ret = read(skcipher->t, out, AES_BLOCK_SIZE); in linux_af_alg_skcipher_oper()
486 if (ret < AES_BLOCK_SIZE) { in linux_af_alg_skcipher_oper()
489 __func__, (int) ret, AES_BLOCK_SIZE); in linux_af_alg_skcipher_oper()
686 size_t iv_len = AES_BLOCK_SIZE; in aes_128_cbc_oper()
761 addr, len, mac, AES_BLOCK_SIZE); in omac1_aes_vector()
881 iv_len = AES_BLOCK_SIZE; in crypto_cipher_init()
Daes.h12 #define AES_BLOCK_SIZE 16 macro
Daes-wrap.c28 u8 *a, *r, b[AES_BLOCK_SIZE]; in aes_wrap()
Daes-unwrap.c29 u8 a[8], *r, b[AES_BLOCK_SIZE]; in aes_unwrap()
Dcrypto_nettle.c264 nettle_aes_encrypt(actx, AES_BLOCK_SIZE, crypt, plain); in aes_encrypt()
295 nettle_aes_decrypt(actx, AES_BLOCK_SIZE, plain, crypt); in aes_decrypt()
Dcrypto_module_tests.c88 u8 out[2 * AES_BLOCK_SIZE + sizeof(plaintext_2)]; in test_siv()
311 u8 data[sizeof(msg)], tag[AES_BLOCK_SIZE]; in test_eax()
324 if (os_memcmp(tag, cipher + sizeof(data), AES_BLOCK_SIZE) != 0) { in test_eax()
/hostap-latest/src/eap_common/
Deap_eke_common.c49 return AES_BLOCK_SIZE + dhlen; in eap_eke_dhcomp_len()
102 return AES_BLOCK_SIZE + 16 + mac_len; in eap_eke_pnonce_len()
117 return AES_BLOCK_SIZE + 2 * 16 + mac_len; in eap_eke_pnonce_ps_len()
347 u8 iv[AES_BLOCK_SIZE]; in eap_eke_dhcomp()
361 if (random_get_bytes(iv, AES_BLOCK_SIZE)) in eap_eke_dhcomp()
364 iv, AES_BLOCK_SIZE); in eap_eke_dhcomp()
368 os_memcpy(ret_dhcomp, iv, AES_BLOCK_SIZE); in eap_eke_dhcomp()
369 os_memcpy(ret_dhcomp + AES_BLOCK_SIZE, pub, dh_len); in eap_eke_dhcomp()
371 ret_dhcomp, AES_BLOCK_SIZE + dh_len); in eap_eke_dhcomp()
391 os_memcpy(peer_pub, peer_dhcomp + AES_BLOCK_SIZE, dh->prime_len); in eap_eke_shared_secret()
[all …]
/hostap-latest/src/common/
Ddpp_auth.c68 u8 wrapped_data[4 + DPP_MAX_NONCE_LEN + 4 + 1 + AES_BLOCK_SIZE]; in dpp_auth_build_req()
210 siv_len += AES_BLOCK_SIZE; in dpp_auth_build_req()
246 4 + 4 + DPP_MAX_HASH_LEN + AES_BLOCK_SIZE in dpp_auth_build_resp()
248 u8 wrapped_data[DPP_AUTH_RESP_CLEAR_LEN + AES_BLOCK_SIZE]; in dpp_auth_build_resp()
396 siv_len += AES_BLOCK_SIZE; in dpp_auth_build_resp()
424 u8 wrapped_r_auth[4 + DPP_MAX_HASH_LEN + AES_BLOCK_SIZE], *w_r_auth; in dpp_auth_build_resp_ok()
519 wrapped_r_auth_len = 4 + auth->curve->hash_len + AES_BLOCK_SIZE; in dpp_auth_build_resp_ok()
700 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_auth_req_rx()
802 unwrapped_len = wrapped_data_len - AES_BLOCK_SIZE; in dpp_auth_req_rx()
980 4 + i_auth_len + r_nonce_len + AES_BLOCK_SIZE; in dpp_auth_build_conf()
[all …]
Ddpp_reconfig.c364 4 + wpabuf_len(clear) + AES_BLOCK_SIZE; in dpp_reconfig_build_resp()
410 wpabuf_put_le16(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_reconfig_build_resp()
411 wrapped = wpabuf_put(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_reconfig_build_resp()
615 attr_len = 4 + wpabuf_len(clear) + AES_BLOCK_SIZE; in dpp_reconfig_build_conf()
640 wpabuf_put_le16(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_reconfig_build_conf()
641 wrapped = wpabuf_put(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_reconfig_build_conf()
688 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_reconfig_auth_resp_rx()
787 unwrapped_len = wrapped_data_len - AES_BLOCK_SIZE; in dpp_reconfig_auth_resp_rx()
868 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_reconfig_auth_conf_rx()
899 unwrapped_len = wrapped_data_len - AES_BLOCK_SIZE; in dpp_reconfig_auth_conf_rx()
Ddpp_pkex.c600 attr_len = 4 + clear_len + AES_BLOCK_SIZE; in dpp_pkex_build_commit_reveal_req()
667 wpabuf_put_le16(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_pkex_build_commit_reveal_req()
668 wrapped = wpabuf_put(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_pkex_build_commit_reveal_req()
676 wrapped, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_pkex_build_commit_reveal_req()
921 attr_len = 4 + clear_len + AES_BLOCK_SIZE; in dpp_pkex_build_commit_reveal_resp()
988 wpabuf_put_le16(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_pkex_build_commit_reveal_resp()
989 wrapped = wpabuf_put(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_pkex_build_commit_reveal_resp()
997 wrapped, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_pkex_build_commit_reveal_resp()
1053 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_pkex_rx_commit_reveal_req()
1061 unwrapped_len = wrapped_data_len - AES_BLOCK_SIZE; in dpp_pkex_rx_commit_reveal_req()
[all …]
Ddpp_backup.c295 enc_key = wpabuf_alloc(hash_len + AES_BLOCK_SIZE); in dpp_build_pw_recipient_info()
299 wpabuf_put(enc_key, hash_len + AES_BLOCK_SIZE)) < 0) in dpp_build_pw_recipient_info()
402 enc_cont_len = wpabuf_len(key_pkg) + AES_BLOCK_SIZE; in dpp_build_enc_cont_info()
1167 if (data.enc_key_len < AES_BLOCK_SIZE || in dpp_conf_resp_env_data()
1168 data.enc_key_len > sizeof(cont_encr_key) + AES_BLOCK_SIZE) { in dpp_conf_resp_env_data()
1181 cont_encr_key_len = data.enc_key_len - AES_BLOCK_SIZE; in dpp_conf_resp_env_data()
1185 if (data.enc_cont_len < AES_BLOCK_SIZE) in dpp_conf_resp_env_data()
1187 key_pkg_len = data.enc_cont_len - AES_BLOCK_SIZE; in dpp_conf_resp_env_data()
Dsae_pk.c657 encr_mod_len = wpabuf_len(pk->m) + AES_BLOCK_SIZE; in sae_write_confirm_pk()
816 if (elems.sae_pk_len < SAE_PK_M_LEN + AES_BLOCK_SIZE) { in sae_check_confirm_pk()
823 elems.sae_pk, SAE_PK_M_LEN + AES_BLOCK_SIZE); in sae_check_confirm_pk()
826 elems.sae_pk, SAE_PK_M_LEN + AES_BLOCK_SIZE, in sae_check_confirm_pk()
Ddpp.c821 attr_len = 4 + clear_len + AES_BLOCK_SIZE; in dpp_build_conf_req_attr()
886 wpabuf_put_le16(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_build_conf_req_attr()
887 wrapped = wpabuf_put(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_build_conf_req_attr()
896 wrapped, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_build_conf_req_attr()
2119 attr_len = 4 + 1 + 4 + clear_len + AES_BLOCK_SIZE; in dpp_build_conf_resp()
2240 wpabuf_put_le16(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_build_conf_resp()
2241 wrapped = wpabuf_put(msg, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_build_conf_resp()
2249 wrapped, wpabuf_len(clear) + AES_BLOCK_SIZE); in dpp_build_conf_resp()
2308 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_conf_req_rx()
2316 unwrapped_len = wrapped_data_len - AES_BLOCK_SIZE; in dpp_conf_req_rx()
[all …]
/hostap-latest/wlantest/
Dccmp.c166 plain = os_malloc(data_len + AES_BLOCK_SIZE); in ccmp_decrypt()
220 crypt = os_malloc(hdrlen + 8 + plen + 8 + AES_BLOCK_SIZE); in ccmp_encrypt()
270 crypt = os_malloc(hdrlen + plen + 8 + AES_BLOCK_SIZE); in ccmp_encrypt_pv1()
310 plain = os_malloc(data_len + AES_BLOCK_SIZE); in ccmp_256_decrypt()
353 crypt = os_malloc(hdrlen + 8 + plen + 16 + AES_BLOCK_SIZE); in ccmp_256_encrypt()
Dgcmp.c96 plain = os_malloc(data_len + AES_BLOCK_SIZE); in gcmp_decrypt()
138 crypt = os_malloc(hdrlen + 8 + plen + 16 + AES_BLOCK_SIZE); in gcmp_encrypt()
/hostap-latest/wpa_supplicant/
Dmesh_rsn.c569 if (2 + AES_BLOCK_SIZE + 2 + len > wpabuf_tailroom(buf)) { in mesh_rsn_protect_frame()
628 wpabuf_put_u8(buf, AES_BLOCK_SIZE); in mesh_rsn_protect_frame()
632 mic_payload = wpabuf_put(buf, 2 + len + AES_BLOCK_SIZE); in mesh_rsn_protect_frame()
682 if (!elems->mic || elems->mic_len < AES_BLOCK_SIZE) { in mesh_rsn_process_ampe()
692 if (crypt_len < 2 + AES_BLOCK_SIZE) { in mesh_rsn_process_ampe()
714 crypt_len -= AES_BLOCK_SIZE; in mesh_rsn_process_ampe()
/hostap-latest/src/ap/
Dwpa_auth.c1660 key_data_length == AES_BLOCK_SIZE)) {
2023 len += AES_BLOCK_SIZE;
2077 WPA_PUT_BE16(key_mic, AES_BLOCK_SIZE + kde_len);
2094 key_mic + 2, AES_BLOCK_SIZE + kde_len);
3061 if (key_data_len < AES_BLOCK_SIZE ||
3086 key_data_len -= AES_BLOCK_SIZE;
3241 if (end - crypt < AES_BLOCK_SIZE) {
3275 pos, left - AES_BLOCK_SIZE);
3277 if (wpa_fils_validate_key_confirm(sm, pos, left - AES_BLOCK_SIZE) < 0) {
3282 return left - AES_BLOCK_SIZE;
[all …]

12