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

Function test_kasumi_auth_cipher_sgl

dpdk/app/test/test_cryptodev.c:5731–5943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5729}
5730
5731static int
5732test_kasumi_auth_cipher_sgl(const struct kasumi_test_data *tdata,
5733 uint8_t op_mode, uint8_t verify)
5734{
5735 struct crypto_testsuite_params *ts_params = &testsuite_params;
5736 struct crypto_unittest_params *ut_params = &unittest_params;
5737
5738 int retval;
5739
5740 const uint8_t *plaintext = NULL;
5741 const uint8_t *ciphertext = NULL;
5742 const uint8_t *digest = NULL;
5743 unsigned int plaintext_pad_len;
5744 unsigned int plaintext_len;
5745 unsigned int ciphertext_pad_len;
5746 unsigned int ciphertext_len;
5747 uint8_t buffer[10000];
5748 uint8_t digest_buffer[10000];
5749
5750 struct rte_cryptodev_info dev_info;
5751
5752 /* Verify the capabilities */
5753 struct rte_cryptodev_sym_capability_idx cap_idx;
5754 cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
5755 cap_idx.algo.auth = RTE_CRYPTO_AUTH_KASUMI_F9;
5756 if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
5757 &cap_idx) == NULL)
5758 return TEST_SKIPPED;
5759 cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
5760 cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
5761 if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
5762 &cap_idx) == NULL)
5763 return TEST_SKIPPED;
5764
5765 if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
5766 return TEST_SKIPPED;
5767
5768 rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
5769
5770 uint64_t feat_flags = dev_info.feature_flags;
5771
5772 if (op_mode == IN_PLACE) {
5773 if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) {
5774 printf("Device doesn't support in-place scatter-gather "
5775 "in both input and output mbufs.\n");
5776 return TEST_SKIPPED;
5777 }
5778 if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) &&
5779 (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) {
5780 printf("Device doesn't support RAW data-path APIs.\n");
5781 return TEST_SKIPPED;
5782 }
5783 } else {
5784 if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
5785 return TEST_SKIPPED;
5786 if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) {
5787 printf("Device doesn't support out-of-place scatter-gather "
5788 "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