/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/crypto/ |
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 196 if (iv_len == 12) { in aes_gcm_prepare_j0() 198 os_memcpy(J0, iv, iv_len); in aes_gcm_prepare_j0() 199 os_memset(J0 + iv_len, 0, AES_BLOCK_SIZE - iv_len); in aes_gcm_prepare_j0() 207 ghash(H, iv, iv_len, J0); in aes_gcm_prepare_j0() 209 WPA_PUT_BE64(len_buf + 8, iv_len * 8); 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() [all …]
|
D | crypto_linux.c | 686 size_t iv_len = AES_BLOCK_SIZE; in aes_128_cbc_oper() local 698 CMSG_SPACE(sizeof(*alg_iv) + iv_len); in aes_128_cbc_oper() 712 hdr->cmsg_len = CMSG_SPACE(sizeof(*alg_iv) + iv_len); in aes_128_cbc_oper() 714 alg_iv->ivlen = iv_len; in aes_128_cbc_oper() 715 os_memcpy(alg_iv->iv, iv, iv_len); in aes_128_cbc_oper() 795 size_t iv_len = 8; in aes_unwrap() local 801 io[0].iov_base = (void *) (cipher + iv_len); in aes_unwrap() 807 CMSG_SPACE(sizeof(*alg_iv) + iv_len); in aes_unwrap() 821 hdr->cmsg_len = CMSG_SPACE(sizeof(*alg_iv) + iv_len); in aes_unwrap() 823 alg_iv->ivlen = iv_len; in aes_unwrap() [all …]
|
D | aes_wrap.h | 53 const u8 *iv, size_t iv_len, 58 const u8 *iv, size_t iv_len, 63 const u8 *iv, size_t iv_len,
|
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/crypto/ |
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 196 if (iv_len == 12) { in aes_gcm_prepare_j0() 198 os_memcpy(J0, iv, iv_len); in aes_gcm_prepare_j0() 199 os_memset(J0 + iv_len, 0, AES_BLOCK_SIZE - iv_len); in aes_gcm_prepare_j0() 207 ghash(H, iv, iv_len, J0); in aes_gcm_prepare_j0() 209 WPA_PUT_BE64(len_buf + 8, iv_len * 8); 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() [all …]
|
D | crypto_linux.c | 686 size_t iv_len = AES_BLOCK_SIZE; in aes_128_cbc_oper() local 698 CMSG_SPACE(sizeof(*alg_iv) + iv_len); in aes_128_cbc_oper() 712 hdr->cmsg_len = CMSG_SPACE(sizeof(*alg_iv) + iv_len); in aes_128_cbc_oper() 714 alg_iv->ivlen = iv_len; in aes_128_cbc_oper() 715 os_memcpy(alg_iv->iv, iv, iv_len); in aes_128_cbc_oper() 795 size_t iv_len = 8; in aes_unwrap() local 801 io[0].iov_base = (void *) (cipher + iv_len); in aes_unwrap() 807 CMSG_SPACE(sizeof(*alg_iv) + iv_len); in aes_unwrap() 821 hdr->cmsg_len = CMSG_SPACE(sizeof(*alg_iv) + iv_len); in aes_unwrap() 823 alg_iv->ivlen = iv_len; in aes_unwrap() [all …]
|
D | aes_wrap.h | 53 const u8 *iv, size_t iv_len, 58 const u8 *iv, size_t iv_len, 63 const u8 *iv, size_t iv_len,
|
/third_party/mbedtls/library/ |
D | ccm.c | 206 size_t iv_len ) in mbedtls_ccm_starts() argument 209 if( iv_len < 7 || iv_len > 13 ) in mbedtls_ccm_starts() 213 ctx->q = 16 - 1 - (unsigned char) iv_len; in mbedtls_ccm_starts() 227 memcpy( ctx->ctr + 1, iv, iv_len ); in mbedtls_ccm_starts() 228 memset( ctx->ctr + 1 + iv_len, 0, ctx->q ); in mbedtls_ccm_starts() 234 memcpy( ctx->y + 1, iv, iv_len ); in mbedtls_ccm_starts() 489 const unsigned char *iv, size_t iv_len, in ccm_auth_crypt() argument 497 if( ( ret = mbedtls_ccm_starts( ctx, mode, iv, iv_len ) ) != 0 ) in ccm_auth_crypt() 520 const unsigned char *iv, size_t iv_len, in mbedtls_ccm_star_encrypt_and_tag() argument 525 return( ccm_auth_crypt( ctx, MBEDTLS_CCM_STAR_ENCRYPT, length, iv, iv_len, in mbedtls_ccm_star_encrypt_and_tag() [all …]
|
D | cipher.c | 353 size_t iv_len ) in mbedtls_cipher_set_iv() argument 358 CIPHER_VALIDATE_RET( iv_len == 0 || iv != NULL ); in mbedtls_cipher_set_iv() 372 if( iv_len > MBEDTLS_MAX_IV_LENGTH ) in mbedtls_cipher_set_iv() 376 actual_iv_size = iv_len; in mbedtls_cipher_set_iv() 382 if( actual_iv_size > iv_len ) in mbedtls_cipher_set_iv() 403 iv, iv_len ) ); in mbedtls_cipher_set_iv() 428 iv, iv_len ) ); in mbedtls_cipher_set_iv() 1244 const unsigned char *iv, size_t iv_len, in mbedtls_cipher_crypt() argument 1252 CIPHER_VALIDATE_RET( iv_len == 0 || iv != NULL ); in mbedtls_cipher_crypt() 1296 status = psa_cipher_set_iv( &cipher_op, iv, iv_len ); in mbedtls_cipher_crypt() [all …]
|
D | ssl_tls13_keys.c | 203 size_t key_len, size_t iv_len, in mbedtls_ssl_tls13_make_traffic_keys() argument 228 keys->client_write_iv, iv_len ); in mbedtls_ssl_tls13_make_traffic_keys() 236 keys->server_write_iv, iv_len ); in mbedtls_ssl_tls13_make_traffic_keys() 241 keys->iv_len = iv_len; in mbedtls_ssl_tls13_make_traffic_keys() 876 memcpy( transform->iv_enc, iv_enc, traffic_keys->iv_len ); in mbedtls_ssl_tls13_populate_transform() 877 memcpy( transform->iv_dec, iv_dec, traffic_keys->iv_len ); in mbedtls_ssl_tls13_populate_transform() 904 transform->ivlen = traffic_keys->iv_len; in mbedtls_ssl_tls13_populate_transform() 959 size_t key_len, iv_len; in mbedtls_ssl_tls13_generate_handshake_keys() local 969 iv_len = cipher_info->iv_size; in mbedtls_ssl_tls13_generate_handshake_keys() 1029 md_size, key_len, iv_len, traffic_keys ); in mbedtls_ssl_tls13_generate_handshake_keys() [all …]
|
D | gcm.c | 250 const unsigned char *iv, size_t iv_len ) in mbedtls_gcm_starts() argument 264 if( iv_len == 0 || (uint64_t) iv_len >> 61 != 0 ) in mbedtls_gcm_starts() 274 if( iv_len == 12 ) in mbedtls_gcm_starts() 276 memcpy( ctx->y, iv, iv_len ); in mbedtls_gcm_starts() 282 iv_bits = (uint64_t)iv_len * 8; in mbedtls_gcm_starts() 286 while( iv_len > 0 ) in mbedtls_gcm_starts() 288 use_len = ( iv_len < 16 ) ? iv_len : 16; in mbedtls_gcm_starts() 295 iv_len -= use_len; in mbedtls_gcm_starts() 572 size_t iv_len, in mbedtls_gcm_crypt_and_tag() argument 590 if( ( ret = mbedtls_gcm_starts( ctx, mode, iv, iv_len ) ) != 0 ) in mbedtls_gcm_crypt_and_tag() [all …]
|
D | pem.c | 55 size_t iv_len ) in pem_get_iv() argument 59 memset( iv, 0, iv_len ); in pem_get_iv() 61 for( i = 0; i < iv_len * 2; i++, s++ ) in pem_get_iv()
|
/third_party/openssl/include/crypto/ |
D | evp.h | 136 int iv_len; member 248 key_len, iv_len, flags, init_key, cleanup, \ argument 251 nid##_##nmode, block_size, key_len, iv_len, \ 264 iv_len, flags, init_key, cleanup, set_asn1, \ argument 267 iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl) 270 iv_len, cbits, flags, init_key, cleanup, \ argument 273 key_len, iv_len, flags, init_key, cleanup, set_asn1, \ 277 iv_len, cbits, flags, init_key, cleanup, \ argument 280 key_len, iv_len, flags, init_key, cleanup, set_asn1, \ 290 nid, block_size, key_len, iv_len, cbits, flags, \ argument [all …]
|
/third_party/mbedtls/include/mbedtls/ |
D | ccm.h | 180 const unsigned char *iv, size_t iv_len, 229 const unsigned char *iv, size_t iv_len, 266 const unsigned char *iv, size_t iv_len, 312 const unsigned char *iv, size_t iv_len, 348 size_t iv_len );
|
D | gcm.h | 169 size_t iv_len, 213 size_t iv_len, 237 size_t iv_len );
|
D | cipher.h | 860 size_t iv_len ); 1043 const unsigned char *iv, size_t iv_len, 1093 const unsigned char *iv, size_t iv_len, 1149 const unsigned char *iv, size_t iv_len,
|
/third_party/mindspore/mindspore/core/utils/ |
D | crypto.cc | 95 auto iv_len = ByteToInt(int_buf.data(), int_buf.size()); in ParseEncryptData() local 97 …int_buf.assign(encrypt_data + iv_len + sizeof(int32_t), encrypt_data + iv_len + sizeof(int32_t) + … in ParseEncryptData() 99 if (iv_len <= 0 || cipher_len <= 0 || in ParseEncryptData() 100 …((static_cast<size_t>(iv_len) + sizeof(int32_t) + static_cast<size_t>(cipher_len) + sizeof(int32_t… in ParseEncryptData() 106 (*iv).assign(encrypt_data + sizeof(int32_t), encrypt_data + sizeof(int32_t) + iv_len); in ParseEncryptData() 108 .assign(encrypt_data + sizeof(int32_t) + iv_len + sizeof(int32_t), in ParseEncryptData() 109 encrypt_data + sizeof(int32_t) + iv_len + sizeof(int32_t) + cipher_len); in ParseEncryptData() 192 int32_t iv_len = AES_BLOCK_SIZE; in BlockEncrypt() local 193 std::vector<Byte> iv(iv_len); in BlockEncrypt() 194 auto ret = RAND_bytes(iv.data(), iv_len); in BlockEncrypt() [all …]
|
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/eap_common/ |
D | ikev2_common.c | 434 size_t iv_len; in ikev2_decrypt_payload() local 453 iv_len = encr_alg->block_size; in ikev2_decrypt_payload() 461 if (encrypted_len < iv_len + 1 + integ_alg->hash_len) { in ikev2_decrypt_payload() 468 pos = iv + iv_len; in ikev2_decrypt_payload() 536 size_t iv_len, pad_len; in ikev2_build_encrypted() local 552 iv_len = encr_alg->block_size; in ikev2_build_encrypted() 574 iv = wpabuf_put(msg, iv_len); in ikev2_build_encrypted() 575 if (random_get_bytes(iv, iv_len)) { in ikev2_build_encrypted() 580 pad_len = iv_len - (wpabuf_len(plain) + 1) % iv_len; in ikev2_build_encrypted() 581 if (pad_len == iv_len) in ikev2_build_encrypted()
|
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/eap_common/ |
D | ikev2_common.c | 434 size_t iv_len; in ikev2_decrypt_payload() local 453 iv_len = encr_alg->block_size; in ikev2_decrypt_payload() 461 if (encrypted_len < iv_len + 1 + integ_alg->hash_len) { in ikev2_decrypt_payload() 468 pos = iv + iv_len; in ikev2_decrypt_payload() 536 size_t iv_len, pad_len; in ikev2_build_encrypted() local 552 iv_len = encr_alg->block_size; in ikev2_build_encrypted() 574 iv = wpabuf_put(msg, iv_len); in ikev2_build_encrypted() 575 if (random_get_bytes(iv, iv_len)) { in ikev2_build_encrypted() 580 pad_len = iv_len - (wpabuf_len(plain) + 1) % iv_len; in ikev2_build_encrypted() 581 if (pad_len == iv_len) in ikev2_build_encrypted()
|
/third_party/openssl/crypto/evp/ |
D | cmeth_lib.c | 43 int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len) in EVP_CIPHER_meth_set_iv_length() argument 45 cipher->iv_len = iv_len; in EVP_CIPHER_meth_set_iv_length()
|
/third_party/mbedtls/tests/scripts/ |
D | gen_gcm_encrypt.pl | 64 my $iv_len = get_suite_val("IVlen"); 79 print("GCM NIST Validation (AES-$key_len,$iv_len,$pt_len,$add_len,$tag_len) #$Count\n");
|
D | gen_gcm_decrypt.pl | 81 my $iv_len = get_suite_val("IVlen"); 96 print("GCM NIST Validation (AES-$key_len,$iv_len,$pt_len,$add_len,$tag_len) #$Count\n");
|
/third_party/mbedtls/tests/suites/ |
D | test_suite_ccm.function | 97 void ccm_lengths( int msg_len, int iv_len, int add_len, int tag_len, int res ) 120 TEST_ASSERT( mbedtls_ccm_encrypt_and_tag( &ctx, msg_len, iv, iv_len, add, add_len, 123 decrypt_ret = mbedtls_ccm_auth_decrypt( &ctx, msg_len, iv, iv_len, add, add_len, 138 void ccm_star_lengths( int msg_len, int iv_len, int add_len, int tag_len, 162 TEST_ASSERT( mbedtls_ccm_star_encrypt_and_tag( &ctx, msg_len, iv, iv_len, 165 decrypt_ret = mbedtls_ccm_star_auth_decrypt( &ctx, msg_len, iv, iv_len, add, 331 size_t iv_len, expected_tag_len; 361 iv_len = sizeof( iv ); 367 TEST_EQUAL( mbedtls_ccm_star_encrypt_and_tag( &ctx, msg->len, iv, iv_len, 377 .len = iv_len }; [all …]
|
D | test_suite_cipher.function | 384 size_t length = length_val, outlen, total_len, i, block_size, iv_len; 443 iv_len = 13; /* For CCM, IV length is expected to be between 7 and 13 bytes. 446 iv_len = sizeof(iv); 448 TEST_ASSERT( 0 == mbedtls_cipher_set_iv( &ctx_dec, iv, iv_len ) ); 449 TEST_ASSERT( 0 == mbedtls_cipher_set_iv( &ctx_enc, iv, iv_len ) ); 644 size_t iv_len; 690 iv_len = 13; /* For CCM, IV length is expected to be between 7 and 13 bytes. 693 iv_len = sizeof(iv); 695 TEST_ASSERT( 0 == mbedtls_cipher_set_iv( &ctx_dec, iv, iv_len ) ); 696 TEST_ASSERT( 0 == mbedtls_cipher_set_iv( &ctx_enc, iv, iv_len ) );
|
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/tls/ |
D | pkcs5.c | 34 size_t iv_len; member 254 params->iv_len = 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() 367 params->iv_len != 8) in pkcs5_crypto_init_pbes2() 380 wpa_hexdump(MSG_DEBUG, "PKCS #5: DES IV", params->iv, params->iv_len); in pkcs5_crypto_init_pbes2()
|
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/tls/ |
D | pkcs5.c | 34 size_t iv_len; member 270 params->iv_len = hdr.length; in pkcs5_get_params_pbes2() 271 wpa_hexdump(MSG_DEBUG, "PKCS #5: IV", params->iv, params->iv_len); in pkcs5_get_params_pbes2() 389 params->iv_len != 8) in pkcs5_crypto_init_pbes2() 402 wpa_hexdump(MSG_DEBUG, "PKCS #5: DES IV", params->iv, params->iv_len); in pkcs5_crypto_init_pbes2()
|