| 14830 | } |
| 14831 | |
| 14832 | static int |
| 14833 | create_cipher_auth_operation(struct crypto_testsuite_params *ts_params, |
| 14834 | struct crypto_unittest_params *ut_params, |
| 14835 | const struct test_crypto_vector *reference, |
| 14836 | unsigned int auth_generate) |
| 14837 | { |
| 14838 | /* Generate Crypto op data structure */ |
| 14839 | ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, |
| 14840 | RTE_CRYPTO_OP_TYPE_SYMMETRIC); |
| 14841 | TEST_ASSERT_NOT_NULL(ut_params->op, |
| 14842 | "Failed to allocate pktmbuf offload"); |
| 14843 | |
| 14844 | /* Set crypto operation data parameters */ |
| 14845 | rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); |
| 14846 | |
| 14847 | struct rte_crypto_sym_op *sym_op = ut_params->op->sym; |
| 14848 | |
| 14849 | /* set crypto operation source mbuf */ |
| 14850 | sym_op->m_src = ut_params->ibuf; |
| 14851 | |
| 14852 | /* digest */ |
| 14853 | sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append( |
| 14854 | ut_params->ibuf, reference->digest.len); |
| 14855 | |
| 14856 | TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data, |
| 14857 | "no room to append auth tag"); |
| 14858 | |
| 14859 | sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset( |
| 14860 | ut_params->ibuf, reference->ciphertext.len); |
| 14861 | |
| 14862 | if (auth_generate) |
| 14863 | memset(sym_op->auth.digest.data, 0, reference->digest.len); |
| 14864 | else |
| 14865 | memcpy(sym_op->auth.digest.data, |
| 14866 | reference->digest.data, |
| 14867 | reference->digest.len); |
| 14868 | |
| 14869 | debug_hexdump(stdout, "digest:", |
| 14870 | sym_op->auth.digest.data, |
| 14871 | reference->digest.len); |
| 14872 | |
| 14873 | rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), |
| 14874 | reference->iv.data, reference->iv.len); |
| 14875 | |
| 14876 | sym_op->cipher.data.length = reference->cipher_len; |
| 14877 | sym_op->cipher.data.offset = reference->cipher_offset; |
| 14878 | |
| 14879 | sym_op->auth.data.length = reference->plaintext.len; |
| 14880 | sym_op->auth.data.offset = reference->auth_offset; |
| 14881 | |
| 14882 | return 0; |
| 14883 | } |
| 14884 | |
| 14885 | static int |
| 14886 | create_auth_verify_operation(struct crypto_testsuite_params *ts_params, |
no test coverage detected