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

Function test_snow3g_auth_cipher_sgl

dpdk/app/test/test_cryptodev.c:5320–5536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5318}
5319
5320static int
5321test_snow3g_auth_cipher_sgl(const struct snow3g_test_data *tdata,
5322 uint8_t op_mode, uint8_t verify)
5323{
5324 struct crypto_testsuite_params *ts_params = &testsuite_params;
5325 struct crypto_unittest_params *ut_params = &unittest_params;
5326
5327 int retval;
5328
5329 const uint8_t *plaintext = NULL;
5330 const uint8_t *ciphertext = NULL;
5331 const uint8_t *digest = NULL;
5332 unsigned int plaintext_pad_len;
5333 unsigned int plaintext_len;
5334 unsigned int ciphertext_pad_len;
5335 unsigned int ciphertext_len;
5336 uint8_t buffer[10000];
5337 uint8_t digest_buffer[10000];
5338
5339 struct rte_cryptodev_info dev_info;
5340
5341 /* Verify the capabilities */
5342 struct rte_cryptodev_sym_capability_idx cap_idx;
5343 cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
5344 cap_idx.algo.auth = RTE_CRYPTO_AUTH_SNOW3G_UIA2;
5345 if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
5346 &cap_idx) == NULL)
5347 return TEST_SKIPPED;
5348 cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
5349 cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
5350 if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
5351 &cap_idx) == NULL)
5352 return TEST_SKIPPED;
5353
5354 if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
5355 return TEST_SKIPPED;
5356
5357 rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
5358
5359 uint64_t feat_flags = dev_info.feature_flags;
5360
5361 if (op_mode == IN_PLACE) {
5362 if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) {
5363 printf("Device doesn't support in-place scatter-gather "
5364 "in both input and output mbufs.\n");
5365 return TEST_SKIPPED;
5366 }
5367 if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) &&
5368 (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) {
5369 printf("Device doesn't support RAW data-path APIs.\n");
5370 return TEST_SKIPPED;
5371 }
5372 } else {
5373 if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
5374 return TEST_SKIPPED;
5375 if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) {
5376 printf("Device doesn't support out-of-place scatter-gather "
5377 "in both input and output mbufs.\n");

Calls 13

rte_cryptodev_info_getFunction · 0.85
ceil_byte_lengthFunction · 0.85
create_segmented_mbufFunction · 0.85
pktmbuf_writeFunction · 0.85
rte_pktmbuf_readFunction · 0.85
debug_hexdumpFunction · 0.85
memsetFunction · 0.85
process_sym_raw_dp_opFunction · 0.85
process_crypto_requestFunction · 0.70

Tested by

no test coverage detected