Lines Matching refs:tdata

2640 		const struct wireless_test_data *tdata)  in create_wireless_cipher_auth_session()  argument
2642 const uint8_t key_len = tdata->key.len; in create_wireless_cipher_auth_session()
2648 const uint8_t *key = tdata->key.data; in create_wireless_cipher_auth_session()
2649 const uint8_t auth_len = tdata->digest.len; in create_wireless_cipher_auth_session()
2650 uint8_t cipher_iv_len = tdata->cipher_iv.len; in create_wireless_cipher_auth_session()
2651 uint8_t auth_iv_len = tdata->auth_iv.len; in create_wireless_cipher_auth_session()
2700 const struct wireless_test_data *tdata) in create_zuc_cipher_auth_encrypt_generate_session() argument
2705 RTE_CRYPTO_CIPHER_ZUC_EEA3, tdata); in create_zuc_cipher_auth_encrypt_generate_session()
2828 create_wireless_cipher_hash_operation(const struct wireless_test_data *tdata, in create_wireless_cipher_hash_operation() argument
2834 const uint8_t *auth_tag = tdata->digest.data; in create_wireless_cipher_hash_operation()
2835 const unsigned int auth_tag_len = tdata->digest.len; in create_wireless_cipher_hash_operation()
2836 unsigned int plaintext_len = ceil_byte_length(tdata->plaintext.len); in create_wireless_cipher_hash_operation()
2839 const uint8_t *cipher_iv = tdata->cipher_iv.data; in create_wireless_cipher_hash_operation()
2840 const uint8_t cipher_iv_len = tdata->cipher_iv.len; in create_wireless_cipher_hash_operation()
2841 const uint8_t *auth_iv = tdata->auth_iv.data; in create_wireless_cipher_hash_operation()
2842 const uint8_t auth_iv_len = tdata->auth_iv.len; in create_wireless_cipher_hash_operation()
2843 const unsigned int cipher_len = tdata->validCipherLenInBits.len; in create_wireless_cipher_hash_operation()
2844 const unsigned int auth_len = tdata->validAuthLenInBits.len; in create_wireless_cipher_hash_operation()
2894 const struct wireless_test_data *tdata) in create_zuc_cipher_hash_generate_operation() argument
2896 return create_wireless_cipher_hash_operation(tdata, in create_zuc_cipher_hash_generate_operation()
3109 test_snow3g_authentication(const struct snow3g_hash_test_data *tdata) in test_snow3g_authentication() argument
3124 ((tdata->validAuthLenInBits.len % 8) != 0)) { in test_snow3g_authentication()
3148 tdata->key.data, tdata->key.len, in test_snow3g_authentication()
3149 tdata->auth_iv.len, tdata->digest.len, in test_snow3g_authentication()
3161 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_snow3g_authentication()
3167 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_snow3g_authentication()
3170 retval = create_wireless_algo_hash_operation(NULL, tdata->digest.len, in test_snow3g_authentication()
3171 tdata->auth_iv.data, tdata->auth_iv.len, in test_snow3g_authentication()
3173 tdata->validAuthLenInBits.len, in test_snow3g_authentication()
3192 tdata->digest.data, in test_snow3g_authentication()
3200 test_snow3g_authentication_verify(const struct snow3g_hash_test_data *tdata) in test_snow3g_authentication_verify() argument
3215 ((tdata->validAuthLenInBits.len % 8) != 0)) { in test_snow3g_authentication_verify()
3239 tdata->key.data, tdata->key.len, in test_snow3g_authentication_verify()
3240 tdata->auth_iv.len, tdata->digest.len, in test_snow3g_authentication_verify()
3251 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_snow3g_authentication_verify()
3257 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_snow3g_authentication_verify()
3260 retval = create_wireless_algo_hash_operation(tdata->digest.data, in test_snow3g_authentication_verify()
3261 tdata->digest.len, in test_snow3g_authentication_verify()
3262 tdata->auth_iv.data, tdata->auth_iv.len, in test_snow3g_authentication_verify()
3265 tdata->validAuthLenInBits.len, in test_snow3g_authentication_verify()
3291 test_kasumi_authentication(const struct kasumi_hash_test_data *tdata) in test_kasumi_authentication() argument
3324 tdata->key.data, tdata->key.len, in test_kasumi_authentication()
3325 0, tdata->digest.len, in test_kasumi_authentication()
3337 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_kasumi_authentication()
3343 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_kasumi_authentication()
3346 retval = create_wireless_algo_hash_operation(NULL, tdata->digest.len, in test_kasumi_authentication()
3349 tdata->plaintext.len, in test_kasumi_authentication()
3372 tdata->digest.data, in test_kasumi_authentication()
3380 test_kasumi_authentication_verify(const struct kasumi_hash_test_data *tdata) in test_kasumi_authentication_verify() argument
3413 tdata->key.data, tdata->key.len, in test_kasumi_authentication_verify()
3414 0, tdata->digest.len, in test_kasumi_authentication_verify()
3425 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_kasumi_authentication_verify()
3431 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_kasumi_authentication_verify()
3434 retval = create_wireless_algo_hash_operation(tdata->digest.data, in test_kasumi_authentication_verify()
3435 tdata->digest.len, in test_kasumi_authentication_verify()
3439 tdata->plaintext.len, in test_kasumi_authentication_verify()
3604 test_kasumi_encryption(const struct kasumi_test_data *tdata) in test_kasumi_encryption() argument
3639 tdata->key.data, tdata->key.len, in test_kasumi_encryption()
3640 tdata->cipher_iv.len); in test_kasumi_encryption()
3650 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_kasumi_encryption()
3656 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_kasumi_encryption()
3661 retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data, in test_kasumi_encryption()
3662 tdata->cipher_iv.len, in test_kasumi_encryption()
3663 RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8), in test_kasumi_encryption()
3664 tdata->validCipherOffsetInBits.len); in test_kasumi_encryption()
3670 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_kasumi_encryption()
3680 ciphertext = plaintext + (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_encryption()
3684 const uint8_t *reference_ciphertext = tdata->ciphertext.data + in test_kasumi_encryption()
3685 (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_encryption()
3690 tdata->validCipherLenInBits.len, in test_kasumi_encryption()
3696 test_kasumi_encryption_sgl(const struct kasumi_test_data *tdata) in test_kasumi_encryption_sgl() argument
3742 tdata->key.data, tdata->key.len, in test_kasumi_encryption_sgl()
3743 tdata->cipher_iv.len); in test_kasumi_encryption_sgl()
3747 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_kasumi_encryption_sgl()
3757 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_kasumi_encryption_sgl()
3760 retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data, in test_kasumi_encryption_sgl()
3761 tdata->cipher_iv.len, in test_kasumi_encryption_sgl()
3762 RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8), in test_kasumi_encryption_sgl()
3763 tdata->validCipherOffsetInBits.len); in test_kasumi_encryption_sgl()
3769 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_kasumi_encryption_sgl()
3782 tdata->validCipherOffsetInBits.len >> 3, in test_kasumi_encryption_sgl()
3788 const uint8_t *reference_ciphertext = tdata->ciphertext.data + in test_kasumi_encryption_sgl()
3789 (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_encryption_sgl()
3794 tdata->validCipherLenInBits.len, in test_kasumi_encryption_sgl()
3800 test_kasumi_encryption_oop(const struct kasumi_test_data *tdata) in test_kasumi_encryption_oop() argument
3829 tdata->key.data, tdata->key.len, in test_kasumi_encryption_oop()
3830 tdata->cipher_iv.len); in test_kasumi_encryption_oop()
3841 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_kasumi_encryption_oop()
3848 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_kasumi_encryption_oop()
3853 retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data, in test_kasumi_encryption_oop()
3854 tdata->cipher_iv.len, in test_kasumi_encryption_oop()
3855 RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8), in test_kasumi_encryption_oop()
3856 tdata->validCipherOffsetInBits.len); in test_kasumi_encryption_oop()
3868 ciphertext = plaintext + (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_encryption_oop()
3872 const uint8_t *reference_ciphertext = tdata->ciphertext.data + in test_kasumi_encryption_oop()
3873 (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_encryption_oop()
3878 tdata->validCipherLenInBits.len, in test_kasumi_encryption_oop()
3884 test_kasumi_encryption_oop_sgl(const struct kasumi_test_data *tdata) in test_kasumi_encryption_oop_sgl() argument
3926 tdata->key.data, tdata->key.len, in test_kasumi_encryption_oop_sgl()
3927 tdata->cipher_iv.len); in test_kasumi_encryption_oop_sgl()
3931 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_kasumi_encryption_oop_sgl()
3943 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_kasumi_encryption_oop_sgl()
3946 retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data, in test_kasumi_encryption_oop_sgl()
3947 tdata->cipher_iv.len, in test_kasumi_encryption_oop_sgl()
3948 RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8), in test_kasumi_encryption_oop_sgl()
3949 tdata->validCipherOffsetInBits.len); in test_kasumi_encryption_oop_sgl()
3963 tdata->validCipherOffsetInBits.len >> 3, in test_kasumi_encryption_oop_sgl()
3966 const uint8_t *reference_ciphertext = tdata->ciphertext.data + in test_kasumi_encryption_oop_sgl()
3967 (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_encryption_oop_sgl()
3972 tdata->validCipherLenInBits.len, in test_kasumi_encryption_oop_sgl()
3979 test_kasumi_decryption_oop(const struct kasumi_test_data *tdata) in test_kasumi_decryption_oop() argument
4007 tdata->key.data, tdata->key.len, in test_kasumi_decryption_oop()
4008 tdata->cipher_iv.len); in test_kasumi_decryption_oop()
4019 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_kasumi_decryption_oop()
4026 memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); in test_kasumi_decryption_oop()
4031 retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data, in test_kasumi_decryption_oop()
4032 tdata->cipher_iv.len, in test_kasumi_decryption_oop()
4033 RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8), in test_kasumi_decryption_oop()
4034 tdata->validCipherOffsetInBits.len); in test_kasumi_decryption_oop()
4046 plaintext = ciphertext + (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_decryption_oop()
4050 const uint8_t *reference_plaintext = tdata->plaintext.data + in test_kasumi_decryption_oop()
4051 (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_decryption_oop()
4056 tdata->validCipherLenInBits.len, in test_kasumi_decryption_oop()
4062 test_kasumi_decryption(const struct kasumi_test_data *tdata) in test_kasumi_decryption() argument
4097 tdata->key.data, tdata->key.len, in test_kasumi_decryption()
4098 tdata->cipher_iv.len); in test_kasumi_decryption()
4108 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_kasumi_decryption()
4114 memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); in test_kasumi_decryption()
4119 retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data, in test_kasumi_decryption()
4120 tdata->cipher_iv.len, in test_kasumi_decryption()
4121 RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8), in test_kasumi_decryption()
4122 tdata->validCipherOffsetInBits.len); in test_kasumi_decryption()
4138 plaintext = ciphertext + (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_decryption()
4142 const uint8_t *reference_plaintext = tdata->plaintext.data + in test_kasumi_decryption()
4143 (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_decryption()
4148 tdata->validCipherLenInBits.len, in test_kasumi_decryption()
4154 test_snow3g_encryption(const struct snow3g_test_data *tdata) in test_snow3g_encryption() argument
4189 tdata->key.data, tdata->key.len, in test_snow3g_encryption()
4190 tdata->cipher_iv.len); in test_snow3g_encryption()
4200 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_snow3g_encryption()
4206 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_snow3g_encryption()
4211 retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data, in test_snow3g_encryption()
4212 tdata->cipher_iv.len, in test_snow3g_encryption()
4213 tdata->validCipherLenInBits.len, in test_snow3g_encryption()
4220 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_encryption()
4237 tdata->ciphertext.data, in test_snow3g_encryption()
4238 tdata->validDataLenInBits.len, in test_snow3g_encryption()
4245 test_snow3g_encryption_oop(const struct snow3g_test_data *tdata) in test_snow3g_encryption_oop() argument
4283 tdata->key.data, tdata->key.len, in test_snow3g_encryption_oop()
4284 tdata->cipher_iv.len); in test_snow3g_encryption_oop()
4300 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_snow3g_encryption_oop()
4307 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_snow3g_encryption_oop()
4312 retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data, in test_snow3g_encryption_oop()
4313 tdata->cipher_iv.len, in test_snow3g_encryption_oop()
4314 tdata->validCipherLenInBits.len, in test_snow3g_encryption_oop()
4321 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_encryption_oop()
4338 tdata->ciphertext.data, in test_snow3g_encryption_oop()
4339 tdata->validDataLenInBits.len, in test_snow3g_encryption_oop()
4345 test_snow3g_encryption_oop_sgl(const struct snow3g_test_data *tdata) in test_snow3g_encryption_oop_sgl() argument
4393 tdata->key.data, tdata->key.len, in test_snow3g_encryption_oop_sgl()
4394 tdata->cipher_iv.len); in test_snow3g_encryption_oop_sgl()
4398 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_snow3g_encryption_oop_sgl()
4413 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_snow3g_encryption_oop_sgl()
4416 retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data, in test_snow3g_encryption_oop_sgl()
4417 tdata->cipher_iv.len, in test_snow3g_encryption_oop_sgl()
4418 tdata->validCipherLenInBits.len, in test_snow3g_encryption_oop_sgl()
4425 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_encryption_oop_sgl()
4444 tdata->ciphertext.data, in test_snow3g_encryption_oop_sgl()
4445 tdata->validDataLenInBits.len, in test_snow3g_encryption_oop_sgl()
4472 test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata) in test_snow3g_encryption_offset_oop() argument
4488 ((tdata->validDataLenInBits.len % 8) != 0)) { in test_snow3g_encryption_offset_oop()
4511 tdata->key.data, tdata->key.len, in test_snow3g_encryption_offset_oop()
4512 tdata->cipher_iv.len); in test_snow3g_encryption_offset_oop()
4528 plaintext_len = ceil_byte_length(tdata->plaintext.len + extra_offset); in test_snow3g_encryption_offset_oop()
4540 memcpy(plaintext, tdata->plaintext.data, (tdata->plaintext.len >> 3)); in test_snow3g_encryption_offset_oop()
4541 buffer_shift_right(plaintext, tdata->plaintext.len, extra_offset); in test_snow3g_encryption_offset_oop()
4544 rte_hexdump(stdout, "plaintext:", plaintext, tdata->plaintext.len); in test_snow3g_encryption_offset_oop()
4547 retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data, in test_snow3g_encryption_offset_oop()
4548 tdata->cipher_iv.len, in test_snow3g_encryption_offset_oop()
4549 tdata->validCipherLenInBits.len, in test_snow3g_encryption_offset_oop()
4556 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_encryption_offset_oop()
4577 memcpy(expected_ciphertext_shifted, tdata->ciphertext.data, in test_snow3g_encryption_offset_oop()
4578 ceil_byte_length(tdata->ciphertext.len)); in test_snow3g_encryption_offset_oop()
4579 buffer_shift_right(expected_ciphertext_shifted, tdata->ciphertext.len, in test_snow3g_encryption_offset_oop()
4585 tdata->validDataLenInBits.len, in test_snow3g_encryption_offset_oop()
4591 static int test_snow3g_decryption(const struct snow3g_test_data *tdata) in test_snow3g_decryption() argument
4627 tdata->key.data, tdata->key.len, in test_snow3g_decryption()
4628 tdata->cipher_iv.len); in test_snow3g_decryption()
4638 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_snow3g_decryption()
4644 memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); in test_snow3g_decryption()
4649 retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data, in test_snow3g_decryption()
4650 tdata->cipher_iv.len, in test_snow3g_decryption()
4651 tdata->validCipherLenInBits.len, in test_snow3g_decryption()
4652 tdata->cipher.offset_bits); in test_snow3g_decryption()
4658 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_decryption()
4673 tdata->plaintext.data, in test_snow3g_decryption()
4674 tdata->validDataLenInBits.len, in test_snow3g_decryption()
4679 static int test_snow3g_decryption_oop(const struct snow3g_test_data *tdata) in test_snow3g_decryption_oop() argument
4717 tdata->key.data, tdata->key.len, in test_snow3g_decryption_oop()
4718 tdata->cipher_iv.len); in test_snow3g_decryption_oop()
4737 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_snow3g_decryption_oop()
4744 memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); in test_snow3g_decryption_oop()
4749 retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data, in test_snow3g_decryption_oop()
4750 tdata->cipher_iv.len, in test_snow3g_decryption_oop()
4751 tdata->validCipherLenInBits.len, in test_snow3g_decryption_oop()
4758 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_decryption_oop()
4773 tdata->plaintext.data, in test_snow3g_decryption_oop()
4774 tdata->validDataLenInBits.len, in test_snow3g_decryption_oop()
4780 test_zuc_cipher_auth(const struct wireless_test_data *tdata) in test_zuc_cipher_auth() argument
4798 ((tdata->validAuthLenInBits.len % 8 != 0) || in test_zuc_cipher_auth()
4799 (tdata->validDataLenInBits.len % 8 != 0))) { in test_zuc_cipher_auth()
4832 tdata); in test_zuc_cipher_auth()
4841 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_zuc_cipher_auth()
4847 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_zuc_cipher_auth()
4852 retval = create_zuc_cipher_hash_generate_operation(tdata); in test_zuc_cipher_auth()
4858 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_zuc_cipher_auth()
4873 tdata->ciphertext.data, in test_zuc_cipher_auth()
4874 tdata->validDataLenInBits.len, in test_zuc_cipher_auth()
4883 tdata->digest.data, in test_zuc_cipher_auth()
4890 test_snow3g_cipher_auth(const struct snow3g_test_data *tdata) in test_snow3g_cipher_auth() argument
4933 tdata->key.data, tdata->key.len, in test_snow3g_cipher_auth()
4934 tdata->auth_iv.len, tdata->digest.len, in test_snow3g_cipher_auth()
4935 tdata->cipher_iv.len); in test_snow3g_cipher_auth()
4944 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_snow3g_cipher_auth()
4950 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_snow3g_cipher_auth()
4955 retval = create_wireless_algo_cipher_hash_operation(tdata->digest.data, in test_snow3g_cipher_auth()
4956 tdata->digest.len, tdata->auth_iv.data, in test_snow3g_cipher_auth()
4957 tdata->auth_iv.len, in test_snow3g_cipher_auth()
4959 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_snow3g_cipher_auth()
4960 tdata->validCipherLenInBits.len, in test_snow3g_cipher_auth()
4962 tdata->validAuthLenInBits.len, in test_snow3g_cipher_auth()
4970 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_snow3g_cipher_auth()
4985 tdata->ciphertext.data, in test_snow3g_cipher_auth()
4986 tdata->validDataLenInBits.len, in test_snow3g_cipher_auth()
4995 tdata->digest.data, in test_snow3g_cipher_auth()
5002 test_snow3g_auth_cipher(const struct snow3g_test_data *tdata, in test_snow3g_auth_cipher() argument
5062 tdata->key.data, tdata->key.len, in test_snow3g_auth_cipher()
5063 tdata->auth_iv.len, tdata->digest.len, in test_snow3g_auth_cipher()
5064 tdata->cipher_iv.len); in test_snow3g_auth_cipher()
5079 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_snow3g_auth_cipher()
5080 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_snow3g_auth_cipher()
5087 memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); in test_snow3g_auth_cipher()
5095 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_snow3g_auth_cipher()
5103 tdata->digest.data, tdata->digest.len, in test_snow3g_auth_cipher()
5104 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_snow3g_auth_cipher()
5105 tdata->auth_iv.data, tdata->auth_iv.len, in test_snow3g_auth_cipher()
5106 (tdata->digest.offset_bytes == 0 ? in test_snow3g_auth_cipher()
5108 : tdata->digest.offset_bytes), in test_snow3g_auth_cipher()
5109 tdata->validCipherLenInBits.len, in test_snow3g_auth_cipher()
5110 tdata->cipher.offset_bits, in test_snow3g_auth_cipher()
5111 tdata->validAuthLenInBits.len, in test_snow3g_auth_cipher()
5112 tdata->auth.offset_bits, in test_snow3g_auth_cipher()
5120 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_snow3g_auth_cipher()
5136 (tdata->cipher.offset_bits >> 3); in test_snow3g_auth_cipher()
5139 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_snow3g_auth_cipher()
5141 tdata->plaintext.data, in test_snow3g_auth_cipher()
5142 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_snow3g_auth_cipher()
5153 tdata->ciphertext.data, tdata->ciphertext.len >> 3); in test_snow3g_auth_cipher()
5156 + (tdata->digest.offset_bytes == 0 ? in test_snow3g_auth_cipher()
5157 plaintext_pad_len : tdata->digest.offset_bytes); in test_snow3g_auth_cipher()
5160 tdata->digest.len); in test_snow3g_auth_cipher()
5161 debug_hexdump(stdout, "digest expected:", tdata->digest.data, in test_snow3g_auth_cipher()
5162 tdata->digest.len); in test_snow3g_auth_cipher()
5169 tdata->plaintext.data, in test_snow3g_auth_cipher()
5170 (tdata->plaintext.len - tdata->cipher.offset_bits - in test_snow3g_auth_cipher()
5171 (tdata->digest.len << 3)), in test_snow3g_auth_cipher()
5172 tdata->cipher.offset_bits, in test_snow3g_auth_cipher()
5177 tdata->ciphertext.data, in test_snow3g_auth_cipher()
5178 (tdata->validDataLenInBits.len - in test_snow3g_auth_cipher()
5179 tdata->cipher.offset_bits), in test_snow3g_auth_cipher()
5180 tdata->cipher.offset_bits, in test_snow3g_auth_cipher()
5185 tdata->digest.data, in test_snow3g_auth_cipher()
5193 test_snow3g_auth_cipher_sgl(const struct snow3g_test_data *tdata, in test_snow3g_auth_cipher_sgl() argument
5267 tdata->key.data, tdata->key.len, in test_snow3g_auth_cipher_sgl()
5268 tdata->auth_iv.len, tdata->digest.len, in test_snow3g_auth_cipher_sgl()
5269 tdata->cipher_iv.len); in test_snow3g_auth_cipher_sgl()
5274 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_snow3g_auth_cipher_sgl()
5275 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_snow3g_auth_cipher_sgl()
5293 tdata->ciphertext.data); in test_snow3g_auth_cipher_sgl()
5300 tdata->plaintext.data); in test_snow3g_auth_cipher_sgl()
5310 tdata->digest.data, tdata->digest.len, in test_snow3g_auth_cipher_sgl()
5311 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_snow3g_auth_cipher_sgl()
5312 tdata->auth_iv.data, tdata->auth_iv.len, in test_snow3g_auth_cipher_sgl()
5313 (tdata->digest.offset_bytes == 0 ? in test_snow3g_auth_cipher_sgl()
5315 : tdata->digest.offset_bytes), in test_snow3g_auth_cipher_sgl()
5316 tdata->validCipherLenInBits.len, in test_snow3g_auth_cipher_sgl()
5317 tdata->cipher.offset_bits, in test_snow3g_auth_cipher_sgl()
5318 tdata->validAuthLenInBits.len, in test_snow3g_auth_cipher_sgl()
5319 tdata->auth.offset_bits, in test_snow3g_auth_cipher_sgl()
5327 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_snow3g_auth_cipher_sgl()
5346 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_snow3g_auth_cipher_sgl()
5348 tdata->plaintext.data, in test_snow3g_auth_cipher_sgl()
5349 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_snow3g_auth_cipher_sgl()
5361 tdata->ciphertext.data, tdata->ciphertext.len >> 3); in test_snow3g_auth_cipher_sgl()
5365 (tdata->digest.offset_bytes == 0 ? in test_snow3g_auth_cipher_sgl()
5366 plaintext_pad_len : tdata->digest.offset_bytes), in test_snow3g_auth_cipher_sgl()
5367 tdata->digest.len, digest_buffer); in test_snow3g_auth_cipher_sgl()
5370 (tdata->digest.offset_bytes == 0 ? in test_snow3g_auth_cipher_sgl()
5371 plaintext_pad_len : tdata->digest.offset_bytes), in test_snow3g_auth_cipher_sgl()
5372 tdata->digest.len, digest_buffer); in test_snow3g_auth_cipher_sgl()
5375 tdata->digest.len); in test_snow3g_auth_cipher_sgl()
5377 tdata->digest.data, tdata->digest.len); in test_snow3g_auth_cipher_sgl()
5384 tdata->plaintext.data, in test_snow3g_auth_cipher_sgl()
5385 (tdata->plaintext.len - tdata->cipher.offset_bits - in test_snow3g_auth_cipher_sgl()
5386 (tdata->digest.len << 3)), in test_snow3g_auth_cipher_sgl()
5387 tdata->cipher.offset_bits, in test_snow3g_auth_cipher_sgl()
5392 tdata->ciphertext.data, in test_snow3g_auth_cipher_sgl()
5393 (tdata->validDataLenInBits.len - in test_snow3g_auth_cipher_sgl()
5394 tdata->cipher.offset_bits), in test_snow3g_auth_cipher_sgl()
5395 tdata->cipher.offset_bits, in test_snow3g_auth_cipher_sgl()
5400 tdata->digest.data, in test_snow3g_auth_cipher_sgl()
5408 test_kasumi_auth_cipher(const struct kasumi_test_data *tdata, in test_kasumi_auth_cipher() argument
5468 tdata->key.data, tdata->key.len, in test_kasumi_auth_cipher()
5469 0, tdata->digest.len, in test_kasumi_auth_cipher()
5470 tdata->cipher_iv.len); in test_kasumi_auth_cipher()
5486 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_kasumi_auth_cipher()
5487 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_kasumi_auth_cipher()
5494 memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); in test_kasumi_auth_cipher()
5502 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_kasumi_auth_cipher()
5511 tdata->digest.data, tdata->digest.len, in test_kasumi_auth_cipher()
5512 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_kasumi_auth_cipher()
5514 (tdata->digest.offset_bytes == 0 ? in test_kasumi_auth_cipher()
5516 : tdata->digest.offset_bytes), in test_kasumi_auth_cipher()
5517 tdata->validCipherLenInBits.len, in test_kasumi_auth_cipher()
5518 tdata->validCipherOffsetInBits.len, in test_kasumi_auth_cipher()
5519 tdata->validAuthLenInBits.len, in test_kasumi_auth_cipher()
5528 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_kasumi_auth_cipher()
5547 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_kasumi_auth_cipher()
5549 tdata->plaintext.data, in test_kasumi_auth_cipher()
5550 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_kasumi_auth_cipher()
5561 tdata->ciphertext.data, tdata->ciphertext.len >> 3); in test_kasumi_auth_cipher()
5565 (tdata->digest.offset_bytes == 0 ? in test_kasumi_auth_cipher()
5566 plaintext_pad_len : tdata->digest.offset_bytes); in test_kasumi_auth_cipher()
5569 tdata->digest.len); in test_kasumi_auth_cipher()
5571 tdata->digest.data, tdata->digest.len); in test_kasumi_auth_cipher()
5578 tdata->plaintext.data, in test_kasumi_auth_cipher()
5579 tdata->plaintext.len >> 3, in test_kasumi_auth_cipher()
5584 tdata->ciphertext.data, in test_kasumi_auth_cipher()
5585 tdata->ciphertext.len >> 3, in test_kasumi_auth_cipher()
5590 tdata->digest.data, in test_kasumi_auth_cipher()
5598 test_kasumi_auth_cipher_sgl(const struct kasumi_test_data *tdata, in test_kasumi_auth_cipher_sgl() argument
5672 tdata->key.data, tdata->key.len, in test_kasumi_auth_cipher_sgl()
5673 0, tdata->digest.len, in test_kasumi_auth_cipher_sgl()
5674 tdata->cipher_iv.len); in test_kasumi_auth_cipher_sgl()
5679 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_kasumi_auth_cipher_sgl()
5680 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_kasumi_auth_cipher_sgl()
5698 tdata->ciphertext.data); in test_kasumi_auth_cipher_sgl()
5705 tdata->plaintext.data); in test_kasumi_auth_cipher_sgl()
5715 tdata->digest.data, tdata->digest.len, in test_kasumi_auth_cipher_sgl()
5716 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_kasumi_auth_cipher_sgl()
5718 (tdata->digest.offset_bytes == 0 ? in test_kasumi_auth_cipher_sgl()
5720 : tdata->digest.offset_bytes), in test_kasumi_auth_cipher_sgl()
5721 tdata->validCipherLenInBits.len, in test_kasumi_auth_cipher_sgl()
5722 tdata->validCipherOffsetInBits.len, in test_kasumi_auth_cipher_sgl()
5723 tdata->validAuthLenInBits.len, in test_kasumi_auth_cipher_sgl()
5732 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_kasumi_auth_cipher_sgl()
5751 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_kasumi_auth_cipher_sgl()
5753 tdata->plaintext.data, in test_kasumi_auth_cipher_sgl()
5754 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_kasumi_auth_cipher_sgl()
5766 tdata->ciphertext.data, tdata->ciphertext.len >> 3); in test_kasumi_auth_cipher_sgl()
5770 (tdata->digest.offset_bytes == 0 ? in test_kasumi_auth_cipher_sgl()
5771 plaintext_pad_len : tdata->digest.offset_bytes), in test_kasumi_auth_cipher_sgl()
5772 tdata->digest.len, digest_buffer); in test_kasumi_auth_cipher_sgl()
5775 (tdata->digest.offset_bytes == 0 ? in test_kasumi_auth_cipher_sgl()
5776 plaintext_pad_len : tdata->digest.offset_bytes), in test_kasumi_auth_cipher_sgl()
5777 tdata->digest.len, digest_buffer); in test_kasumi_auth_cipher_sgl()
5780 tdata->digest.len); in test_kasumi_auth_cipher_sgl()
5782 tdata->digest.data, tdata->digest.len); in test_kasumi_auth_cipher_sgl()
5789 tdata->plaintext.data, in test_kasumi_auth_cipher_sgl()
5790 tdata->plaintext.len >> 3, in test_kasumi_auth_cipher_sgl()
5795 tdata->ciphertext.data, in test_kasumi_auth_cipher_sgl()
5796 tdata->validDataLenInBits.len, in test_kasumi_auth_cipher_sgl()
5801 tdata->digest.data, in test_kasumi_auth_cipher_sgl()
5809 test_kasumi_cipher_auth(const struct kasumi_test_data *tdata) in test_kasumi_cipher_auth() argument
5853 tdata->key.data, tdata->key.len, in test_kasumi_cipher_auth()
5854 0, tdata->digest.len, in test_kasumi_cipher_auth()
5855 tdata->cipher_iv.len); in test_kasumi_cipher_auth()
5865 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_kasumi_cipher_auth()
5871 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_kasumi_cipher_auth()
5876 retval = create_wireless_algo_cipher_hash_operation(tdata->digest.data, in test_kasumi_cipher_auth()
5877 tdata->digest.len, NULL, 0, in test_kasumi_cipher_auth()
5879 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_kasumi_cipher_auth()
5880 RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8), in test_kasumi_cipher_auth()
5881 tdata->validCipherOffsetInBits.len, in test_kasumi_cipher_auth()
5882 tdata->validAuthLenInBits.len, in test_kasumi_cipher_auth()
5890 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_kasumi_cipher_auth()
5902 tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_cipher_auth()
5907 const uint8_t *reference_ciphertext = tdata->ciphertext.data + in test_kasumi_cipher_auth()
5908 (tdata->validCipherOffsetInBits.len >> 3); in test_kasumi_cipher_auth()
5913 tdata->validCipherLenInBits.len, in test_kasumi_cipher_auth()
5919 tdata->digest.data, in test_kasumi_cipher_auth()
5981 test_zuc_encryption(const struct wireless_test_data *tdata) in test_zuc_encryption() argument
6006 tdata->key.len, tdata->cipher_iv.len) < 0) in test_zuc_encryption()
6013 tdata->key.data, tdata->key.len, in test_zuc_encryption()
6014 tdata->cipher_iv.len); in test_zuc_encryption()
6024 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_zuc_encryption()
6030 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_zuc_encryption()
6035 retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data, in test_zuc_encryption()
6036 tdata->cipher_iv.len, in test_zuc_encryption()
6037 tdata->plaintext.len, in test_zuc_encryption()
6044 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_zuc_encryption()
6061 tdata->ciphertext.data, in test_zuc_encryption()
6062 tdata->validCipherLenInBits.len, in test_zuc_encryption()
6068 test_zuc_encryption_sgl(const struct wireless_test_data *tdata) in test_zuc_encryption_sgl() argument
6083 tdata->key.len, tdata->cipher_iv.len) < 0) in test_zuc_encryption_sgl()
6105 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_zuc_encryption_sgl()
6115 tdata->plaintext.data); in test_zuc_encryption_sgl()
6121 tdata->key.data, tdata->key.len, in test_zuc_encryption_sgl()
6122 tdata->cipher_iv.len); in test_zuc_encryption_sgl()
6128 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_zuc_encryption_sgl()
6131 retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data, in test_zuc_encryption_sgl()
6132 tdata->cipher_iv.len, tdata->plaintext.len, in test_zuc_encryption_sgl()
6139 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_zuc_encryption_sgl()
6159 tdata->ciphertext.data, in test_zuc_encryption_sgl()
6160 tdata->validCipherLenInBits.len, in test_zuc_encryption_sgl()
6167 test_zuc_authentication(const struct wireless_test_data *tdata) in test_zuc_authentication() argument
6183 (tdata->validAuthLenInBits.len % 8 != 0)) { in test_zuc_authentication()
6199 tdata->key.len, tdata->auth_iv.len, in test_zuc_authentication()
6200 tdata->digest.len) < 0) in test_zuc_authentication()
6205 tdata->key.data, tdata->key.len, in test_zuc_authentication()
6206 tdata->auth_iv.len, tdata->digest.len, in test_zuc_authentication()
6218 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_zuc_authentication()
6224 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_zuc_authentication()
6227 retval = create_wireless_algo_hash_operation(NULL, tdata->digest.len, in test_zuc_authentication()
6228 tdata->auth_iv.data, tdata->auth_iv.len, in test_zuc_authentication()
6230 tdata->validAuthLenInBits.len, in test_zuc_authentication()
6249 tdata->digest.data, in test_zuc_authentication()
6250 tdata->digest.len, in test_zuc_authentication()
6257 test_zuc_auth_cipher(const struct wireless_test_data *tdata, in test_zuc_auth_cipher() argument
6275 tdata->key.len, tdata->cipher_iv.len) < 0) in test_zuc_auth_cipher()
6280 tdata->key.len, tdata->auth_iv.len, in test_zuc_auth_cipher()
6281 tdata->digest.len) < 0) in test_zuc_auth_cipher()
6323 tdata->key.data, tdata->key.len, in test_zuc_auth_cipher()
6324 tdata->auth_iv.len, tdata->digest.len, in test_zuc_auth_cipher()
6325 tdata->cipher_iv.len); in test_zuc_auth_cipher()
6341 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_zuc_auth_cipher()
6342 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_zuc_auth_cipher()
6349 memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); in test_zuc_auth_cipher()
6356 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_zuc_auth_cipher()
6366 tdata->digest.data, tdata->digest.len, in test_zuc_auth_cipher()
6367 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_zuc_auth_cipher()
6368 tdata->auth_iv.data, tdata->auth_iv.len, in test_zuc_auth_cipher()
6369 (tdata->digest.offset_bytes == 0 ? in test_zuc_auth_cipher()
6371 : tdata->digest.offset_bytes), in test_zuc_auth_cipher()
6372 tdata->validCipherLenInBits.len, in test_zuc_auth_cipher()
6373 tdata->validCipherOffsetInBits.len, in test_zuc_auth_cipher()
6374 tdata->validAuthLenInBits.len, in test_zuc_auth_cipher()
6383 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_zuc_auth_cipher()
6402 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_zuc_auth_cipher()
6404 tdata->plaintext.data, in test_zuc_auth_cipher()
6405 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_zuc_auth_cipher()
6416 tdata->ciphertext.data, tdata->ciphertext.len >> 3); in test_zuc_auth_cipher()
6420 (tdata->digest.offset_bytes == 0 ? in test_zuc_auth_cipher()
6421 plaintext_pad_len : tdata->digest.offset_bytes); in test_zuc_auth_cipher()
6424 tdata->digest.len); in test_zuc_auth_cipher()
6426 tdata->digest.data, tdata->digest.len); in test_zuc_auth_cipher()
6433 tdata->plaintext.data, in test_zuc_auth_cipher()
6434 tdata->plaintext.len >> 3, in test_zuc_auth_cipher()
6439 tdata->ciphertext.data, in test_zuc_auth_cipher()
6440 tdata->ciphertext.len >> 3, in test_zuc_auth_cipher()
6445 tdata->digest.data, in test_zuc_auth_cipher()
6453 test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata, in test_zuc_auth_cipher_sgl() argument
6475 tdata->key.len, tdata->cipher_iv.len) < 0) in test_zuc_auth_cipher_sgl()
6480 tdata->key.len, tdata->auth_iv.len, in test_zuc_auth_cipher_sgl()
6481 tdata->digest.len) < 0) in test_zuc_auth_cipher_sgl()
6523 tdata->key.data, tdata->key.len, in test_zuc_auth_cipher_sgl()
6524 tdata->auth_iv.len, tdata->digest.len, in test_zuc_auth_cipher_sgl()
6525 tdata->cipher_iv.len); in test_zuc_auth_cipher_sgl()
6530 ciphertext_len = ceil_byte_length(tdata->ciphertext.len); in test_zuc_auth_cipher_sgl()
6531 plaintext_len = ceil_byte_length(tdata->plaintext.len); in test_zuc_auth_cipher_sgl()
6549 tdata->ciphertext.data); in test_zuc_auth_cipher_sgl()
6556 tdata->plaintext.data); in test_zuc_auth_cipher_sgl()
6566 tdata->digest.data, tdata->digest.len, in test_zuc_auth_cipher_sgl()
6567 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_zuc_auth_cipher_sgl()
6569 (tdata->digest.offset_bytes == 0 ? in test_zuc_auth_cipher_sgl()
6571 : tdata->digest.offset_bytes), in test_zuc_auth_cipher_sgl()
6572 tdata->validCipherLenInBits.len, in test_zuc_auth_cipher_sgl()
6573 tdata->validCipherOffsetInBits.len, in test_zuc_auth_cipher_sgl()
6574 tdata->validAuthLenInBits.len, in test_zuc_auth_cipher_sgl()
6583 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_zuc_auth_cipher_sgl()
6602 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_zuc_auth_cipher_sgl()
6604 tdata->plaintext.data, in test_zuc_auth_cipher_sgl()
6605 (tdata->plaintext.len >> 3) - tdata->digest.len); in test_zuc_auth_cipher_sgl()
6617 tdata->ciphertext.data, tdata->ciphertext.len >> 3); in test_zuc_auth_cipher_sgl()
6621 (tdata->digest.offset_bytes == 0 ? in test_zuc_auth_cipher_sgl()
6622 plaintext_pad_len : tdata->digest.offset_bytes), in test_zuc_auth_cipher_sgl()
6623 tdata->digest.len, digest_buffer); in test_zuc_auth_cipher_sgl()
6626 (tdata->digest.offset_bytes == 0 ? in test_zuc_auth_cipher_sgl()
6627 plaintext_pad_len : tdata->digest.offset_bytes), in test_zuc_auth_cipher_sgl()
6628 tdata->digest.len, digest_buffer); in test_zuc_auth_cipher_sgl()
6631 tdata->digest.len); in test_zuc_auth_cipher_sgl()
6633 tdata->digest.data, tdata->digest.len); in test_zuc_auth_cipher_sgl()
6640 tdata->plaintext.data, in test_zuc_auth_cipher_sgl()
6641 tdata->plaintext.len >> 3, in test_zuc_auth_cipher_sgl()
6646 tdata->ciphertext.data, in test_zuc_auth_cipher_sgl()
6647 tdata->validDataLenInBits.len, in test_zuc_auth_cipher_sgl()
6652 tdata->digest.data, in test_zuc_auth_cipher_sgl()
7318 test_mixed_check_if_unsupported(const struct mixed_cipher_auth_test_data *tdata) in test_mixed_check_if_unsupported() argument
7326 cap_idx.algo.cipher = tdata->cipher_algo; in test_mixed_check_if_unsupported()
7332 cap_idx.algo.auth = tdata->auth_algo; in test_mixed_check_if_unsupported()
7340 test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, in test_mixed_auth_cipher() argument
7358 if (test_mixed_check_if_unsupported(tdata)) in test_mixed_auth_cipher()
7378 tdata->auth_algo, in test_mixed_auth_cipher()
7379 tdata->cipher_algo, in test_mixed_auth_cipher()
7380 tdata->auth_key.data, tdata->auth_key.len, in test_mixed_auth_cipher()
7381 tdata->auth_iv.len, tdata->digest_enc.len, in test_mixed_auth_cipher()
7382 tdata->cipher_iv.len); in test_mixed_auth_cipher()
7388 tdata->auth_algo, in test_mixed_auth_cipher()
7389 tdata->cipher_algo, in test_mixed_auth_cipher()
7390 tdata->auth_key.data, tdata->auth_key.len, in test_mixed_auth_cipher()
7391 tdata->auth_iv.len, tdata->digest_enc.len, in test_mixed_auth_cipher()
7392 tdata->cipher_iv.len); in test_mixed_auth_cipher()
7409 ciphertext_len = ceil_byte_length(tdata->ciphertext.len_bits); in test_mixed_auth_cipher()
7410 plaintext_len = ceil_byte_length(tdata->plaintext.len_bits); in test_mixed_auth_cipher()
7417 memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); in test_mixed_auth_cipher()
7424 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_mixed_auth_cipher()
7433 tdata->digest_enc.data, tdata->digest_enc.len, in test_mixed_auth_cipher()
7434 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_mixed_auth_cipher()
7435 tdata->auth_iv.data, tdata->auth_iv.len, in test_mixed_auth_cipher()
7436 (tdata->digest_enc.offset == 0 ? in test_mixed_auth_cipher()
7438 : tdata->digest_enc.offset), in test_mixed_auth_cipher()
7439 tdata->validCipherLen.len_bits, in test_mixed_auth_cipher()
7440 tdata->cipher.offset_bits, in test_mixed_auth_cipher()
7441 tdata->validAuthLen.len_bits, in test_mixed_auth_cipher()
7442 tdata->auth.offset_bits, in test_mixed_auth_cipher()
7471 (tdata->cipher.offset_bits >> 3); in test_mixed_auth_cipher()
7474 tdata->plaintext.len_bits >> 3); in test_mixed_auth_cipher()
7476 tdata->plaintext.data, in test_mixed_auth_cipher()
7477 tdata->plaintext.len_bits >> 3); in test_mixed_auth_cipher()
7488 tdata->ciphertext.data, in test_mixed_auth_cipher()
7489 tdata->ciphertext.len_bits >> 3); in test_mixed_auth_cipher()
7492 + (tdata->digest_enc.offset == 0 ? in test_mixed_auth_cipher()
7493 plaintext_pad_len : tdata->digest_enc.offset); in test_mixed_auth_cipher()
7496 tdata->digest_enc.len); in test_mixed_auth_cipher()
7498 tdata->digest_enc.data, in test_mixed_auth_cipher()
7499 tdata->digest_enc.len); in test_mixed_auth_cipher()
7505 tdata->digest_enc.data, in test_mixed_auth_cipher()
7506 tdata->digest_enc.len, in test_mixed_auth_cipher()
7510 if (tdata->cipher_algo != RTE_CRYPTO_CIPHER_NULL) { in test_mixed_auth_cipher()
7514 tdata->plaintext.data, in test_mixed_auth_cipher()
7515 tdata->plaintext.len_bits >> 3, in test_mixed_auth_cipher()
7520 tdata->ciphertext.data, in test_mixed_auth_cipher()
7521 tdata->validDataLen.len_bits, in test_mixed_auth_cipher()
7533 test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, in test_mixed_auth_cipher_sgl() argument
7555 if (test_mixed_check_if_unsupported(tdata)) in test_mixed_auth_cipher_sgl()
7588 tdata->auth_algo, in test_mixed_auth_cipher_sgl()
7589 tdata->cipher_algo, in test_mixed_auth_cipher_sgl()
7590 tdata->auth_key.data, tdata->auth_key.len, in test_mixed_auth_cipher_sgl()
7591 tdata->auth_iv.len, tdata->digest_enc.len, in test_mixed_auth_cipher_sgl()
7592 tdata->cipher_iv.len); in test_mixed_auth_cipher_sgl()
7598 tdata->auth_algo, in test_mixed_auth_cipher_sgl()
7599 tdata->cipher_algo, in test_mixed_auth_cipher_sgl()
7600 tdata->auth_key.data, tdata->auth_key.len, in test_mixed_auth_cipher_sgl()
7601 tdata->auth_iv.len, tdata->digest_enc.len, in test_mixed_auth_cipher_sgl()
7602 tdata->cipher_iv.len); in test_mixed_auth_cipher_sgl()
7606 ciphertext_len = ceil_byte_length(tdata->ciphertext.len_bits); in test_mixed_auth_cipher_sgl()
7607 plaintext_len = ceil_byte_length(tdata->plaintext.len_bits); in test_mixed_auth_cipher_sgl()
7625 tdata->ciphertext.data); in test_mixed_auth_cipher_sgl()
7632 tdata->plaintext.data); in test_mixed_auth_cipher_sgl()
7642 tdata->digest_enc.data, tdata->digest_enc.len, in test_mixed_auth_cipher_sgl()
7643 tdata->cipher_iv.data, tdata->cipher_iv.len, in test_mixed_auth_cipher_sgl()
7644 tdata->auth_iv.data, tdata->auth_iv.len, in test_mixed_auth_cipher_sgl()
7645 (tdata->digest_enc.offset == 0 ? in test_mixed_auth_cipher_sgl()
7647 : tdata->digest_enc.offset), in test_mixed_auth_cipher_sgl()
7648 tdata->validCipherLen.len_bits, in test_mixed_auth_cipher_sgl()
7649 tdata->cipher.offset_bits, in test_mixed_auth_cipher_sgl()
7650 tdata->validAuthLen.len_bits, in test_mixed_auth_cipher_sgl()
7651 tdata->auth.offset_bits, in test_mixed_auth_cipher_sgl()
7683 (tdata->plaintext.len_bits >> 3) - in test_mixed_auth_cipher_sgl()
7684 tdata->digest_enc.len); in test_mixed_auth_cipher_sgl()
7686 tdata->plaintext.data, in test_mixed_auth_cipher_sgl()
7687 (tdata->plaintext.len_bits >> 3) - in test_mixed_auth_cipher_sgl()
7688 tdata->digest_enc.len); in test_mixed_auth_cipher_sgl()
7700 tdata->ciphertext.data, in test_mixed_auth_cipher_sgl()
7701 tdata->ciphertext.len_bits >> 3); in test_mixed_auth_cipher_sgl()
7705 (tdata->digest_enc.offset == 0 ? in test_mixed_auth_cipher_sgl()
7707 tdata->digest_enc.offset), in test_mixed_auth_cipher_sgl()
7708 tdata->digest_enc.len, digest_buffer); in test_mixed_auth_cipher_sgl()
7711 (tdata->digest_enc.offset == 0 ? in test_mixed_auth_cipher_sgl()
7713 tdata->digest_enc.offset), in test_mixed_auth_cipher_sgl()
7714 tdata->digest_enc.len, digest_buffer); in test_mixed_auth_cipher_sgl()
7717 tdata->digest_enc.len); in test_mixed_auth_cipher_sgl()
7719 tdata->digest_enc.data, tdata->digest_enc.len); in test_mixed_auth_cipher_sgl()
7725 tdata->digest_enc.data, in test_mixed_auth_cipher_sgl()
7726 tdata->digest_enc.len, in test_mixed_auth_cipher_sgl()
7730 if (tdata->cipher_algo != RTE_CRYPTO_CIPHER_NULL) { in test_mixed_auth_cipher_sgl()
7734 tdata->plaintext.data, in test_mixed_auth_cipher_sgl()
7735 tdata->plaintext.len_bits >> 3, in test_mixed_auth_cipher_sgl()
7740 tdata->ciphertext.data, in test_mixed_auth_cipher_sgl()
7741 tdata->validDataLen.len_bits, in test_mixed_auth_cipher_sgl()
8055 const struct aead_test_data *tdata) in create_aead_operation() argument
8072 if (tdata->algo == RTE_CRYPTO_AEAD_AES_CCM) { in create_aead_operation()
8073 aad_pad_len = RTE_ALIGN_CEIL(tdata->aad.len + 18, 16); in create_aead_operation()
8082 memcpy(sym_op->aead.aad.data + 18, tdata->aad.data, tdata->aad.len); in create_aead_operation()
8084 tdata->aad.len); in create_aead_operation()
8091 rte_memcpy(iv_ptr + 1, tdata->iv.data, tdata->iv.len); in create_aead_operation()
8093 tdata->iv.len); in create_aead_operation()
8095 aad_pad_len = RTE_ALIGN_CEIL(tdata->aad.len, 16); in create_aead_operation()
8103 memcpy(sym_op->aead.aad.data, tdata->aad.data, tdata->aad.len); in create_aead_operation()
8105 tdata->aad.len); in create_aead_operation()
8111 if (tdata->iv.len == 0) { in create_aead_operation()
8112 rte_memcpy(iv_ptr, tdata->iv.data, AES_GCM_J0_LENGTH); in create_aead_operation()
8116 rte_memcpy(iv_ptr, tdata->iv.data, tdata->iv.len); in create_aead_operation()
8118 tdata->iv.len); in create_aead_operation()
8124 plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len, 16); in create_aead_operation()
8129 memcpy(plaintext, tdata->plaintext.data, tdata->plaintext.len); in create_aead_operation()
8131 tdata->plaintext.len); in create_aead_operation()
8141 tdata->ciphertext.len); in create_aead_operation()
8144 plaintext_pad_len = RTE_ALIGN_CEIL(tdata->ciphertext.len, 16); in create_aead_operation()
8150 memcpy(ciphertext, tdata->ciphertext.data, in create_aead_operation()
8151 tdata->ciphertext.len); in create_aead_operation()
8153 tdata->ciphertext.len); in create_aead_operation()
8163 tdata->plaintext.len); in create_aead_operation()
8172 tdata->auth_tag.len); in create_aead_operation()
8175 memset(sym_op->aead.digest.data, 0, tdata->auth_tag.len); in create_aead_operation()
8183 ut_params->ibuf, tdata->auth_tag.len); in create_aead_operation()
8190 rte_memcpy(sym_op->aead.digest.data, tdata->auth_tag.data, in create_aead_operation()
8191 tdata->auth_tag.len); in create_aead_operation()
8194 tdata->auth_tag.len); in create_aead_operation()
8197 sym_op->aead.data.length = tdata->plaintext.len; in create_aead_operation()
8204 test_authenticated_encryption(const struct aead_test_data *tdata) in test_authenticated_encryption() argument
8228 cap_idx.algo.aead = tdata->algo; in test_authenticated_encryption()
8234 capability, tdata->key.len, tdata->auth_tag.len, in test_authenticated_encryption()
8235 tdata->aad.len, tdata->iv.len)) in test_authenticated_encryption()
8240 tdata->algo, in test_authenticated_encryption()
8242 tdata->key.data, tdata->key.len, in test_authenticated_encryption()
8243 tdata->aad.len, tdata->auth_tag.len, in test_authenticated_encryption()
8244 tdata->iv.len); in test_authenticated_encryption()
8248 if (tdata->aad.len > MBUF_SIZE) { in test_authenticated_encryption()
8252 memcpy(&tdata->aad.data[i], &tdata->aad.data[0], 32); in test_authenticated_encryption()
8261 retval = create_aead_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata); in test_authenticated_encryption()
8283 plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len, 16); in test_authenticated_encryption()
8297 debug_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len); in test_authenticated_encryption()
8298 debug_hexdump(stdout, "auth tag:", auth_tag, tdata->auth_tag.len); in test_authenticated_encryption()
8303 tdata->ciphertext.data, in test_authenticated_encryption()
8304 tdata->ciphertext.len, in test_authenticated_encryption()
8309 tdata->auth_tag.data, in test_authenticated_encryption()
8310 tdata->auth_tag.len, in test_authenticated_encryption()
10762 struct aead_test_data tdata; in test_AES_GCM_auth_encryption_fail_iv_corrupt() local
10766 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_encryption_fail_iv_corrupt()
10767 tdata.iv.data[0] += 1; in test_AES_GCM_auth_encryption_fail_iv_corrupt()
10768 res = test_authenticated_encryption(&tdata); in test_AES_GCM_auth_encryption_fail_iv_corrupt()
10778 struct aead_test_data tdata; in test_AES_GCM_auth_encryption_fail_in_data_corrupt() local
10782 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_encryption_fail_in_data_corrupt()
10783 tdata.plaintext.data[0] += 1; in test_AES_GCM_auth_encryption_fail_in_data_corrupt()
10784 res = test_authenticated_encryption(&tdata); in test_AES_GCM_auth_encryption_fail_in_data_corrupt()
10794 struct aead_test_data tdata; in test_AES_GCM_auth_encryption_fail_out_data_corrupt() local
10798 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_encryption_fail_out_data_corrupt()
10799 tdata.ciphertext.data[0] += 1; in test_AES_GCM_auth_encryption_fail_out_data_corrupt()
10800 res = test_authenticated_encryption(&tdata); in test_AES_GCM_auth_encryption_fail_out_data_corrupt()
10810 struct aead_test_data tdata; in test_AES_GCM_auth_encryption_fail_aad_len_corrupt() local
10814 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_encryption_fail_aad_len_corrupt()
10815 tdata.aad.len += 1; in test_AES_GCM_auth_encryption_fail_aad_len_corrupt()
10816 res = test_authenticated_encryption(&tdata); in test_AES_GCM_auth_encryption_fail_aad_len_corrupt()
10826 struct aead_test_data tdata; in test_AES_GCM_auth_encryption_fail_aad_corrupt() local
10831 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_encryption_fail_aad_corrupt()
10834 tdata.aad.data = aad; in test_AES_GCM_auth_encryption_fail_aad_corrupt()
10835 res = test_authenticated_encryption(&tdata); in test_AES_GCM_auth_encryption_fail_aad_corrupt()
10845 struct aead_test_data tdata; in test_AES_GCM_auth_encryption_fail_tag_corrupt() local
10849 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_encryption_fail_tag_corrupt()
10850 tdata.auth_tag.data[0] += 1; in test_AES_GCM_auth_encryption_fail_tag_corrupt()
10851 res = test_authenticated_encryption(&tdata); in test_AES_GCM_auth_encryption_fail_tag_corrupt()
10859 test_authenticated_decryption(const struct aead_test_data *tdata) in test_authenticated_decryption() argument
10882 cap_idx.algo.aead = tdata->algo; in test_authenticated_decryption()
10888 capability, tdata->key.len, tdata->auth_tag.len, in test_authenticated_decryption()
10889 tdata->aad.len, tdata->iv.len)) in test_authenticated_decryption()
10894 tdata->algo, in test_authenticated_decryption()
10896 tdata->key.data, tdata->key.len, in test_authenticated_decryption()
10897 tdata->aad.len, tdata->auth_tag.len, in test_authenticated_decryption()
10898 tdata->iv.len); in test_authenticated_decryption()
10903 if (tdata->aad.len > MBUF_SIZE) { in test_authenticated_decryption()
10907 memcpy(&tdata->aad.data[i], &tdata->aad.data[0], 32); in test_authenticated_decryption()
10915 retval = create_aead_operation(RTE_CRYPTO_AEAD_OP_DECRYPT, tdata); in test_authenticated_decryption()
10945 debug_hexdump(stdout, "plaintext:", plaintext, tdata->ciphertext.len); in test_authenticated_decryption()
10950 tdata->plaintext.data, in test_authenticated_decryption()
10951 tdata->plaintext.len, in test_authenticated_decryption()
11114 struct aead_test_data tdata; in test_AES_GCM_auth_decryption_fail_iv_corrupt() local
11117 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_decryption_fail_iv_corrupt()
11118 tdata.iv.data[0] += 1; in test_AES_GCM_auth_decryption_fail_iv_corrupt()
11119 res = test_authenticated_decryption(&tdata); in test_AES_GCM_auth_decryption_fail_iv_corrupt()
11129 struct aead_test_data tdata; in test_AES_GCM_auth_decryption_fail_in_data_corrupt() local
11133 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_decryption_fail_in_data_corrupt()
11134 tdata.plaintext.data[0] += 1; in test_AES_GCM_auth_decryption_fail_in_data_corrupt()
11135 res = test_authenticated_decryption(&tdata); in test_AES_GCM_auth_decryption_fail_in_data_corrupt()
11145 struct aead_test_data tdata; in test_AES_GCM_auth_decryption_fail_out_data_corrupt() local
11148 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_decryption_fail_out_data_corrupt()
11149 tdata.ciphertext.data[0] += 1; in test_AES_GCM_auth_decryption_fail_out_data_corrupt()
11150 res = test_authenticated_decryption(&tdata); in test_AES_GCM_auth_decryption_fail_out_data_corrupt()
11160 struct aead_test_data tdata; in test_AES_GCM_auth_decryption_fail_aad_len_corrupt() local
11163 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_decryption_fail_aad_len_corrupt()
11164 tdata.aad.len += 1; in test_AES_GCM_auth_decryption_fail_aad_len_corrupt()
11165 res = test_authenticated_decryption(&tdata); in test_AES_GCM_auth_decryption_fail_aad_len_corrupt()
11175 struct aead_test_data tdata; in test_AES_GCM_auth_decryption_fail_aad_corrupt() local
11179 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_decryption_fail_aad_corrupt()
11182 tdata.aad.data = aad; in test_AES_GCM_auth_decryption_fail_aad_corrupt()
11183 res = test_authenticated_decryption(&tdata); in test_AES_GCM_auth_decryption_fail_aad_corrupt()
11193 struct aead_test_data tdata; in test_AES_GCM_auth_decryption_fail_tag_corrupt() local
11196 memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data)); in test_AES_GCM_auth_decryption_fail_tag_corrupt()
11197 tdata.auth_tag.data[0] += 1; in test_AES_GCM_auth_decryption_fail_tag_corrupt()
11198 res = test_authenticated_decryption(&tdata); in test_AES_GCM_auth_decryption_fail_tag_corrupt()
11206 test_authenticated_encryption_oop(const struct aead_test_data *tdata) in test_authenticated_encryption_oop() argument
11219 cap_idx.algo.aead = tdata->algo; in test_authenticated_encryption_oop()
11237 tdata->algo, in test_authenticated_encryption_oop()
11239 tdata->key.data, tdata->key.len, in test_authenticated_encryption_oop()
11240 tdata->aad.len, tdata->auth_tag.len, in test_authenticated_encryption_oop()
11241 tdata->iv.len); in test_authenticated_encryption_oop()
11255 retval = create_aead_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata); in test_authenticated_encryption_oop()
11275 plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len, 16); in test_authenticated_encryption_oop()
11281 debug_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len); in test_authenticated_encryption_oop()
11282 debug_hexdump(stdout, "auth tag:", auth_tag, tdata->auth_tag.len); in test_authenticated_encryption_oop()
11287 tdata->ciphertext.data, in test_authenticated_encryption_oop()
11288 tdata->ciphertext.len, in test_authenticated_encryption_oop()
11293 tdata->auth_tag.data, in test_authenticated_encryption_oop()
11294 tdata->auth_tag.len, in test_authenticated_encryption_oop()
11308 test_authenticated_decryption_oop(const struct aead_test_data *tdata) in test_authenticated_decryption_oop() argument
11323 cap_idx.algo.aead = tdata->algo; in test_authenticated_decryption_oop()
11341 tdata->algo, in test_authenticated_decryption_oop()
11343 tdata->key.data, tdata->key.len, in test_authenticated_decryption_oop()
11344 tdata->aad.len, tdata->auth_tag.len, in test_authenticated_decryption_oop()
11345 tdata->iv.len); in test_authenticated_decryption_oop()
11359 retval = create_aead_operation(RTE_CRYPTO_AEAD_OP_DECRYPT, tdata); in test_authenticated_decryption_oop()
11382 debug_hexdump(stdout, "plaintext:", plaintext, tdata->ciphertext.len); in test_authenticated_decryption_oop()
11387 tdata->plaintext.data, in test_authenticated_decryption_oop()
11388 tdata->plaintext.len, in test_authenticated_decryption_oop()
11405 const struct aead_test_data *tdata) in test_authenticated_encryption_sessionless() argument
11413 uint8_t key[tdata->key.len + 1]; in test_authenticated_encryption_sessionless()
11431 cap_idx.algo.aead = tdata->algo; in test_authenticated_encryption_sessionless()
11443 retval = create_aead_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata); in test_authenticated_encryption_sessionless()
11448 memcpy(key, tdata->key.data, tdata->key.len); in test_authenticated_encryption_sessionless()
11450 tdata->algo, in test_authenticated_encryption_sessionless()
11452 key, tdata->key.len, in test_authenticated_encryption_sessionless()
11453 tdata->aad.len, tdata->auth_tag.len, in test_authenticated_encryption_sessionless()
11454 tdata->iv.len); in test_authenticated_encryption_sessionless()
11473 plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len, 16); in test_authenticated_encryption_sessionless()
11479 debug_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len); in test_authenticated_encryption_sessionless()
11480 debug_hexdump(stdout, "auth tag:", auth_tag, tdata->auth_tag.len); in test_authenticated_encryption_sessionless()
11485 tdata->ciphertext.data, in test_authenticated_encryption_sessionless()
11486 tdata->ciphertext.len, in test_authenticated_encryption_sessionless()
11491 tdata->auth_tag.data, in test_authenticated_encryption_sessionless()
11492 tdata->auth_tag.len, in test_authenticated_encryption_sessionless()
11508 const struct aead_test_data *tdata) in test_authenticated_decryption_sessionless() argument
11515 uint8_t key[tdata->key.len + 1]; in test_authenticated_decryption_sessionless()
11539 cap_idx.algo.aead = tdata->algo; in test_authenticated_decryption_sessionless()
11551 retval = create_aead_operation(RTE_CRYPTO_AEAD_OP_DECRYPT, tdata); in test_authenticated_decryption_sessionless()
11556 memcpy(key, tdata->key.data, tdata->key.len); in test_authenticated_decryption_sessionless()
11558 tdata->algo, in test_authenticated_decryption_sessionless()
11560 key, tdata->key.len, in test_authenticated_decryption_sessionless()
11561 tdata->aad.len, tdata->auth_tag.len, in test_authenticated_decryption_sessionless()
11562 tdata->iv.len); in test_authenticated_decryption_sessionless()
11589 debug_hexdump(stdout, "plaintext:", plaintext, tdata->ciphertext.len); in test_authenticated_decryption_sessionless()
11594 tdata->plaintext.data, in test_authenticated_decryption_sessionless()
11595 tdata->plaintext.len, in test_authenticated_decryption_sessionless()
12656 const struct gmac_test_data *tdata) in create_gmac_operation() argument
12662 uint32_t plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len, 16); in create_gmac_operation()
12673 ut_params->ibuf, tdata->gmac_tag.len); in create_gmac_operation()
12681 rte_memcpy(sym_op->auth.digest.data, tdata->gmac_tag.data, in create_gmac_operation()
12682 tdata->gmac_tag.len); in create_gmac_operation()
12685 tdata->gmac_tag.len); in create_gmac_operation()
12691 rte_memcpy(iv_ptr, tdata->iv.data, tdata->iv.len); in create_gmac_operation()
12693 debug_hexdump(stdout, "iv:", iv_ptr, tdata->iv.len); in create_gmac_operation()
12699 sym_op->auth.data.length = tdata->plaintext.len; in create_gmac_operation()
12706 const struct gmac_test_data *tdata, in create_gmac_operation_sgl() argument
12728 rte_memcpy(sym_op->auth.digest.data, tdata->gmac_tag.data, in create_gmac_operation_sgl()
12729 tdata->gmac_tag.len); in create_gmac_operation_sgl()
12732 tdata->gmac_tag.len); in create_gmac_operation_sgl()
12738 rte_memcpy(iv_ptr, tdata->iv.data, tdata->iv.len); in create_gmac_operation_sgl()
12740 debug_hexdump(stdout, "iv:", iv_ptr, tdata->iv.len); in create_gmac_operation_sgl()
12746 sym_op->auth.data.length = tdata->plaintext.len; in create_gmac_operation_sgl()
12752 const struct gmac_test_data *tdata, in create_gmac_session() argument
12755 uint8_t auth_key[tdata->key.len]; in create_gmac_session()
12761 memcpy(auth_key, tdata->key.data, tdata->key.len); in create_gmac_session()
12768 ut_params->auth_xform.auth.digest_length = tdata->gmac_tag.len; in create_gmac_session()
12769 ut_params->auth_xform.auth.key.length = tdata->key.len; in create_gmac_session()
12772 ut_params->auth_xform.auth.iv.length = tdata->iv.len; in create_gmac_session()
12787 test_AES_GMAC_authentication(const struct gmac_test_data *tdata) in test_AES_GMAC_authentication() argument
12807 TEST_ASSERT_NOT_EQUAL(tdata->gmac_tag.len, 0, in test_AES_GMAC_authentication()
12819 tdata, RTE_CRYPTO_AUTH_OP_GENERATE); in test_AES_GMAC_authentication()
12826 if (tdata->plaintext.len > MBUF_SIZE) in test_AES_GMAC_authentication()
12836 plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len, 16); in test_AES_GMAC_authentication()
12842 if (tdata->plaintext.len == GMAC_LARGE_PLAINTEXT_LENGTH) in test_AES_GMAC_authentication()
12843 generate_gmac_large_plaintext(tdata->plaintext.data); in test_AES_GMAC_authentication()
12849 memcpy(plaintext, tdata->plaintext.data, tdata->plaintext.len); in test_AES_GMAC_authentication()
12851 tdata->plaintext.len); in test_AES_GMAC_authentication()
12854 tdata); in test_AES_GMAC_authentication()
12884 debug_hexdump(stdout, "auth tag:", auth_tag, tdata->gmac_tag.len); in test_AES_GMAC_authentication()
12888 tdata->gmac_tag.data, in test_AES_GMAC_authentication()
12889 tdata->gmac_tag.len, in test_AES_GMAC_authentication()
12920 test_AES_GMAC_authentication_verify(const struct gmac_test_data *tdata) in test_AES_GMAC_authentication_verify() argument
12938 TEST_ASSERT_NOT_EQUAL(tdata->gmac_tag.len, 0, in test_AES_GMAC_authentication_verify()
12950 tdata, RTE_CRYPTO_AUTH_OP_VERIFY); in test_AES_GMAC_authentication_verify()
12957 if (tdata->plaintext.len > MBUF_SIZE) in test_AES_GMAC_authentication_verify()
12967 plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len, 16); in test_AES_GMAC_authentication_verify()
12974 if (tdata->plaintext.len == GMAC_LARGE_PLAINTEXT_LENGTH) in test_AES_GMAC_authentication_verify()
12975 generate_gmac_large_plaintext(tdata->plaintext.data); in test_AES_GMAC_authentication_verify()
12981 memcpy(plaintext, tdata->plaintext.data, tdata->plaintext.len); in test_AES_GMAC_authentication_verify()
12983 tdata->plaintext.len); in test_AES_GMAC_authentication_verify()
12986 tdata); in test_AES_GMAC_authentication_verify()
13038 test_AES_GMAC_authentication_SGL(const struct gmac_test_data *tdata, in test_AES_GMAC_authentication_SGL() argument
13053 TEST_ASSERT_NOT_EQUAL(tdata->gmac_tag.len, 0, in test_AES_GMAC_authentication_SGL()
13073 if (fragsz > tdata->plaintext.len) in test_AES_GMAC_authentication_SGL()
13074 fragsz = tdata->plaintext.len; in test_AES_GMAC_authentication_SGL()
13079 tdata, RTE_CRYPTO_AUTH_OP_GENERATE); in test_AES_GMAC_authentication_SGL()
13097 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_AES_GMAC_authentication_SGL()
13107 while (trn_data < tdata->plaintext.len) { in test_AES_GMAC_authentication_SGL()
13109 to_trn = (tdata->plaintext.len - trn_data < fragsz) ? in test_AES_GMAC_authentication_SGL()
13110 (tdata->plaintext.len - trn_data) : fragsz; in test_AES_GMAC_authentication_SGL()
13121 memcpy(plaintext, tdata->plaintext.data + trn_data, in test_AES_GMAC_authentication_SGL()
13124 if (trn_data == tdata->plaintext.len) in test_AES_GMAC_authentication_SGL()
13126 tdata->gmac_tag.len); in test_AES_GMAC_authentication_SGL()
13137 + tdata->gmac_tag.len); in test_AES_GMAC_authentication_SGL()
13139 tdata->plaintext.len); in test_AES_GMAC_authentication_SGL()
13143 tdata, digest_mem, digest_phys); in test_AES_GMAC_authentication_SGL()
13163 debug_hexdump(stdout, "auth tag:", auth_tag, tdata->gmac_tag.len); in test_AES_GMAC_authentication_SGL()
13166 tdata->gmac_tag.data, in test_AES_GMAC_authentication_SGL()
13167 tdata->gmac_tag.len, in test_AES_GMAC_authentication_SGL()
14190 const struct aead_test_data *tdata, in create_aead_operation_SGL() argument
14196 const unsigned int auth_tag_len = tdata->auth_tag.len; in create_aead_operation_SGL()
14197 const unsigned int iv_len = tdata->iv.len; in create_aead_operation_SGL()
14198 unsigned int aad_len = tdata->aad.len; in create_aead_operation_SGL()
14217 rte_memcpy(sym_op->aead.digest.data, tdata->auth_tag.data, in create_aead_operation_SGL()
14225 if (tdata->algo == RTE_CRYPTO_AEAD_AES_CCM) { in create_aead_operation_SGL()
14230 rte_memcpy(iv_ptr + 1, tdata->iv.data, iv_len); in create_aead_operation_SGL()
14243 rte_memcpy(sym_op->aead.aad.data, tdata->aad.data, aad_len); in create_aead_operation_SGL()
14252 rte_memcpy(iv_ptr, tdata->iv.data, iv_len); in create_aead_operation_SGL()
14264 rte_memcpy(sym_op->aead.aad.data, tdata->aad.data, aad_len); in create_aead_operation_SGL()
14271 sym_op->aead.data.length = tdata->plaintext.len; in create_aead_operation_SGL()
14280 test_authenticated_encryption_SGL(const struct aead_test_data *tdata, in test_authenticated_encryption_SGL() argument
14297 cap_idx.algo.aead = tdata->algo; in test_authenticated_encryption_SGL()
14309 unsigned int sgl_in = fragsz < tdata->plaintext.len; in test_authenticated_encryption_SGL()
14322 unsigned int sgl_in = fragsz < tdata->plaintext.len; in test_authenticated_encryption_SGL()
14324 tdata->plaintext.len; in test_authenticated_encryption_SGL()
14343 if (fragsz > tdata->plaintext.len) in test_authenticated_encryption_SGL()
14344 fragsz = tdata->plaintext.len; in test_authenticated_encryption_SGL()
14349 if (fragsz_oop > tdata->plaintext.len) in test_authenticated_encryption_SGL()
14350 frag_size_oop = tdata->plaintext.len; in test_authenticated_encryption_SGL()
14355 uint32_t prepend_len = RTE_ALIGN_CEIL(tdata->aad.len, 16); in test_authenticated_encryption_SGL()
14357 if (tdata->plaintext.len % fragsz != 0) { in test_authenticated_encryption_SGL()
14358 if (tdata->plaintext.len / fragsz + 1 > SGL_MAX_NO) in test_authenticated_encryption_SGL()
14361 if (tdata->plaintext.len / fragsz > SGL_MAX_NO) in test_authenticated_encryption_SGL()
14377 tdata->algo, in test_authenticated_encryption_SGL()
14379 tdata->key.data, tdata->key.len, in test_authenticated_encryption_SGL()
14380 tdata->aad.len, tdata->auth_tag.len, in test_authenticated_encryption_SGL()
14381 tdata->iv.len); in test_authenticated_encryption_SGL()
14394 memcpy(plaintext, tdata->plaintext.data, plaintext_len); in test_authenticated_encryption_SGL()
14404 while (trn_data < tdata->plaintext.len) { in test_authenticated_encryption_SGL()
14406 to_trn = (tdata->plaintext.len - trn_data < fragsz) ? in test_authenticated_encryption_SGL()
14407 (tdata->plaintext.len - trn_data) : fragsz; in test_authenticated_encryption_SGL()
14430 memcpy(plaintext, tdata->plaintext.data + trn_data, in test_authenticated_encryption_SGL()
14433 if (trn_data == tdata->plaintext.len) { in test_authenticated_encryption_SGL()
14437 tdata->auth_tag.len); in test_authenticated_encryption_SGL()
14440 tdata->auth_tag.len); in test_authenticated_encryption_SGL()
14453 if (frag_size_oop == tdata->plaintext.len) { in test_authenticated_encryption_SGL()
14455 tdata->auth_tag.len); in test_authenticated_encryption_SGL()
14459 tdata->plaintext.len + prepend_len); in test_authenticated_encryption_SGL()
14463 while (trn_data < tdata->plaintext.len) { in test_authenticated_encryption_SGL()
14466 (tdata->plaintext.len - trn_data < in test_authenticated_encryption_SGL()
14468 (tdata->plaintext.len - trn_data) : in test_authenticated_encryption_SGL()
14482 if (trn_data == tdata->plaintext.len) { in test_authenticated_encryption_SGL()
14484 tdata->auth_tag.len); in test_authenticated_encryption_SGL()
14501 + tdata->auth_tag.len); in test_authenticated_encryption_SGL()
14503 tdata->plaintext.len); in test_authenticated_encryption_SGL()
14508 tdata, digest_mem, digest_phys); in test_authenticated_encryption_SGL()
14547 tdata->ciphertext.data, in test_authenticated_encryption_SGL()
14564 tdata->ciphertext.data + off, in test_authenticated_encryption_SGL()
14575 tdata->auth_tag.data, in test_authenticated_encryption_SGL()
14576 tdata->auth_tag.len, in test_authenticated_encryption_SGL()