get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/109437/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 109437,
    "url": "https://patches.dpdk.org/api/patches/109437/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220407164520.20996-1-arkadiuszx.kusztal@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20220407164520.20996-1-arkadiuszx.kusztal@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220407164520.20996-1-arkadiuszx.kusztal@intel.com",
    "date": "2022-04-07T16:45:20",
    "name": "crypto/qat: add ec point verify function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9c9317c31d37a55d1876f728bf5dba17171be4bb",
    "submitter": {
        "id": 452,
        "url": "https://patches.dpdk.org/api/people/452/?format=api",
        "name": "Arkadiusz Kusztal",
        "email": "arkadiuszx.kusztal@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "https://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220407164520.20996-1-arkadiuszx.kusztal@intel.com/mbox/",
    "series": [
        {
            "id": 22418,
            "url": "https://patches.dpdk.org/api/series/22418/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22418",
            "date": "2022-04-07T16:45:20",
            "name": "crypto/qat: add ec point verify function",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/22418/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/109437/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/109437/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A037EA0505;\n\tThu,  7 Apr 2022 18:45:48 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8205A4068B;\n\tThu,  7 Apr 2022 18:45:48 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id F02BE40689\n for <dev@dpdk.org>; Thu,  7 Apr 2022 18:45:45 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Apr 2022 09:45:23 -0700",
            "from silpixa00400308.ir.intel.com ([10.237.214.95])\n by orsmga007.jf.intel.com with ESMTP; 07 Apr 2022 09:45:22 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1649349946; x=1680885946;\n h=from:to:cc:subject:date:message-id;\n bh=mNOzmSQFdunUeukvI9CYnOquv8fBAex2gHtAyH8l+nc=;\n b=ITjZ+aYIgSsj7YHdooo9zGfyCXM902aO3l5S1wflYDYySgE3dC7wt3lH\n 9Z44d2UlqYSKfF+kx8y9wlTUDavxOInUeDrZ4zUPfxEguMo+YEvAgzniy\n vC/Bv5J6hJN8JKVbyVj1Z7g/H4I5XHSG6sMNOexK6wBWuU+R6UjxT5dsG\n TukkJTBGbeIBCCaxsYpfy5oisOIiiepkU6kgfrxG536OGMebh9uwwbIy3\n ZM1hCQt8MyN6STRhAqlSN2SWRquUqYwMOEsvRDTO3FwPxONzHMBI4/obd\n 02puQ5clr+nRRX3n47JS4EsSnRWPf8JDmyhG/p7hOSGKNbhYdz+6Q9D21 Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10310\"; a=\"324540460\"",
            "E=Sophos;i=\"5.90,242,1643702400\"; d=\"scan'208\";a=\"324540460\"",
            "E=Sophos;i=\"5.90,242,1643702400\"; d=\"scan'208\";a=\"550141338\""
        ],
        "X-ExtLoop1": "1",
        "From": "Arek Kusztal <arkadiuszx.kusztal@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "gakhil@marvell.com, roy.fan.zhang@intel.com,\n Arek Kusztal <arkadiuszx.kusztal@intel.com>",
        "Subject": "[PATCH] crypto/qat: add ec point verify function",
        "Date": "Thu,  7 Apr 2022 17:45:20 +0100",
        "Message-Id": "<20220407164520.20996-1-arkadiuszx.kusztal@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "This commit adds elliptic curve point verification\nto Intel QuickAssist Technology PMD.\n\nSigned-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>\n---\nDepends-on: patch-109436 (\"cryptodev: add dh verify option\")\n\n drivers/common/qat/qat_adf/qat_pke.h | 24 ++++++++++++++\n drivers/crypto/qat/qat_asym.c        | 64 +++++++++++++++++++++++++++++++++++-\n 2 files changed, 87 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/common/qat/qat_adf/qat_pke.h b/drivers/common/qat/qat_adf/qat_pke.h\nindex c727e4e1af..5c6569adf5 100644\n--- a/drivers/common/qat/qat_adf/qat_pke.h\n+++ b/drivers/common/qat/qat_adf/qat_pke.h\n@@ -326,4 +326,28 @@ get_ecpm_function(struct rte_crypto_asym_xform *xform)\n \treturn qat_function;\n }\n \n+static struct qat_asym_function\n+get_ec_verify_function(struct rte_crypto_asym_xform *xform)\n+{\n+\tstruct qat_asym_function qat_function;\n+\n+\tswitch (xform->ec.curve_id) {\n+\tcase RTE_CRYPTO_EC_GROUP_SECP256R1:\n+\t\tqat_function.func_id = MATHS_POINT_VERIFY_GFP_L256;\n+\t\tqat_function.bytesize = 32;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_EC_GROUP_SECP384R1:\n+\t\tqat_function.func_id = MATHS_POINT_VERIFY_GFP_L512;\n+\t\tqat_function.bytesize = 64;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_EC_GROUP_SECP521R1:\n+\t\tqat_function.func_id = MATHS_POINT_VERIFY_GFP_521;\n+\t\tqat_function.bytesize = 66;\n+\t\tbreak;\n+\tdefault:\n+\t\tqat_function.func_id = 0;\n+\t}\n+\treturn qat_function;\n+}\n+\n #endif\ndiff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c\nindex 5dccd26201..8f27219583 100644\n--- a/drivers/crypto/qat/qat_asym.c\n+++ b/drivers/crypto/qat/qat_asym.c\n@@ -831,7 +831,7 @@ dh_mod_set_input(struct rte_crypto_asym_op *asym_op,\n }\n \n static int\n-ecdh_set_input(struct rte_crypto_asym_op *asym_op,\n+ecdh_set_input_phase(struct rte_crypto_asym_op *asym_op,\n \t\tstruct icp_qat_fw_pke_request *qat_req,\n \t\tstruct qat_asym_op_cookie *cookie,\n \t\tstruct rte_crypto_asym_xform *xform)\n@@ -888,6 +888,65 @@ ecdh_set_input(struct rte_crypto_asym_op *asym_op,\n }\n \n static int\n+ecdh_set_input_verify(struct rte_crypto_asym_op *asym_op,\n+\t\tstruct icp_qat_fw_pke_request *qat_req,\n+\t\tstruct qat_asym_op_cookie *cookie,\n+\t\tstruct rte_crypto_asym_xform *xform)\n+{\n+\tstruct qat_asym_function qat_function;\n+\tuint32_t qat_func_alignsize, func_id;\n+\tint curve_id;\n+\n+\tcurve_id = pick_curve(xform);\n+\tif (curve_id < 0) {\n+\t\tQAT_LOG(DEBUG, \"Incorrect elliptic curve\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tqat_function = get_ec_verify_function(xform);\n+\tfunc_id = qat_function.func_id;\n+\tif (func_id == 0) {\n+\t\tQAT_LOG(ERR, \"Cannot obtain functionality id\");\n+\t\treturn -EINVAL;\n+\t}\n+\tqat_func_alignsize = RTE_ALIGN_CEIL(qat_function.bytesize, 8);\n+\n+\tSET_PKE_LN(asym_op->dh.pub_point.x, qat_func_alignsize, 0);\n+\tSET_PKE_LN(asym_op->dh.pub_point.y, qat_func_alignsize, 1);\n+\tSET_PKE_LN_EC(curve[curve_id], p, 2);\n+\tSET_PKE_LN_EC(curve[curve_id], a, 3);\n+\tSET_PKE_LN_EC(curve[curve_id], b, 4);\n+\n+\tcookie->alg_bytesize = curve[curve_id].bytesize;\n+\tcookie->qat_func_alignsize = qat_func_alignsize;\n+\tqat_req->pke_hdr.cd_pars.func_id = func_id;\n+\tqat_req->input_param_count =\n+\t\t\t5;\n+\tqat_req->output_param_count =\n+\t\t\t0;\n+\n+\tHEXDUMP(\"x\", cookie->input_array[0], qat_func_alignsize);\n+\tHEXDUMP(\"y\", cookie->input_array[1], qat_func_alignsize);\n+\tHEXDUMP(\"p\", cookie->input_array[2], qat_func_alignsize);\n+\tHEXDUMP(\"a\", cookie->input_array[3], qat_func_alignsize);\n+\tHEXDUMP(\"b\", cookie->input_array[4], qat_func_alignsize);\n+\n+\treturn 0;\n+}\n+\n+static int\n+ecdh_set_input(struct rte_crypto_asym_op *asym_op,\n+\t\tstruct icp_qat_fw_pke_request *qat_req,\n+\t\tstruct qat_asym_op_cookie *cookie,\n+\t\tstruct rte_crypto_asym_xform *xform)\n+{\n+\tif (asym_op->dh.op_type == RTE_CRYPTO_ASYM_OP_KEY_VERIFY)\n+\t\treturn ecdh_set_input_verify(asym_op, qat_req, cookie, xform);\n+\telse\n+\t\treturn ecdh_set_input_phase(asym_op, qat_req, cookie, xform);\n+}\n+\n+static int\n dh_set_input(struct rte_crypto_asym_op *asym_op,\n \t\tstruct icp_qat_fw_pke_request *qat_req,\n \t\tstruct qat_asym_op_cookie *cookie,\n@@ -935,6 +994,9 @@ ecdh_collect(struct rte_crypto_asym_op *asym_op,\n \tuint32_t qat_func_alignsize = cookie->qat_func_alignsize;\n \tuint32_t ltrim = qat_func_alignsize - alg_bytesize;\n \n+\tif (asym_op->dh.op_type == RTE_CRYPTO_ASYM_OP_KEY_VERIFY)\n+\t\treturn RTE_CRYPTO_OP_STATUS_SUCCESS;\n+\n \tif (asym_op->dh.op_type == RTE_CRYPTO_ASYM_OP_PUBLIC_KEY_GENERATE) {\n \t\tasym_op->dh.pub_point.x.length = alg_bytesize;\n \t\tasym_op->dh.pub_point.y.length = alg_bytesize;\n",
    "prefixes": []
}