#define TEST_VECTOR_SIZE 256
static int gbl_driver_id;
-struct crypto_testsuite_params {
+struct crypto_testsuite_params_asym {
struct rte_mempool *op_mpool;
struct rte_mempool *session_mpool;
struct rte_cryptodev_config conf;
static uint32_t test_index;
-static struct crypto_testsuite_params testsuite_params = { NULL };
+static struct crypto_testsuite_params_asym testsuite_params = { NULL };
static int
queue_ops_rsa_sign_verify(struct rte_cryptodev_asym_session *sess)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_op *op, *result_op;
static int
queue_ops_rsa_enc_dec(struct rte_cryptodev_asym_session *sess)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_crypto_op *op, *result_op;
}
static int
-test_cryptodev_asym_op(struct crypto_testsuite_params *ts_params,
+test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
union test_case_structure *data_tc,
char *test_msg, int sessionless, enum rte_crypto_asym_op_type type,
enum rte_crypto_rsa_priv_key_type key_type)
test_one_by_one(void)
{
int status = TEST_SUCCESS;
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
uint32_t i = 0;
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_cryptodev_info dev_info;
static int
test_rsa_sign_verify(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ 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;
static int
test_rsa_enc_dec(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ 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;
static int
test_rsa_sign_verify_crt(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ 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;
static int
test_rsa_enc_dec_crt(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ 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;
static int
testsuite_setup(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
uint8_t valid_devs[RTE_CRYPTO_MAX_DEVS];
struct rte_cryptodev_info info;
int ret, dev_id = -1;
static void
testsuite_teardown(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
if (ts_params->op_mpool != NULL) {
RTE_LOG(DEBUG, USER1, "CRYPTO_OP_POOL count %u\n",
}
static int
-ut_setup(void)
+ut_setup_asym(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
uint16_t qp_id;
}
static void
-ut_teardown(void)
+ut_teardown_asym(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_cryptodev_stats stats;
rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats);
static int
test_capability(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
uint8_t dev_id = ts_params->valid_devs[0];
struct rte_cryptodev_info dev_info;
const struct rte_cryptodev_capabilities *dev_capa;
static int
test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
static int
test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
static int
test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
static int
test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
static int
test_mod_inv(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
static int
test_mod_exp(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
static int
test_dsa_sign(void)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
struct rte_mempool *op_mpool = ts_params->op_mpool;
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
static int
test_ecdsa_sign_verify(enum curve curve_id)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
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;
static int
test_ecpm(enum curve curve_id)
{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
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;
.setup = testsuite_setup,
.teardown = testsuite_teardown,
.unit_test_cases = {
- TEST_CASE_ST(ut_setup, ut_teardown, test_capability),
- TEST_CASE_ST(ut_setup, ut_teardown, test_dsa),
- TEST_CASE_ST(ut_setup, ut_teardown, test_dh_keygenration),
- TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_enc_dec),
- TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_sign_verify),
- TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_enc_dec_crt),
- TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_sign_verify_crt),
- TEST_CASE_ST(ut_setup, ut_teardown, test_mod_inv),
- TEST_CASE_ST(ut_setup, ut_teardown, test_mod_exp),
- TEST_CASE_ST(ut_setup, ut_teardown, test_one_by_one),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_capability),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_dsa),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+ test_dh_keygenration),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_rsa_enc_dec),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+ test_rsa_sign_verify),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+ test_rsa_enc_dec_crt),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+ test_rsa_sign_verify_crt),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_mod_inv),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_mod_exp),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_one_by_one),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
.setup = testsuite_setup,
.teardown = testsuite_teardown,
.unit_test_cases = {
- TEST_CASE_ST(ut_setup, ut_teardown, test_one_by_one),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_one_by_one),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
.setup = testsuite_setup,
.teardown = testsuite_teardown,
.unit_test_cases = {
- TEST_CASE_ST(ut_setup, ut_teardown, test_capability),
- TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_enc_dec_crt),
- TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_sign_verify_crt),
- TEST_CASE_ST(ut_setup, ut_teardown, test_mod_exp),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_capability),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+ test_rsa_enc_dec_crt),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+ test_rsa_sign_verify_crt),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_mod_exp),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
test_ecdsa_sign_verify_all_curve),
- TEST_CASE_ST(ut_setup, ut_teardown, test_ecpm_all_curve),
+ TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+ test_ecpm_all_curve),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
}
static int
-ut_setup(void)
+ut_setup_ipsec(void)
{
struct ipsec_testsuite_params *ts_params = &testsuite_params;
struct ipsec_unitest_params *ut_params = &unittest_params;
}
static void
-ut_teardown(void)
+ut_teardown_ipsec(void)
{
struct ipsec_testsuite_params *ts_params = &testsuite_params;
struct ipsec_unitest_params *ut_params = &unittest_params;
.setup = testsuite_setup,
.teardown = testsuite_teardown,
.unit_test_cases = {
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_crypto_inb_burst_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_crypto_outb_burst_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_inline_crypto_inb_burst_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_inline_crypto_outb_burst_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_inline_proto_inb_burst_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_inline_proto_outb_burst_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_lksd_proto_inb_burst_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_lksd_proto_outb_burst_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_replay_inb_inside_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_replay_inb_outside_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_replay_inb_repeat_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_replay_inb_inside_burst_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_crypto_inb_burst_2sa_null_null_wrapper),
- TEST_CASE_ST(ut_setup, ut_teardown,
+ TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
test_ipsec_crypto_inb_burst_2sa_4grp_null_null_wrapper),
TEST_CASES_END() /**< NULL terminate unit test array */
}