| 4801 | } |
| 4802 | |
| 4803 | static int test_snow3g_decryption_oop(const struct snow3g_test_data *tdata) |
| 4804 | { |
| 4805 | struct crypto_testsuite_params *ts_params = &testsuite_params; |
| 4806 | struct crypto_unittest_params *ut_params = &unittest_params; |
| 4807 | |
| 4808 | int retval; |
| 4809 | |
| 4810 | uint8_t *plaintext, *ciphertext; |
| 4811 | unsigned ciphertext_pad_len; |
| 4812 | unsigned ciphertext_len; |
| 4813 | struct rte_cryptodev_info dev_info; |
| 4814 | |
| 4815 | rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); |
| 4816 | uint64_t feat_flags = dev_info.feature_flags; |
| 4817 | |
| 4818 | if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) && |
| 4819 | (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) { |
| 4820 | printf("Device does not support RAW data-path APIs.\n"); |
| 4821 | return -ENOTSUP; |
| 4822 | } |
| 4823 | /* Verify the capabilities */ |
| 4824 | struct rte_cryptodev_sym_capability_idx cap_idx; |
| 4825 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; |
| 4826 | cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2; |
| 4827 | if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], |
| 4828 | &cap_idx) == NULL) |
| 4829 | return TEST_SKIPPED; |
| 4830 | |
| 4831 | if (global_api_test_type == CRYPTODEV_RAW_API_TEST) |
| 4832 | return TEST_SKIPPED; |
| 4833 | |
| 4834 | if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) |
| 4835 | return TEST_SKIPPED; |
| 4836 | |
| 4837 | /* Create SNOW 3G session */ |
| 4838 | retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0], |
| 4839 | RTE_CRYPTO_CIPHER_OP_DECRYPT, |
| 4840 | RTE_CRYPTO_CIPHER_SNOW3G_UEA2, |
| 4841 | tdata->key.data, tdata->key.len, |
| 4842 | tdata->cipher_iv.len); |
| 4843 | if (retval < 0) |
| 4844 | return retval; |
| 4845 | |
| 4846 | ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); |
| 4847 | ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); |
| 4848 | |
| 4849 | TEST_ASSERT_NOT_NULL(ut_params->ibuf, |
| 4850 | "Failed to allocate input buffer"); |
| 4851 | TEST_ASSERT_NOT_NULL(ut_params->obuf, |
| 4852 | "Failed to allocate output buffer"); |
| 4853 | |
| 4854 | /* Clear mbuf payload */ |
| 4855 | memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, |
| 4856 | rte_pktmbuf_tailroom(ut_params->ibuf)); |
| 4857 | |
| 4858 | memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, |
| 4859 | rte_pktmbuf_tailroom(ut_params->obuf)); |
| 4860 |
no test coverage detected