MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_authenticated_encryption_oop

Function test_authenticated_encryption_oop

dpdk/app/test/test_cryptodev.c:12267–12375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12265}
12266
12267static int
12268test_authenticated_encryption_oop(const struct aead_test_data *tdata)
12269{
12270 struct crypto_testsuite_params *ts_params = &testsuite_params;
12271 struct crypto_unittest_params *ut_params = &unittest_params;
12272
12273 uint32_t i;
12274 uint8_t *buffer_oop;
12275 int retval;
12276 uint8_t *ciphertext, *auth_tag;
12277 uint16_t plaintext_pad_len;
12278 struct rte_cryptodev_info dev_info;
12279
12280 /* Verify the capabilities */
12281 struct rte_cryptodev_sym_capability_idx cap_idx;
12282 cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
12283 cap_idx.algo.aead = tdata->algo;
12284 if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
12285 &cap_idx) == NULL)
12286 return TEST_SKIPPED;
12287
12288 rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
12289 uint64_t feat_flags = dev_info.feature_flags;
12290
12291 if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) &&
12292 (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP)))
12293 return TEST_SKIPPED;
12294
12295 /* not supported with CPU crypto */
12296 if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
12297 return TEST_SKIPPED;
12298
12299 /* Create AEAD session */
12300 retval = create_aead_session(ts_params->valid_devs[0],
12301 tdata->algo,
12302 RTE_CRYPTO_AEAD_OP_ENCRYPT,
12303 tdata->key.data, tdata->key.len,
12304 tdata->aad.len, tdata->auth_tag.len,
12305 tdata->iv.len);
12306 if (retval < 0)
12307 return retval;
12308
12309 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
12310 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
12311
12312 /* clear mbuf payload */
12313 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
12314 rte_pktmbuf_tailroom(ut_params->ibuf));
12315 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0,
12316 rte_pktmbuf_tailroom(ut_params->obuf));
12317
12318 /* Create AEAD operation */
12319 retval = create_aead_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata);
12320 if (retval < 0)
12321 return retval;
12322
12323 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
12324

Calls 11

rte_cryptodev_info_getFunction · 0.85
create_aead_sessionFunction · 0.85
rte_pktmbuf_allocFunction · 0.85
memsetFunction · 0.85
rte_pktmbuf_tailroomFunction · 0.85
create_aead_operationFunction · 0.85
process_sym_raw_dp_opFunction · 0.85
debug_hexdumpFunction · 0.85
process_crypto_requestFunction · 0.70

Tested by

no test coverage detected