/hostap-latest/src/crypto/ |
D | aes-siv.c | 129 u8 *iv, *crypt_pw; in aes_siv_encrypt() local 149 iv = out; in aes_siv_encrypt() 152 os_memcpy(iv, v, AES_BLOCK_SIZE); in aes_siv_encrypt() 173 u8 iv[AES_BLOCK_SIZE]; in aes_siv_decrypt() local 191 os_memcpy(iv, iv_crypt, AES_BLOCK_SIZE); in aes_siv_decrypt() 194 iv[8] &= 0x7f; in aes_siv_decrypt() 195 iv[12] &= 0x7f; in aes_siv_decrypt() 197 ret = aes_ctr_encrypt(k2, key_len, iv, out, crypt_len); in aes_siv_decrypt()
|
D | aes-gcm.c | 192 static void aes_gcm_prepare_j0(const u8 *iv, size_t iv_len, const u8 *H, u8 *J0) in aes_gcm_prepare_j0() argument 198 os_memcpy(J0, iv, iv_len); in aes_gcm_prepare_j0() 207 ghash(H, iv, iv_len, J0); in aes_gcm_prepare_j0() 254 int aes_gcm_ae(const u8 *key, size_t key_len, const u8 *iv, size_t iv_len, in aes_gcm_ae() argument 267 aes_gcm_prepare_j0(iv, iv_len, H, J0); in aes_gcm_ae() 288 int aes_gcm_ad(const u8 *key, size_t key_len, const u8 *iv, size_t iv_len, in aes_gcm_ad() argument 301 aes_gcm_prepare_j0(iv, iv_len, H, J0); in aes_gcm_ad() 322 int aes_gmac(const u8 *key, size_t key_len, const u8 *iv, size_t iv_len, in aes_gmac() argument 325 return aes_gcm_ae(key, key_len, iv, iv_len, NULL, 0, aad, aad_len, NULL, in aes_gmac()
|
D | aes-cbc.c | 24 int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_encrypt() argument 37 os_memcpy(cbc, iv, AES_BLOCK_SIZE); in aes_128_cbc_encrypt() 60 int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_decrypt() argument 73 os_memcpy(cbc, iv, AES_BLOCK_SIZE); in aes_128_cbc_decrypt()
|
D | aes_wrap.h | 48 int __must_check aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, 50 int __must_check aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, 53 const u8 *iv, size_t iv_len, 58 const u8 *iv, size_t iv_len, 63 const u8 *iv, size_t iv_len,
|
D | crypto_linux.c | 675 static int aes_128_cbc_oper(const u8 *key, int enc, const u8 *iv, in aes_128_cbc_oper() argument 715 os_memcpy(alg_iv->iv, iv, iv_len); in aes_128_cbc_oper() 745 int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_encrypt() argument 747 return aes_128_cbc_oper(key, 1, iv, data, data_len); in aes_128_cbc_encrypt() 751 int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_decrypt() argument 753 return aes_128_cbc_oper(key, 0, iv, data, data_len); in aes_128_cbc_decrypt() 824 os_memcpy(alg_iv->iv, cipher, iv_len); in aes_unwrap() 859 const u8 *iv, const u8 *key, in crypto_cipher_init() argument 902 if (iv && iv_len) { in crypto_cipher_init() 913 os_memcpy(alg_iv->iv, iv, iv_len); in crypto_cipher_init()
|
D | crypto_internal-cipher.c | 44 const u8 *iv, const u8 *key, in crypto_cipher_init() argument 76 os_memcpy(ctx->u.aes.cbc, iv, AES_BLOCK_SIZE); in crypto_cipher_init() 84 os_memcpy(ctx->u.des3.cbc, iv, 8); in crypto_cipher_init() 92 os_memcpy(ctx->u.des.cbc, iv, 8); in crypto_cipher_init()
|
D | crypto_gnutls.c | 403 const u8 *iv, const u8 *key, in crypto_cipher_init() argument 469 if (gcry_cipher_setiv(ctx->enc, iv, ivlen) != GPG_ERR_NO_ERROR || in crypto_cipher_init() 470 gcry_cipher_setiv(ctx->dec, iv, ivlen) != GPG_ERR_NO_ERROR) { in crypto_cipher_init()
|
D | crypto_mbedtls_alt.c | 1004 static int aes_128_cbc_oper(const u8 *key, const u8 *iv, u8 *data, size_t data_len, int mode) in aes_128_cbc_oper() argument 1008 return aes_128_cbc_encrypt_psa(key, iv, data, data_len); in aes_128_cbc_oper() 1010 return aes_128_cbc_decrypt_psa(key, iv, data, data_len); in aes_128_cbc_oper() 1013 os_memcpy(ivec, iv, MBEDTLS_AES_BLOCK_SIZE); /*(must be writable)*/ in aes_128_cbc_oper() 1025 int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_encrypt() argument 1030 return aes_128_cbc_oper(key, iv, data, data_len, MBEDTLS_AES_ENCRYPT); in aes_128_cbc_encrypt() 1033 int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_decrypt() argument 1038 return aes_128_cbc_oper(key, iv, data, data_len, MBEDTLS_AES_DECRYPT); in aes_128_cbc_decrypt() 1061 struct crypto_cipher *crypto_cipher_init(enum crypto_cipher_alg alg, const u8 *iv, const u8 *key, s… in crypto_cipher_init() argument 1108 mbedtls_cipher_set_iv(&ctx->ctx_enc, iv, iv_len) == 0 && in crypto_cipher_init() [all …]
|
D | crypto_wolfssl.c | 652 int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_encrypt() argument 660 ret = wc_AesSetKey(&aes, key, 16, iv, AES_ENCRYPTION); in aes_128_cbc_encrypt() 671 int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_decrypt() argument 679 ret = wc_AesSetKey(&aes, key, 16, iv, AES_DECRYPTION); in aes_128_cbc_decrypt() 773 const u8 *iv, const u8 *key, in crypto_cipher_init() argument 802 if (wc_AesSetKey(&ctx->enc.aes, key, key_len, iv, in crypto_cipher_init() 804 wc_AesSetKey(&ctx->dec.aes, key, key_len, iv, in crypto_cipher_init() 814 wc_Des3_SetKey(&ctx->enc.des3, key, iv, DES_ENCRYPTION) || in crypto_cipher_init() 815 wc_Des3_SetKey(&ctx->dec.des3, key, iv, DES_DECRYPTION)) { in crypto_cipher_init()
|
D | crypto_libtomcrypt.c | 302 const u8 *iv, const u8 *key, in crypto_cipher_init() argument 342 res = cbc_start(idx, iv, key, key_len, 0, &ctx->u.cbc); in crypto_cipher_init()
|
D | crypto_module_tests.c | 352 u8 iv[16]; in test_cbc() member 397 if (aes_128_cbc_encrypt(tv->key, tv->iv, buf, tv->len) || in test_cbc() 404 if (aes_128_cbc_decrypt(tv->key, tv->iv, buf, tv->len) || in test_cbc()
|
/hostap-latest/tests/ |
D | test-aes.c | 62 char *iv; member 237 u8 k[32], aad[32], iv[64], t[16], tag[16]; in test_gcm() local 265 iv_len = os_strlen(tc->iv) / 2; in test_gcm() 266 if (hexstr2bin(tc->iv, iv, iv_len)) { in test_gcm() 284 if (aes_gcm_ae(k, k_len, iv, iv_len, p, p_len, aad, aad_len, in test_gcm() 302 if (aes_gmac(k, k_len, iv, iv_len, aad, aad_len, tag) < in test_gcm() 315 if (aes_gcm_ad(k, k_len, iv, iv_len, c, p_len, aad, aad_len, in test_gcm()
|
/hostap-latest/src/tls/ |
D | pkcs5.c | 33 u8 iv[8]; member 253 os_memcpy(params->iv, hdr.payload, hdr.length); in pkcs5_get_params_pbes2() 255 wpa_hexdump(MSG_DEBUG, "PKCS #5: IV", params->iv, params->iv_len); in pkcs5_get_params_pbes2() 380 wpa_hexdump(MSG_DEBUG, "PKCS #5: DES IV", params->iv, params->iv_len); in pkcs5_crypto_init_pbes2() 382 return crypto_cipher_init(CRYPTO_CIPHER_ALG_3DES, params->iv, in pkcs5_crypto_init_pbes2() 495 u8 iv[8]; in pkcs12_crypto_init_sha1() local 515 sizeof(iv), iv) < 0) { in pkcs12_crypto_init_sha1() 523 wpa_hexdump_key(MSG_DEBUG, "PKCS #12: DES IV", iv, sizeof(iv)); in pkcs12_crypto_init_sha1() 525 return crypto_cipher_init(CRYPTO_CIPHER_ALG_3DES, iv, key, sizeof(key)); in pkcs12_crypto_init_sha1()
|
/hostap-latest/src/eap_common/ |
D | ikev2_common.c | 175 int ikev2_encr_encrypt(int alg, const u8 *key, size_t key_len, const u8 *iv, in ikev2_encr_encrypt() argument 193 cipher = crypto_cipher_init(encr_alg, iv, key, key_len); in ikev2_encr_encrypt() 210 int ikev2_encr_decrypt(int alg, const u8 *key, size_t key_len, const u8 *iv, in ikev2_encr_decrypt() argument 228 cipher = crypto_cipher_init(encr_alg, iv, key, key_len); in ikev2_encr_decrypt() 435 const u8 *pos, *end, *iv, *integ; in ikev2_decrypt_payload() local 467 iv = encrypted; in ikev2_decrypt_payload() 468 pos = iv + iv_len; in ikev2_decrypt_payload() 499 if (ikev2_encr_decrypt(encr_alg->id, SK_e, keys->SK_encr_len, iv, pos, in ikev2_decrypt_payload() 537 u8 *icv, *iv; in ikev2_build_encrypted() local 574 iv = wpabuf_put(msg, iv_len); in ikev2_build_encrypted() [all …]
|
D | eap_eke_common.c | 347 u8 iv[AES_BLOCK_SIZE]; in eap_eke_dhcomp() local 361 if (random_get_bytes(iv, AES_BLOCK_SIZE)) in eap_eke_dhcomp() 364 iv, AES_BLOCK_SIZE); in eap_eke_dhcomp() 366 if (aes_128_cbc_encrypt(key, iv, pub, dh_len) < 0) in eap_eke_dhcomp() 368 os_memcpy(ret_dhcomp, iv, AES_BLOCK_SIZE); in eap_eke_dhcomp() 588 u8 *pos, *iv, *e; in eap_eke_prot() local 614 iv = pos; in eap_eke_prot() 615 wpa_hexdump(MSG_DEBUG, "EAP-EKE: IV for Prot()", iv, block_size); in eap_eke_prot() 627 if (aes_128_cbc_encrypt(sess->ke, iv, e, data_len + pad) < 0 || in eap_eke_prot()
|
D | eap_sim_common.c | 736 attr->iv = apos + 2; in eap_sim_parse_attr() 934 size_t encr_data_len, const u8 *iv, in eap_sim_parse_encr() argument 939 if (!iv) { in eap_sim_parse_encr() 952 if (aes_128_cbc_decrypt(k_encr, iv, decrypted, encr_data_len)) { in eap_sim_parse_encr() 976 size_t mac, iv, encr; /* index from buf */ member 1119 msg->iv = (pos - wpabuf_head_u8(msg->buf)) + 4; in eap_sim_msg_add_encr_start() 1120 if (random_get_bytes(wpabuf_mhead_u8(msg->buf) + msg->iv, in eap_sim_msg_add_encr_start() 1122 msg->iv = 0; in eap_sim_msg_add_encr_start() 1128 msg->iv = 0; in eap_sim_msg_add_encr_start() 1141 if (msg == NULL || k_encr == NULL || msg->iv == 0 || msg->encr == 0) in eap_sim_msg_add_encr_end() [all …]
|
D | ikev2_common.h | 281 int ikev2_encr_encrypt(int alg, const u8 *key, size_t key_len, const u8 *iv, 283 int ikev2_encr_decrypt(int alg, const u8 *key, size_t key_len, const u8 *iv,
|
D | eap_sim_common.h | 184 const u8 *rand, *autn, *mac, *iv, *encr_data, *version_list, *nonce_s; member 207 size_t encr_data_len, const u8 *iv,
|
D | eap_sake_common.c | 105 attr->iv = data; in eap_sake_parse_add_attr() 143 if (attr->iv && !attr->encr_data) { in eap_sake_parse_add_attr()
|
D | eap_sake_common.h | 75 const u8 *iv; member
|
/hostap-latest/port/mbedtls/ |
D | supp_psa_api.h | 39 int aes_128_cbc_encrypt_psa(const u8 *key, const u8 *iv, u8 *data, size_t data_len); 40 int aes_128_cbc_decrypt_psa(const u8 *key, const u8 *iv, u8 *data, size_t data_len);
|
D | supp_psa_api.c | 148 int aes_128_cbc_encrypt_psa(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_encrypt_psa() argument 173 status = psa_cipher_set_iv(&operation, iv, PSA_CIPHER_IV_LENGTH(key_type, alg)); in aes_128_cbc_encrypt_psa() 191 int aes_128_cbc_decrypt_psa(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_decrypt_psa() argument 216 status = psa_cipher_set_iv(&operation, iv, PSA_CIPHER_IV_LENGTH(key_type, alg)); in aes_128_cbc_decrypt_psa()
|
/hostap-latest/src/wps/ |
D | wps_attr_build.c | 398 u8 *iv, *data; in wps_build_encr_settings() local 409 iv = wpabuf_put(msg, block_size); in wps_build_encr_settings() 410 if (random_get_bytes(iv, block_size) < 0) in wps_build_encr_settings() 415 if (aes_128_cbc_encrypt(wps->keywrapkey, iv, data, wpabuf_len(plain))) in wps_build_encr_settings()
|
/hostap-latest/src/eap_peer/ |
D | eap_sim.c | 946 attr->encr_data_len, attr->iv, in eap_sim_process_challenge() 980 if (attr->encr_data == NULL || attr->iv == NULL) { in eap_sim_process_notification_reauth() 987 attr->encr_data_len, attr->iv, &eattr, in eap_sim_process_notification_reauth() 1117 if (attr->encr_data == NULL || attr->iv == NULL) { in eap_sim_process_reauthentication() 1125 attr->encr_data_len, attr->iv, &eattr, in eap_sim_process_reauthentication()
|
D | eap_aka.c | 1210 attr->encr_data_len, attr->iv, in eap_aka_process_challenge() 1244 if (attr->encr_data == NULL || attr->iv == NULL) { in eap_aka_process_notification_reauth() 1251 attr->encr_data_len, attr->iv, &eattr, in eap_aka_process_notification_reauth() 1381 if (attr->encr_data == NULL || attr->iv == NULL) { in eap_aka_process_reauthentication() 1389 attr->encr_data_len, attr->iv, &eattr, in eap_aka_process_reauthentication()
|