| 3788 | } |
| 3789 | |
| 3790 | static int |
| 3791 | test_kasumi_encryption_sgl(const struct kasumi_test_data *tdata) |
| 3792 | { |
| 3793 | struct crypto_testsuite_params *ts_params = &testsuite_params; |
| 3794 | struct crypto_unittest_params *ut_params = &unittest_params; |
| 3795 | |
| 3796 | int retval; |
| 3797 | |
| 3798 | unsigned int plaintext_pad_len; |
| 3799 | unsigned int plaintext_len; |
| 3800 | |
| 3801 | uint8_t buffer[10000]; |
| 3802 | const uint8_t *ciphertext; |
| 3803 | |
| 3804 | struct rte_cryptodev_info dev_info; |
| 3805 | |
| 3806 | /* Verify the capabilities */ |
| 3807 | struct rte_cryptodev_sym_capability_idx cap_idx; |
| 3808 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; |
| 3809 | cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8; |
| 3810 | if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], |
| 3811 | &cap_idx) == NULL) |
| 3812 | return TEST_SKIPPED; |
| 3813 | |
| 3814 | rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); |
| 3815 | |
| 3816 | uint64_t feat_flags = dev_info.feature_flags; |
| 3817 | |
| 3818 | if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { |
| 3819 | printf("Device doesn't support in-place scatter-gather. " |
| 3820 | "Test Skipped.\n"); |
| 3821 | return TEST_SKIPPED; |
| 3822 | } |
| 3823 | |
| 3824 | if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) && |
| 3825 | (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) { |
| 3826 | printf("Device doesn't support RAW data-path APIs.\n"); |
| 3827 | return TEST_SKIPPED; |
| 3828 | } |
| 3829 | |
| 3830 | if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) |
| 3831 | return TEST_SKIPPED; |
| 3832 | |
| 3833 | /* Create KASUMI session */ |
| 3834 | retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0], |
| 3835 | RTE_CRYPTO_CIPHER_OP_ENCRYPT, |
| 3836 | RTE_CRYPTO_CIPHER_KASUMI_F8, |
| 3837 | tdata->key.data, tdata->key.len, |
| 3838 | tdata->cipher_iv.len); |
| 3839 | if (retval < 0) |
| 3840 | return retval; |
| 3841 | |
| 3842 | plaintext_len = ceil_byte_length(tdata->plaintext.len); |
| 3843 | |
| 3844 | |
| 3845 | /* Append data which is padded to a multiple */ |
| 3846 | /* of the algorithms block size */ |
| 3847 | plaintext_pad_len = RTE_ALIGN_CEIL(plaintext_len, 8); |
no test coverage detected