get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 115196,
    "url": "http://patches.dpdk.org/api/patches/115196/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220817065536.79716-3-arkadiuszx.kusztal@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20220817065536.79716-3-arkadiuszx.kusztal@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220817065536.79716-3-arkadiuszx.kusztal@intel.com",
    "date": "2022-08-17T06:55:35",
    "name": "[2/3] crypto/qat: add ecdh key exchange algorithm",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "52976654cf84c99a5d30313f62be811edbdebc53",
    "submitter": {
        "id": 452,
        "url": "http://patches.dpdk.org/api/people/452/?format=api",
        "name": "Arkadiusz Kusztal",
        "email": "arkadiuszx.kusztal@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220817065536.79716-3-arkadiuszx.kusztal@intel.com/mbox/",
    "series": [
        {
            "id": 24333,
            "url": "http://patches.dpdk.org/api/series/24333/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24333",
            "date": "2022-08-17T06:55:33",
            "name": "crypto/qat: extend asymmetric crypto pmd",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/24333/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/115196/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/115196/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 52470A0032;\n\tWed, 17 Aug 2022 10:04:42 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 58C32427F4;\n\tWed, 17 Aug 2022 10:04:33 +0200 (CEST)",
            "from mga06.intel.com (mga06b.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id D7DD141147\n for <dev@dpdk.org>; Wed, 17 Aug 2022 10:04:30 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 17 Aug 2022 01:04:30 -0700",
            "from silpixa00399302.ir.intel.com ([10.237.214.136])\n by orsmga004.jf.intel.com with ESMTP; 17 Aug 2022 01:04:29 -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=1660723471; x=1692259471;\n h=from:to:cc:subject:date:message-id:in-reply-to: references;\n bh=kXyAsGJVAWAjAcioPPGtGAvWsVOjpUUKuunwvUFfOeE=;\n b=fy8aOI1GwsCJ7FmGbzC1NnqynPCa8Cv7rFAGJNQGmUHNCEjRm4fdPx1Q\n aa3ihq4V1duB4+KCj2lpAJsFAEzbLyf2+fgpOOQnGugNqRVCfQAx2U4l6\n 8l5y4ikAXGqzXGCi26DSycv7487hEHfqRUr2fmA4E7/7eg518oACEoUSy\n ZW+/guesbSKeSYGHi4f+abju2KmnvsQ1dzfA7FPHTUWNeWFM9VWMTIlZE\n JwonqTR9WsZwHHZKZp9Y7xeDqw5LiwSYibhCHQcfNhjatpnApNAaaM4f+\n 1C9T09gUu9E9qbJ6OAHZAkqEDFoRGa9pcpXKzZqcOHtj0YESaVSJcVe/t w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10441\"; a=\"354176555\"",
            "E=Sophos;i=\"5.93,242,1654585200\"; d=\"scan'208\";a=\"354176555\"",
            "E=Sophos;i=\"5.93,242,1654585200\"; d=\"scan'208\";a=\"733595835\""
        ],
        "X-ExtLoop1": "1",
        "From": "Arek Kusztal <arkadiuszx.kusztal@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "gakhil@marvell.com, kai.ji@intel.com,\n Arek Kusztal <arkadiuszx.kusztal@intel.com>",
        "Subject": "[PATCH 2/3] crypto/qat: add ecdh key exchange algorithm",
        "Date": "Wed, 17 Aug 2022 07:55:35 +0100",
        "Message-Id": "<20220817065536.79716-3-arkadiuszx.kusztal@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20220817065536.79716-1-arkadiuszx.kusztal@intel.com>",
        "References": "<20220817065536.79716-1-arkadiuszx.kusztal@intel.com>",
        "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 ECDH algorithm to Intel QuickAssist\nTechnology driver.\n\nSigned-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>\n---\n drivers/crypto/qat/qat_asym.c | 94 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 94 insertions(+)",
    "diff": "diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c\nindex 374452020a..34fb3f5a45 100644\n--- a/drivers/crypto/qat/qat_asym.c\n+++ b/drivers/crypto/qat/qat_asym.c\n@@ -760,6 +760,95 @@ ecpm_collect(struct rte_crypto_asym_op *asym_op,\n }\n \n static int\n+ecdh_set_input(struct icp_qat_fw_pke_request *qat_req,\n+\t\tstruct qat_asym_op_cookie *cookie,\n+\t\tconst struct rte_crypto_asym_op *asym_op,\n+\t\tconst struct 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_ecpm_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+\tif (asym_op->ecdh.ke_type == RTE_CRYPTO_ASYM_KE_PUB_KEY_GENERATE) {\n+\t\tSET_PKE_LN(asym_op->ecdh.priv_key, qat_func_alignsize, 0);\n+\t\tSET_PKE_LN_EC(curve[curve_id], x, 1);\n+\t\tSET_PKE_LN_EC(curve[curve_id], y, 2);\n+\t} else {\n+\t\tSET_PKE_LN(asym_op->ecdh.priv_key, qat_func_alignsize, 0);\n+\t\tSET_PKE_LN(asym_op->ecdh.pub_key.x, qat_func_alignsize, 1);\n+\t\tSET_PKE_LN(asym_op->ecdh.pub_key.y, qat_func_alignsize, 2);\n+\t}\n+\tSET_PKE_LN_EC(curve[curve_id], a, 3);\n+\tSET_PKE_LN_EC(curve[curve_id], b, 4);\n+\tSET_PKE_LN_EC(curve[curve_id], p, 5);\n+\tSET_PKE_LN_EC(curve[curve_id], h, 6);\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\tQAT_ASYM_ECPM_IN_PARAMS;\n+\tqat_req->output_param_count =\n+\t\t\tQAT_ASYM_ECPM_OUT_PARAMS;\n+\n+\tHEXDUMP(\"k\", cookie->input_array[0], qat_func_alignsize);\n+\tHEXDUMP(\"xG\", cookie->input_array[1], qat_func_alignsize);\n+\tHEXDUMP(\"yG\", 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+\tHEXDUMP(\"q\", cookie->input_array[5], qat_func_alignsize);\n+\tHEXDUMP(\"h\", cookie->input_array[6], qat_func_alignsize);\n+\n+\treturn 0;\n+}\n+\n+static uint8_t\n+ecdh_collect(struct rte_crypto_asym_op *asym_op,\n+\t\tconst struct qat_asym_op_cookie *cookie,\n+\t\tconst struct rte_crypto_asym_xform *xform)\n+{\n+\tuint8_t *x, *y;\n+\tuint32_t alg_bytesize = cookie->alg_bytesize;\n+\tuint32_t qat_func_alignsize = cookie->qat_func_alignsize;\n+\tuint32_t ltrim = qat_func_alignsize - alg_bytesize;\n+\n+\tif (asym_op->ecdh.ke_type == RTE_CRYPTO_ASYM_KE_PUB_KEY_GENERATE) {\n+\t\tasym_op->ecdh.pub_key.x.length = alg_bytesize;\n+\t\tasym_op->ecdh.pub_key.y.length = alg_bytesize;\n+\t\tx = asym_op->ecdh.pub_key.x.data;\n+\t\ty = asym_op->ecdh.pub_key.y.data;\n+\t} else {\n+\t\tasym_op->ecdh.shared_secret.x.length = alg_bytesize;\n+\t\tasym_op->ecdh.shared_secret.y.length = alg_bytesize;\n+\t\tx = asym_op->ecdh.shared_secret.x.data;\n+\t\ty = asym_op->ecdh.shared_secret.y.data;\n+\t}\n+\n+\trte_memcpy(x, &cookie->output_array[0][ltrim], alg_bytesize);\n+\trte_memcpy(y, &cookie->output_array[1][ltrim], alg_bytesize);\n+\n+\tHEXDUMP(\"X\", cookie->output_array[0],\n+\t\tqat_func_alignsize);\n+\tHEXDUMP(\"Y\", cookie->output_array[1],\n+\t\tqat_func_alignsize);\n+\treturn RTE_CRYPTO_OP_STATUS_SUCCESS;\n+}\n+\n+static int\n asym_set_input(struct icp_qat_fw_pke_request *qat_req,\n \t\tstruct qat_asym_op_cookie *cookie,\n \t\tconst struct rte_crypto_asym_op *asym_op,\n@@ -781,6 +870,9 @@ asym_set_input(struct icp_qat_fw_pke_request *qat_req,\n \tcase RTE_CRYPTO_ASYM_XFORM_ECPM:\n \t\treturn ecpm_set_input(qat_req, cookie,\n \t\t\t\tasym_op, xform);\n+\tcase RTE_CRYPTO_ASYM_XFORM_ECDH:\n+\t\treturn ecdh_set_input(qat_req, cookie,\n+\t\t\t\tasym_op, xform);\n \tdefault:\n \t\tQAT_LOG(ERR, \"Invalid/unsupported asymmetric crypto xform\");\n \t\treturn -EINVAL;\n@@ -867,6 +959,8 @@ qat_asym_collect_response(struct rte_crypto_op *op,\n \t\treturn ecdsa_collect(asym_op, cookie);\n \tcase RTE_CRYPTO_ASYM_XFORM_ECPM:\n \t\treturn ecpm_collect(asym_op, cookie);\n+\tcase RTE_CRYPTO_ASYM_XFORM_ECDH:\n+\t\treturn ecdh_collect(asym_op, cookie, xform);\n \tdefault:\n \t\tQAT_LOG(ERR, \"Not supported xform type\");\n \t\treturn  RTE_CRYPTO_OP_STATUS_ERROR;\n",
    "prefixes": [
        "2/3"
    ]
}