| 2847 | } |
| 2848 | |
| 2849 | static int |
| 2850 | create_wireless_algo_hash_operation(const uint8_t *auth_tag, |
| 2851 | unsigned int auth_tag_len, |
| 2852 | const uint8_t *iv, unsigned int iv_len, |
| 2853 | unsigned int data_pad_len, |
| 2854 | enum rte_crypto_auth_operation op, |
| 2855 | unsigned int auth_len, unsigned int auth_offset) |
| 2856 | { |
| 2857 | struct crypto_testsuite_params *ts_params = &testsuite_params; |
| 2858 | |
| 2859 | struct crypto_unittest_params *ut_params = &unittest_params; |
| 2860 | |
| 2861 | /* Generate Crypto op data structure */ |
| 2862 | ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, |
| 2863 | RTE_CRYPTO_OP_TYPE_SYMMETRIC); |
| 2864 | TEST_ASSERT_NOT_NULL(ut_params->op, |
| 2865 | "Failed to allocate pktmbuf offload"); |
| 2866 | |
| 2867 | /* Set crypto operation data parameters */ |
| 2868 | rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); |
| 2869 | |
| 2870 | struct rte_crypto_sym_op *sym_op = ut_params->op->sym; |
| 2871 | |
| 2872 | /* set crypto operation source mbuf */ |
| 2873 | sym_op->m_src = ut_params->ibuf; |
| 2874 | |
| 2875 | /* iv */ |
| 2876 | rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), |
| 2877 | iv, iv_len); |
| 2878 | /* digest */ |
| 2879 | sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append( |
| 2880 | ut_params->ibuf, auth_tag_len); |
| 2881 | |
| 2882 | TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data, |
| 2883 | "no room to append auth tag"); |
| 2884 | ut_params->digest = sym_op->auth.digest.data; |
| 2885 | sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset( |
| 2886 | ut_params->ibuf, data_pad_len); |
| 2887 | if (op == RTE_CRYPTO_AUTH_OP_GENERATE) |
| 2888 | memset(sym_op->auth.digest.data, 0, auth_tag_len); |
| 2889 | else |
| 2890 | rte_memcpy(sym_op->auth.digest.data, auth_tag, auth_tag_len); |
| 2891 | |
| 2892 | debug_hexdump(stdout, "digest:", |
| 2893 | sym_op->auth.digest.data, |
| 2894 | auth_tag_len); |
| 2895 | |
| 2896 | sym_op->auth.data.length = auth_len; |
| 2897 | sym_op->auth.data.offset = auth_offset; |
| 2898 | |
| 2899 | return 0; |
| 2900 | } |
| 2901 | |
| 2902 | static int |
| 2903 | create_wireless_cipher_hash_operation(const struct wireless_test_data *tdata, |
no test coverage detected