| 1658 | } |
| 1659 | |
| 1660 | static int |
| 1661 | test_ecpm(enum curve curve_id) |
| 1662 | { |
| 1663 | struct crypto_testsuite_params_asym *ts_params = &testsuite_params; |
| 1664 | struct rte_mempool *sess_mpool = ts_params->session_mpool; |
| 1665 | struct rte_mempool *op_mpool = ts_params->op_mpool; |
| 1666 | struct crypto_testsuite_ecpm_params input_params; |
| 1667 | void *sess = NULL; |
| 1668 | uint8_t dev_id = ts_params->valid_devs[0]; |
| 1669 | struct rte_crypto_op *result_op = NULL; |
| 1670 | uint8_t output_buf_x[TEST_DATA_SIZE]; |
| 1671 | uint8_t output_buf_y[TEST_DATA_SIZE]; |
| 1672 | struct rte_crypto_asym_xform xform; |
| 1673 | struct rte_crypto_asym_op *asym_op; |
| 1674 | struct rte_cryptodev_info dev_info; |
| 1675 | struct rte_crypto_op *op = NULL; |
| 1676 | int ret, status = TEST_SUCCESS; |
| 1677 | |
| 1678 | switch (curve_id) { |
| 1679 | case SECP192R1: |
| 1680 | input_params = ecpm_param_secp192r1; |
| 1681 | break; |
| 1682 | case SECP224R1: |
| 1683 | input_params = ecpm_param_secp224r1; |
| 1684 | break; |
| 1685 | case SECP256R1: |
| 1686 | input_params = ecpm_param_secp256r1; |
| 1687 | break; |
| 1688 | case SECP384R1: |
| 1689 | input_params = ecpm_param_secp384r1; |
| 1690 | break; |
| 1691 | case SECP521R1: |
| 1692 | input_params = ecpm_param_secp521r1; |
| 1693 | break; |
| 1694 | default: |
| 1695 | RTE_LOG(ERR, USER1, |
| 1696 | "line %u FAILED: %s", __LINE__, |
| 1697 | "Unsupported curve id\n"); |
| 1698 | status = TEST_FAILED; |
| 1699 | goto exit; |
| 1700 | } |
| 1701 | |
| 1702 | rte_cryptodev_info_get(dev_id, &dev_info); |
| 1703 | |
| 1704 | /* Setup crypto op data structure */ |
| 1705 | op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC); |
| 1706 | if (op == NULL) { |
| 1707 | RTE_LOG(ERR, USER1, |
| 1708 | "line %u FAILED: %s", __LINE__, |
| 1709 | "Failed to allocate asymmetric crypto " |
| 1710 | "operation struct\n"); |
| 1711 | status = TEST_FAILED; |
| 1712 | goto exit; |
| 1713 | } |
| 1714 | asym_op = op->asym; |
| 1715 | |
| 1716 | /* Setup asym xform */ |
| 1717 | xform.next = NULL; |
no test coverage detected