};
struct crypto_unittest_params {
- struct rte_cryptodev_asym_session *sess;
+ void *sess;
struct rte_crypto_op *op;
};
static struct crypto_testsuite_params_asym testsuite_params = { NULL };
static int
-queue_ops_rsa_sign_verify(struct rte_cryptodev_asym_session *sess)
+queue_ops_rsa_sign_verify(void *sess)
{
struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
}
static int
-queue_ops_rsa_enc_dec(struct rte_cryptodev_asym_session *sess)
+queue_ops_rsa_enc_dec(void *sess)
{
struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct rte_crypto_op *op = NULL;
struct rte_crypto_op *result_op = NULL;
struct rte_crypto_asym_xform xform_tc;
- struct rte_cryptodev_asym_session *sess = NULL;
+ void *sess = NULL;
struct rte_cryptodev_asym_capability_idx cap_idx;
const struct rte_cryptodev_asymmetric_xform_capability *capability;
uint8_t dev_id = ts_params->valid_devs[0];
uint8_t input[TEST_DATA_SIZE] = {0};
uint8_t *result = NULL;
- int status = TEST_SUCCESS;
+ int ret, status = TEST_SUCCESS;
xform_tc.next = NULL;
xform_tc.xform_type = data_tc->modex.xform_type;
}
if (!sessionless) {
- sess = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
- ts_params->session_mpool);
- if (!sess) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
+ ts_params->session_mpool, &sess);
+ if (ret < 0) {
snprintf(test_msg, ASYM_TEST_MSG_LEN,
"line %u "
"FAILED: %s", __LINE__,
"Session creation failed");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
- struct rte_cryptodev_asym_session *sess;
+ void *sess = NULL;
struct rte_cryptodev_info dev_info;
- int status = TEST_SUCCESS;
+ int ret, status = TEST_SUCCESS;
/* Test case supports op with exponent key only,
* Check in PMD feature flag for RSA exponent key type support.
return TEST_SKIPPED;
}
- sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+ ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
- if (!sess) {
+ if (ret < 0) {
RTE_LOG(ERR, USER1, "Session creation failed for "
"sign_verify\n");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
- struct rte_cryptodev_asym_session *sess;
+ void *sess = NULL;
struct rte_cryptodev_info dev_info;
- int status = TEST_SUCCESS;
+ int ret, status = TEST_SUCCESS;
/* Test case supports op with exponent key only,
* Check in PMD feature flag for RSA exponent key type support.
return TEST_SKIPPED;
}
- sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+ ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
- if (!sess) {
+ if (ret < 0) {
RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
- struct rte_cryptodev_asym_session *sess;
+ void *sess = NULL;
struct rte_cryptodev_info dev_info;
- int status = TEST_SUCCESS;
+ int ret, status = TEST_SUCCESS;
/* Test case supports op with quintuple format key only,
* Check im PMD feature flag for RSA quintuple key type support.
return TEST_SKIPPED;
}
- sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+ ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
- if (!sess) {
+ if (ret < 0) {
RTE_LOG(ERR, USER1, "Session creation failed for "
"sign_verify_crt\n");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
- struct rte_cryptodev_asym_session *sess;
+ void *sess = NULL;
struct rte_cryptodev_info dev_info;
- int status = TEST_SUCCESS;
+ int ret, status = TEST_SUCCESS;
/* Test case supports op with quintuple format key only,
* Check in PMD feature flag for RSA quintuple key type support.
return TEST_SKIPPED;
}
- sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+ ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
- if (!sess) {
+ if (ret < 0) {
RTE_LOG(ERR, USER1, "Session creation failed for "
"enc_dec_crt\n");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
}
ts_params->session_mpool = rte_cryptodev_asym_session_pool_create(
- "test_asym_sess_mp", TEST_NUM_SESSIONS, 0,
+ "test_asym_sess_mp", TEST_NUM_SESSIONS, 0, 0,
SOCKET_ID_ANY);
TEST_ASSERT_NOT_NULL(ts_params->session_mpool,
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_asym_op *asym_op = NULL;
struct rte_crypto_op *op = NULL, *result_op = NULL;
- struct rte_cryptodev_asym_session *sess = NULL;
- int status = TEST_SUCCESS;
+ void *sess = NULL;
+ int ret, status = TEST_SUCCESS;
uint8_t output[TEST_DH_MOD_LEN];
struct rte_crypto_asym_xform xform = *xfrm;
uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
asym_op->dh.shared_secret.data = output;
asym_op->dh.shared_secret.length = sizeof(output);
- sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
- if (sess == NULL) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+ if (ret < 0) {
RTE_LOG(ERR, USER1,
"line %u FAILED: %s", __LINE__,
"Session creation failed");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_asym_op *asym_op = NULL;
struct rte_crypto_op *op = NULL, *result_op = NULL;
- struct rte_cryptodev_asym_session *sess = NULL;
- int status = TEST_SUCCESS;
+ void *sess = NULL;
+ int ret, status = TEST_SUCCESS;
uint8_t output[TEST_DH_MOD_LEN];
struct rte_crypto_asym_xform xform = *xfrm;
asym_op->dh.priv_key.data = output;
asym_op->dh.priv_key.length = sizeof(output);
- sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
- if (sess == NULL) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+ if (ret < 0) {
RTE_LOG(ERR, USER1,
"line %u FAILED: %s", __LINE__,
"Session creation failed");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_asym_op *asym_op = NULL;
struct rte_crypto_op *op = NULL, *result_op = NULL;
- struct rte_cryptodev_asym_session *sess = NULL;
- int status = TEST_SUCCESS;
+ void *sess = NULL;
+ int ret, status = TEST_SUCCESS;
uint8_t output[TEST_DH_MOD_LEN];
struct rte_crypto_asym_xform xform = *xfrm;
0);
asym_op->dh.priv_key = dh_test_params.priv_key;
- sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
- if (sess == NULL) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+ if (ret < 0) {
RTE_LOG(ERR, USER1,
"line %u FAILED: %s", __LINE__,
"Session creation failed");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_asym_op *asym_op = NULL;
struct rte_crypto_op *op = NULL, *result_op = NULL;
- struct rte_cryptodev_asym_session *sess = NULL;
- int status = TEST_SUCCESS;
+ void *sess = NULL;
+ int ret, status = TEST_SUCCESS;
uint8_t out_pub_key[TEST_DH_MOD_LEN];
uint8_t out_prv_key[TEST_DH_MOD_LEN];
struct rte_crypto_asym_xform pub_key_xform;
asym_op->dh.priv_key.data = out_prv_key;
asym_op->dh.priv_key.length = sizeof(out_prv_key);
- sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
- if (sess == NULL) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+ if (ret < 0) {
RTE_LOG(ERR, USER1,
"line %u FAILED: %s", __LINE__,
"Session creation failed");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_asym_op *asym_op = NULL;
struct rte_crypto_op *op = NULL, *result_op = NULL;
- struct rte_cryptodev_asym_session *sess = NULL;
+ void *sess = NULL;
int status = TEST_SUCCESS;
struct rte_cryptodev_asym_capability_idx cap_idx;
const struct rte_cryptodev_asymmetric_xform_capability *capability;
return TEST_SKIPPED;
}
- sess = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool);
- if (!sess) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool, &sess);
+ if (ret < 0) {
RTE_LOG(ERR, USER1, "line %u "
"FAILED: %s", __LINE__,
"Session creation failed");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_asym_op *asym_op = NULL;
struct rte_crypto_op *op = NULL, *result_op = NULL;
- struct rte_cryptodev_asym_session *sess = NULL;
+ void *sess = NULL;
int status = TEST_SUCCESS;
struct rte_cryptodev_asym_capability_idx cap_idx;
const struct rte_cryptodev_asymmetric_xform_capability *capability;
goto error_exit;
}
- sess = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool);
- if (!sess) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool, &sess);
+ if (ret < 0) {
RTE_LOG(ERR, USER1,
"line %u "
"FAILED: %s", __LINE__,
"Session creation failed");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_asym_op *asym_op = NULL;
struct rte_crypto_op *op = NULL, *result_op = NULL;
- struct rte_cryptodev_asym_session *sess = NULL;
+ void *sess = NULL;
int status = TEST_SUCCESS;
uint8_t r[TEST_DH_MOD_LEN];
uint8_t s[TEST_DH_MOD_LEN];
uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
+ int ret;
- sess = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool);
- if (sess == NULL) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool, &sess);
+ if (ret < 0) {
RTE_LOG(ERR, USER1,
"line %u FAILED: %s", __LINE__,
"Session creation failed");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto error_exit;
}
/* set up crypto op data structure */
struct rte_mempool *sess_mpool = ts_params->session_mpool;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct crypto_testsuite_ecdsa_params input_params;
- struct rte_cryptodev_asym_session *sess = NULL;
+ void *sess = NULL;
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_op *result_op = NULL;
uint8_t output_buf_r[TEST_DATA_SIZE];
struct rte_crypto_asym_op *asym_op;
struct rte_cryptodev_info dev_info;
struct rte_crypto_op *op = NULL;
- int status = TEST_SUCCESS, ret;
+ int ret, status = TEST_SUCCESS;
switch (curve_id) {
case SECP192R1:
xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
xform.ec.curve_id = input_params.curve;
- sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
- if (sess == NULL) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+ if (ret < 0) {
RTE_LOG(ERR, USER1,
"line %u FAILED: %s", __LINE__,
"Session creation failed\n");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto exit;
}
struct rte_mempool *sess_mpool = ts_params->session_mpool;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct crypto_testsuite_ecpm_params input_params;
- struct rte_cryptodev_asym_session *sess = NULL;
+ void *sess = NULL;
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_op *result_op = NULL;
uint8_t output_buf_x[TEST_DATA_SIZE];
struct rte_crypto_asym_op *asym_op;
struct rte_cryptodev_info dev_info;
struct rte_crypto_op *op = NULL;
- int status = TEST_SUCCESS, ret;
+ int ret, status = TEST_SUCCESS;
switch (curve_id) {
case SECP192R1:
xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
xform.ec.curve_id = input_params.curve;
- sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
- if (sess == NULL) {
+ ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+ if (ret < 0) {
RTE_LOG(ERR, USER1,
"line %u FAILED: %s", __LINE__,
"Session creation failed\n");
- status = TEST_FAILED;
+ status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
goto exit;
}