| 14283 | } |
| 14284 | |
| 14285 | static int |
| 14286 | test_AES_GMAC_authentication_SGL(const struct gmac_test_data *tdata, |
| 14287 | uint32_t fragsz) |
| 14288 | { |
| 14289 | struct crypto_testsuite_params *ts_params = &testsuite_params; |
| 14290 | struct crypto_unittest_params *ut_params = &unittest_params; |
| 14291 | struct rte_cryptodev_info dev_info; |
| 14292 | uint64_t feature_flags; |
| 14293 | unsigned int trn_data = 0; |
| 14294 | void *digest_mem = NULL; |
| 14295 | uint32_t segs = 1; |
| 14296 | unsigned int to_trn = 0; |
| 14297 | struct rte_mbuf *buf = NULL; |
| 14298 | uint8_t *auth_tag, *plaintext; |
| 14299 | int retval; |
| 14300 | |
| 14301 | TEST_ASSERT_NOT_EQUAL(tdata->gmac_tag.len, 0, |
| 14302 | "No GMAC length in the source data"); |
| 14303 | |
| 14304 | /* Verify the capabilities */ |
| 14305 | struct rte_cryptodev_sym_capability_idx cap_idx; |
| 14306 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; |
| 14307 | cap_idx.algo.auth = RTE_CRYPTO_AUTH_AES_GMAC; |
| 14308 | if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], |
| 14309 | &cap_idx) == NULL) |
| 14310 | return TEST_SKIPPED; |
| 14311 | |
| 14312 | /* Check for any input SGL support */ |
| 14313 | rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); |
| 14314 | feature_flags = dev_info.feature_flags; |
| 14315 | |
| 14316 | if ((!(feature_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) || |
| 14317 | (!(feature_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT)) || |
| 14318 | (!(feature_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT))) |
| 14319 | return TEST_SKIPPED; |
| 14320 | |
| 14321 | if (fragsz > tdata->plaintext.len) |
| 14322 | fragsz = tdata->plaintext.len; |
| 14323 | |
| 14324 | uint16_t plaintext_len = fragsz; |
| 14325 | |
| 14326 | retval = create_gmac_session(ts_params->valid_devs[0], |
| 14327 | tdata, RTE_CRYPTO_AUTH_OP_GENERATE); |
| 14328 | |
| 14329 | if (retval == TEST_SKIPPED) |
| 14330 | return TEST_SKIPPED; |
| 14331 | if (retval < 0) |
| 14332 | return retval; |
| 14333 | |
| 14334 | ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); |
| 14335 | TEST_ASSERT_NOT_NULL(ut_params->ibuf, |
| 14336 | "Failed to allocate input buffer in mempool"); |
| 14337 | |
| 14338 | memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, |
| 14339 | rte_pktmbuf_tailroom(ut_params->ibuf)); |
| 14340 | |
| 14341 | plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, |
| 14342 | plaintext_len); |
no test coverage detected