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

Function test_mixed_auth_cipher

dpdk/app/test/test_cryptodev.c:7928–8124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7926}
7927
7928static int
7929test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
7930 uint8_t op_mode, uint8_t verify)
7931{
7932 struct crypto_testsuite_params *ts_params = &testsuite_params;
7933 struct crypto_unittest_params *ut_params = &unittest_params;
7934
7935 int retval;
7936
7937 uint8_t *plaintext = NULL, *ciphertext = NULL;
7938 unsigned int plaintext_pad_len;
7939 unsigned int plaintext_len;
7940 unsigned int ciphertext_pad_len;
7941 unsigned int ciphertext_len;
7942
7943 struct rte_cryptodev_info dev_info;
7944 struct rte_crypto_op *op;
7945
7946 /* Check if device supports particular algorithms separately */
7947 if (test_mixed_check_if_unsupported(tdata))
7948 return TEST_SKIPPED;
7949 if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
7950 return TEST_SKIPPED;
7951
7952 if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
7953 return TEST_SKIPPED;
7954
7955 rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
7956
7957 uint64_t feat_flags = dev_info.feature_flags;
7958
7959 if (!(feat_flags & RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED)) {
7960 printf("Device doesn't support digest encrypted.\n");
7961 return TEST_SKIPPED;
7962 }
7963
7964 /* Create the session */
7965 if (verify)
7966 retval = create_wireless_algo_cipher_auth_session(
7967 ts_params->valid_devs[0],
7968 RTE_CRYPTO_CIPHER_OP_DECRYPT,
7969 RTE_CRYPTO_AUTH_OP_VERIFY,
7970 tdata->auth_algo,
7971 tdata->cipher_algo,
7972 tdata->auth_key.data, tdata->auth_key.len,
7973 tdata->cipher_key.data, tdata->cipher_key.len,
7974 tdata->auth_iv.len, tdata->digest_enc.len,
7975 tdata->cipher_iv.len);
7976 else
7977 retval = create_wireless_algo_auth_cipher_session(
7978 ts_params->valid_devs[0],
7979 RTE_CRYPTO_CIPHER_OP_ENCRYPT,
7980 RTE_CRYPTO_AUTH_OP_GENERATE,
7981 tdata->auth_algo,
7982 tdata->cipher_algo,
7983 tdata->auth_key.data, tdata->auth_key.len,
7984 tdata->cipher_key.data, tdata->cipher_key.len,
7985 tdata->auth_iv.len, tdata->digest_enc.len,

Calls 14

rte_cryptodev_info_getFunction · 0.85
rte_pktmbuf_allocFunction · 0.85
memsetFunction · 0.85
rte_pktmbuf_tailroomFunction · 0.85
ceil_byte_lengthFunction · 0.85
rte_pktmbuf_appendFunction · 0.85
debug_hexdumpFunction · 0.85
process_crypto_requestFunction · 0.70

Tested by

no test coverage detected