get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126619,
    "url": "http://patches.dpdk.org/api/patches/126619/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/40827e1b2765526202e3aaf7716a695842891fc7.1682652719.git.gmuthukrishn@marvell.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": "<40827e1b2765526202e3aaf7716a695842891fc7.1682652719.git.gmuthukrishn@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/40827e1b2765526202e3aaf7716a695842891fc7.1682652719.git.gmuthukrishn@marvell.com",
    "date": "2023-04-28T09:28:19",
    "name": "[v1,1/3] cryptodev: add SM2 asymmetric crypto algorithm",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d0d91f7e5bc368013c3f2bc67dd121b441ab95a2",
    "submitter": {
        "id": 2301,
        "url": "http://patches.dpdk.org/api/people/2301/?format=api",
        "name": "Gowrishankar Muthukrishnan",
        "email": "gmuthukrishn@marvell.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/40827e1b2765526202e3aaf7716a695842891fc7.1682652719.git.gmuthukrishn@marvell.com/mbox/",
    "series": [
        {
            "id": 27898,
            "url": "http://patches.dpdk.org/api/series/27898/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27898",
            "date": "2023-04-28T09:28:18",
            "name": "SM2 crypto algorithm support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/27898/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/126619/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/126619/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 4A06A42A12;\n\tFri, 28 Apr 2023 11:28:38 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2C24B42DAA;\n\tFri, 28 Apr 2023 11:28:35 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 6D8E642DA4\n for <dev@dpdk.org>; Fri, 28 Apr 2023 11:28:33 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 33S4F4uW030886; Fri, 28 Apr 2023 02:28:32 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3q85x617xg-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Fri, 28 Apr 2023 02:28:32 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Fri, 28 Apr 2023 02:28:30 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Fri, 28 Apr 2023 02:28:30 -0700",
            "from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.175.191])\n by maili.marvell.com (Postfix) with ESMTP id 981145B6930;\n Fri, 28 Apr 2023 02:28:28 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=Ylc8MJGH/yrvh3NcNGUQJntd2c1sMC5L3ElzzvLJ7kA=;\n b=cV7KxGmX3YcwuGRQk3PD/MU/JeRWYaiR9AvzOvpokCtwsQMa0NKz+bbqAqQK5sK+I47m\n JwarNNPzcC/noFJS8xJUmMpxUryGkrcJB5BspF9t7ULrazvRSX4bwvyIXr+iYl6L6Uc9\n zdGku2X6pbjqSQ498ipRY/SVeTR0FzeJ8zWe/nEe4jIJUSEnI4xfx623npNUtJPbov/b\n FR16T7viNqMYoAG9TUOIRWoRkpEZlgmWkB/os58hjwKvwiURIuKWp2XnSHykjoLZz8jx\n QCiv810YCOqoUrToztUmO4YYnmnBrV42a3zrddrGvySI7OYTBlZ15tvtcDjwA0tjQU4H MA==",
        "From": "Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<anoobj@marvell.com>, Akhil Goyal <gakhil@marvell.com>, Fan Zhang\n <fanzhang.oss@gmail.com>, Gowrishankar Muthukrishnan\n <gmuthukrishn@marvell.com>",
        "Subject": "[v1, 1/3] cryptodev: add SM2 asymmetric crypto algorithm",
        "Date": "Fri, 28 Apr 2023 14:58:19 +0530",
        "Message-ID": "\n <40827e1b2765526202e3aaf7716a695842891fc7.1682652719.git.gmuthukrishn@marvell.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<cover.1682652719.git.gmuthukrishn@marvell.com>",
        "References": "<cover.1682652719.git.gmuthukrishn@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "U3aL_JZTrlbp46T4HoJhy3XfSQk0b-Ps",
        "X-Proofpoint-ORIG-GUID": "U3aL_JZTrlbp46T4HoJhy3XfSQk0b-Ps",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22\n definitions=2023-04-28_04,2023-04-27_01,2023-02-09_01",
        "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": "ShangMi 2 (SM2) is a encryption and digital signatture algorithm\nused in the Chinese National Standard.\n\nSigned-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>\n---\n doc/guides/cryptodevs/features/default.ini |  1 +\n doc/guides/rel_notes/release_23_07.rst     |  3 +\n lib/cryptodev/rte_crypto_asym.h            | 76 ++++++++++++++++++++++\n lib/cryptodev/rte_cryptodev.c              |  1 +\n 4 files changed, 81 insertions(+)",
    "diff": "diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini\nindex 523da0cfa8..a69967bb9e 100644\n--- a/doc/guides/cryptodevs/features/default.ini\n+++ b/doc/guides/cryptodevs/features/default.ini\n@@ -125,6 +125,7 @@ Diffie-hellman          =\n ECDSA                   =\n ECPM                    =\n ECDH                    =\n+SM2                     =\n \n ;\n ; Supported Operating systems of a default crypto driver.\ndiff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst\nindex a9b1293689..b920840038 100644\n--- a/doc/guides/rel_notes/release_23_07.rst\n+++ b/doc/guides/rel_notes/release_23_07.rst\n@@ -55,6 +55,9 @@ New Features\n      Also, make sure to start the actual text at the margin.\n      =======================================================\n \n+* **Added SM2 algorithm in cryptodev library.**\n+\n+  Added SM2 algorithm with prime field curve support.\n \n Removed Items\n -------------\ndiff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h\nindex 989f38323f..c91a8dee4d 100644\n--- a/lib/cryptodev/rte_crypto_asym.h\n+++ b/lib/cryptodev/rte_crypto_asym.h\n@@ -119,6 +119,8 @@ enum rte_crypto_asym_xform_type {\n \t/**< Elliptic Curve Point Multiplication */\n \tRTE_CRYPTO_ASYM_XFORM_ECFPM,\n \t/**< Elliptic Curve Fixed Point Multiplication */\n+\tRTE_CRYPTO_ASYM_XFORM_SM2,\n+\t/**< ShangMi 2. Performs Encrypt, Decrypt, Sign and Verify. */\n \tRTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END\n \t/**< End of list */\n };\n@@ -382,6 +384,20 @@ struct rte_crypto_ec_xform {\n \t/**< Pre-defined ec groups */\n };\n \n+/**\n+ * Asymmetric SM2 transform data\n+ *\n+ * Structure describing SM2 xform params\n+ *\n+ */\n+struct rte_crypto_sm2_xform {\n+\trte_crypto_uint pkey;\n+\t/**< Private key of the signer for signature generation */\n+\n+\tstruct rte_crypto_ec_point q;\n+\t/**< Public key of the signer for verification */\n+};\n+\n /**\n  * Operations params for modular operations:\n  * exponentiation and multiplicative inverse\n@@ -637,9 +653,68 @@ struct rte_crypto_asym_xform {\n \t\t/**< EC xform parameters, used by elliptic curve based\n \t\t * operations.\n \t\t */\n+\n+\t\tstruct rte_crypto_sm2_xform sm2;\n+\t\t/**< SM2 xform parameters */\n \t};\n };\n \n+/**\n+ * SM2 operation params\n+ */\n+struct rte_crypto_sm2_op_param {\n+\tenum rte_crypto_asym_op_type op_type;\n+\t/**< Signature generation or verification */\n+\n+\trte_crypto_param message;\n+\t/**<\n+\t * Pointer to input data\n+\t * - to be encrypted for SM2 public encrypt.\n+\t * - to be signed for SM2 sign generation.\n+\t * - to be authenticated for SM2 sign verification.\n+\t *\n+\t * Pointer to output data\n+\t * - for SM2 private decrypt.\n+\t * In this case the underlying array should have been\n+\t * allocated with enough memory to hold plaintext output\n+\t * (atleast encrypted text length). The message.length field\n+\t * will be overwritten by the PMD with the decrypted length.\n+\t */\n+\n+\trte_crypto_param cipher;\n+\t/**<\n+\t * Pointer to input data\n+\t * - to be decrypted for SM2 private decrypt.\n+\t *\n+\t * Pointer to output data\n+\t * - for SM2 public encrypt.\n+\t * In this case the underlying array should have been allocated\n+\t * with enough memory to hold ciphertext output (atleast X bytes\n+\t * for prime field curve of N bytes and for message M bytes,\n+\t * where X = (C1 + C2 + C3) and computed based on SM2 RFC as\n+\t * C1 (1 + N + N), C2 = M, C3 = N. The cipher.length field will\n+\t * be overwritten by the PMD with the encrypted length.\n+\t */\n+\n+\trte_crypto_uint id;\n+\t/**< The SM2 id used by signer and verifier and is in interval\n+\t * (1, n-1).\n+\t */\n+\n+\trte_crypto_uint r;\n+\t/**< r component of elliptic curve signature\n+\t *     output : for signature generation (of atleast N bytes\n+\t *              where prime field length is N bytes)\n+\t *     input  : for signature verification\n+\t */\n+\trte_crypto_uint s;\n+\t/**< s component of elliptic curve signature\n+\t *     output : for signature generation (of atleast N bytes\n+\t *              where prime field length is N bytes)\n+\t *     input  : for signature verification\n+\t */\n+};\n+\n /**\n  * Asymmetric Cryptographic Operation.\n  *\n@@ -665,6 +740,7 @@ struct rte_crypto_asym_op {\n \t\tstruct rte_crypto_dsa_op_param dsa;\n \t\tstruct rte_crypto_ecdsa_op_param ecdsa;\n \t\tstruct rte_crypto_ecpm_op_param ecpm;\n+\t\tstruct rte_crypto_sm2_op_param sm2;\n \t};\n \tuint16_t flags;\n \t/**<\ndiff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c\nindex a96114b2da..fd7b6b92b5 100644\n--- a/lib/cryptodev/rte_cryptodev.c\n+++ b/lib/cryptodev/rte_cryptodev.c\n@@ -282,6 +282,7 @@ const char *rte_crypto_asym_xform_strings[] = {\n \t[RTE_CRYPTO_ASYM_XFORM_DSA]\t= \"dsa\",\n \t[RTE_CRYPTO_ASYM_XFORM_ECDSA]\t= \"ecdsa\",\n \t[RTE_CRYPTO_ASYM_XFORM_ECPM]\t= \"ecpm\",\n+\t[RTE_CRYPTO_ASYM_XFORM_SM2]\t= \"sm2\",\n };\n \n /**\n",
    "prefixes": [
        "v1",
        "1/3"
    ]
}