| 13949 | } |
| 13950 | |
| 13951 | static int |
| 13952 | create_gmac_operation_sgl(enum rte_crypto_auth_operation op, |
| 13953 | const struct gmac_test_data *tdata, |
| 13954 | void *digest_mem, uint64_t digest_phys) |
| 13955 | { |
| 13956 | struct crypto_testsuite_params *ts_params = &testsuite_params; |
| 13957 | struct crypto_unittest_params *ut_params = &unittest_params; |
| 13958 | struct rte_crypto_sym_op *sym_op; |
| 13959 | |
| 13960 | /* Generate Crypto op data structure */ |
| 13961 | ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, |
| 13962 | RTE_CRYPTO_OP_TYPE_SYMMETRIC); |
| 13963 | TEST_ASSERT_NOT_NULL(ut_params->op, |
| 13964 | "Failed to allocate symmetric crypto operation struct"); |
| 13965 | |
| 13966 | sym_op = ut_params->op->sym; |
| 13967 | |
| 13968 | sym_op->auth.digest.data = digest_mem; |
| 13969 | TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data, |
| 13970 | "no room to append digest"); |
| 13971 | |
| 13972 | sym_op->auth.digest.phys_addr = digest_phys; |
| 13973 | |
| 13974 | if (op == RTE_CRYPTO_AUTH_OP_VERIFY) { |
| 13975 | rte_memcpy(sym_op->auth.digest.data, tdata->gmac_tag.data, |
| 13976 | tdata->gmac_tag.len); |
| 13977 | debug_hexdump(stdout, "digest:", |
| 13978 | sym_op->auth.digest.data, |
| 13979 | tdata->gmac_tag.len); |
| 13980 | } |
| 13981 | |
| 13982 | uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, |
| 13983 | uint8_t *, IV_OFFSET); |
| 13984 | |
| 13985 | rte_memcpy(iv_ptr, tdata->iv.data, tdata->iv.len); |
| 13986 | |
| 13987 | debug_hexdump(stdout, "iv:", iv_ptr, tdata->iv.len); |
| 13988 | |
| 13989 | sym_op->cipher.data.length = 0; |
| 13990 | sym_op->cipher.data.offset = 0; |
| 13991 | |
| 13992 | sym_op->auth.data.offset = 0; |
| 13993 | sym_op->auth.data.length = tdata->plaintext.len; |
| 13994 | |
| 13995 | return 0; |
| 13996 | } |
| 13997 | |
| 13998 | static int create_gmac_session(uint8_t dev_id, |
| 13999 | const struct gmac_test_data *tdata, |
no test coverage detected