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

Function MD5_HMAC_create_session

dpdk/app/test/test_cryptodev.c:12960–12992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12958}
12959
12960static int MD5_HMAC_create_session(struct crypto_testsuite_params *ts_params,
12961 struct crypto_unittest_params *ut_params,
12962 enum rte_crypto_auth_operation op,
12963 const struct HMAC_MD5_vector *test_case)
12964{
12965 uint8_t key[64];
12966
12967 memcpy(key, test_case->key.data, test_case->key.len);
12968
12969 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
12970 ut_params->auth_xform.next = NULL;
12971 ut_params->auth_xform.auth.op = op;
12972
12973 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_MD5_HMAC;
12974
12975 ut_params->auth_xform.auth.digest_length = MD5_DIGEST_LEN;
12976 ut_params->auth_xform.auth.key.length = test_case->key.len;
12977 ut_params->auth_xform.auth.key.data = key;
12978
12979 ut_params->sess = rte_cryptodev_sym_session_create(
12980 ts_params->valid_devs[0], &ut_params->auth_xform,
12981 ts_params->session_mpool);
12982 if (ut_params->sess == NULL && rte_errno == ENOTSUP)
12983 return TEST_SKIPPED;
12984 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
12985
12986 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
12987
12988 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
12989 rte_pktmbuf_tailroom(ut_params->ibuf));
12990
12991 return 0;
12992}
12993
12994static int MD5_HMAC_create_op(struct crypto_unittest_params *ut_params,
12995 const struct HMAC_MD5_vector *test_case,

Callers 2

test_MD5_HMAC_generateFunction · 0.85
test_MD5_HMAC_verifyFunction · 0.85

Calls 5

rte_pktmbuf_allocFunction · 0.85
memsetFunction · 0.85
rte_pktmbuf_tailroomFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected