| 286 | } |
| 287 | |
| 288 | static int |
| 289 | test_rsa_enc_dec(void) |
| 290 | { |
| 291 | struct crypto_testsuite_params_asym *ts_params = &testsuite_params; |
| 292 | struct rte_mempool *sess_mpool = ts_params->session_mpool; |
| 293 | uint8_t dev_id = ts_params->valid_devs[0]; |
| 294 | void *sess = NULL; |
| 295 | struct rte_cryptodev_info dev_info; |
| 296 | int ret, status = TEST_SUCCESS; |
| 297 | |
| 298 | /* Test case supports op with exponent key only, |
| 299 | * Check in PMD feature flag for RSA exponent key type support. |
| 300 | */ |
| 301 | rte_cryptodev_info_get(dev_id, &dev_info); |
| 302 | if (!(dev_info.feature_flags & |
| 303 | RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP)) { |
| 304 | RTE_LOG(INFO, USER1, "Device doesn't support decrypt op with " |
| 305 | "exponent key type. Test skipped\n"); |
| 306 | return TEST_SKIPPED; |
| 307 | } |
| 308 | |
| 309 | ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess); |
| 310 | |
| 311 | if (ret < 0) { |
| 312 | RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n"); |
| 313 | status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED; |
| 314 | goto error_exit; |
| 315 | } |
| 316 | |
| 317 | status = queue_ops_rsa_enc_dec(sess); |
| 318 | |
| 319 | error_exit: |
| 320 | |
| 321 | rte_cryptodev_asym_session_free(dev_id, sess); |
| 322 | |
| 323 | TEST_ASSERT_EQUAL(status, 0, "Test failed"); |
| 324 | |
| 325 | return status; |
| 326 | } |
| 327 | |
| 328 | static int |
| 329 | test_rsa_sign_verify_crt(void) |
nothing calls this directly
no test coverage detected