Lines Matching refs:data_len
184 size_t data_len, const u8 *data2, size_t data2_len, in eap_eke_prf() argument
192 len[0] = data_len; in eap_eke_prf()
209 size_t data_len, u8 *res, size_t len) in eap_eke_prf_hmac_sha1() argument
221 vlen[1] = data_len; in eap_eke_prf_hmac_sha1()
250 size_t data_len, u8 *res, size_t len) in eap_eke_prf_hmac_sha256() argument
262 vlen[1] = data_len; in eap_eke_prf_hmac_sha256()
291 const u8 *data, size_t data_len, u8 *res, size_t len) in eap_eke_prfplus() argument
294 return eap_eke_prf_hmac_sha1(key, key_len, data, data_len, res, in eap_eke_prfplus()
297 return eap_eke_prf_hmac_sha256(key, key_len, data, data_len, in eap_eke_prfplus()
429 size_t data_len; in eap_eke_derive_ke_ki() local
453 data_len = label_len + id_s_len + id_p_len; in eap_eke_derive_ke_ki()
454 data = os_malloc(data_len); in eap_eke_derive_ke_ki()
461 data, data_len, buf, ke_len + ki_len) < 0) { in eap_eke_derive_ke_ki()
482 size_t data_len; in eap_eke_derive_ka() local
494 data_len = label_len + id_s_len + id_p_len + 2 * sess->nonce_len; in eap_eke_derive_ka()
495 data = os_malloc(data_len); in eap_eke_derive_ka()
509 data, data_len, sess->ka, sess->prf_len) < 0) { in eap_eke_derive_ka()
528 size_t data_len; in eap_eke_derive_msk() local
539 data_len = label_len + id_s_len + id_p_len + 2 * sess->nonce_len; in eap_eke_derive_msk()
540 data = os_malloc(data_len); in eap_eke_derive_msk()
554 data, data_len, buf, EAP_MSK_LEN + EAP_EMSK_LEN) < in eap_eke_derive_msk()
572 static int eap_eke_mac(u8 mac, const u8 *key, const u8 *data, size_t data_len, in eap_eke_mac() argument
576 return hmac_sha1(key, SHA1_MAC_LEN, data, data_len, res); in eap_eke_mac()
578 return hmac_sha256(key, SHA256_MAC_LEN, data, data_len, res); in eap_eke_mac()
584 const u8 *data, size_t data_len, in eap_eke_prot() argument
602 pad = data_len % block_size; in eap_eke_prot()
606 if (*prot_len < block_size + data_len + pad + icv_len) { in eap_eke_prot()
619 os_memcpy(pos, data, data_len); in eap_eke_prot()
620 pos += data_len; in eap_eke_prot()
627 if (aes_128_cbc_encrypt(sess->ke, iv, e, data_len + pad) < 0 || in eap_eke_prot()
628 eap_eke_mac(sess->mac, sess->ki, e, data_len + pad, pos) < 0) in eap_eke_prot()
639 u8 *data, size_t *data_len) in eap_eke_decrypt_prot() argument
668 if (*data_len < prot_len - block_size - icv_len) { in eap_eke_decrypt_prot()
673 *data_len = prot_len - block_size - icv_len; in eap_eke_decrypt_prot()
674 os_memcpy(data, prot + block_size, *data_len); in eap_eke_decrypt_prot()
675 if (aes_128_cbc_decrypt(sess->ke, prot, data, *data_len) < 0) { in eap_eke_decrypt_prot()
680 data, *data_len); in eap_eke_decrypt_prot()