get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 130187,
    "url": "https://patches.dpdk.org/api/patches/130187/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230811173944.2550303-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": "<20230811173944.2550303-1-arkadiuszx.kusztal@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230811173944.2550303-1-arkadiuszx.kusztal@intel.com",
    "date": "2023-08-11T17:39:44",
    "name": "[RFC] cryptodev: refactor sm2, add plain message flag",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "2dfbfc1af15810f27237b86ebacd41a697c86759",
    "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/20230811173944.2550303-1-arkadiuszx.kusztal@intel.com/mbox/",
    "series": [
        {
            "id": 29195,
            "url": "https://patches.dpdk.org/api/series/29195/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29195",
            "date": "2023-08-11T17:39:44",
            "name": "[RFC] cryptodev: refactor sm2, add plain message flag",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/29195/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/130187/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/130187/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 1F38A43036;\n\tFri, 11 Aug 2023 19:39:51 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 10E7240E03;\n\tFri, 11 Aug 2023 19:39:51 +0200 (CEST)",
            "from mgamail.intel.com (mgamail.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id ECDC840144\n for <dev@dpdk.org>; Fri, 11 Aug 2023 19:39:49 +0200 (CEST)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Aug 2023 10:39:48 -0700",
            "from silpixa00400465.ir.intel.com ([10.55.129.105])\n by fmsmga007.fm.intel.com with ESMTP; 11 Aug 2023 10:39:47 -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=1691775590; x=1723311590;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=Xj6muG1ZOhBd8UrYoRVPAB1y7mFiDydzTxSzNi9XxYQ=;\n b=bxVR8re8n7TchbhbODzNPLy8rgA5ahcvgw5E/aqgyqpHoa1vlLoBhFd8\n haJBkRlyuZyONTKOaHPvIvz7yjQKJB7gBGTcq+74OxjV+GUxf9prnVOpH\n p6sAZ6tMDwiiNo8bOt8B7GHK4/qBA2lqXVM5/5gWfVhsYlG1OKtTlt1rK\n q7rAXA/egqXDmFNbTiXMRunPh80o9GwebDx0RlCKma1+YSqOAYVmfvE11\n bWNI45TzI5xYS3tKHkKyv2qo0nCfr2nBdlqhRBN/HE9ZFv1JEGjCTvopb\n BQSoxJ8Z4aU1CJn9w4Db6O17eSG3niYrux+Ico34t3XrnqeByrS7WV+FO A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10799\"; a=\"402701965\"",
            "E=Sophos;i=\"6.01,166,1684825200\"; d=\"scan'208\";a=\"402701965\"",
            "E=McAfee;i=\"6600,9927,10799\"; a=\"735854030\"",
            "E=Sophos;i=\"6.01,166,1684825200\"; d=\"scan'208\";a=\"735854030\""
        ],
        "X-ExtLoop1": "1",
        "From": "Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "gakhil@marvell.com, kai.ji@intel.com, ciara.power@intel.com,\n Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>",
        "Subject": "[RFC] cryptodev: refactor sm2, add plain message flag",
        "Date": "Fri, 11 Aug 2023 17:39:44 +0000",
        "Message-Id": "<20230811173944.2550303-1-arkadiuszx.kusztal@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "SM2 asymmetric crypto operation was split into cipher and\nsignature operation. Now it corresponds to the other crypto\nalgorithms and facilitates addition of other SM2 components\nlike the SM2 key exchange.\n\nFlag to distinguish between a plain message or a hash used\nfor signature was added to the DSA, ECDSA and SM2.\n\nSigned-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>\n---\n lib/cryptodev/rte_crypto_asym.h | 116 +++++++++++++++++---------------\n 1 file changed, 63 insertions(+), 53 deletions(-)",
    "diff": "diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h\nindex 8b5794fb7c..43bdb392c5 100644\n--- a/lib/cryptodev/rte_crypto_asym.h\n+++ b/lib/cryptodev/rte_crypto_asym.h\n@@ -54,6 +54,7 @@ rte_crypto_asym_op_strings[];\n  * and if the flag is not set, shared secret will be padded to the left with\n  * zeros to the size of the underlying algorithm (default)\n  */\n+#define RTE_CRYPTO_ASYM_FLAG_PLAIN_INPUT\t\tRTE_BIT32(2)\n \n /**\n  * List of elliptic curves. This enum aligns with\n@@ -379,16 +380,6 @@ 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-struct rte_crypto_sm2_xform {\n-\tenum rte_crypto_auth_algorithm hash;\n-\t/**< Hash algorithm used in SM2 op. */\n-};\n-\n /**\n  * Operations params for modular operations:\n  * exponentiation and multiplicative inverse\n@@ -540,7 +531,12 @@ struct rte_crypto_dsa_op_param {\n \tenum rte_crypto_asym_op_type op_type;\n \t/**< Signature Generation or Verification */\n \trte_crypto_param message;\n-\t/**< input message to be signed or verified */\n+\t/**<\n+\t * Pointer to the input data\n+\t * In case RTE_CRYPTO_ASYM_FLAG_PLAIN_INPUT flag is set in the op flags field,\n+\t * it is a message to be signed by the PMD.\n+\t * Otherwise, it is a message hash.\n+\t */\n \trte_crypto_uint k;\n \t/**< Per-message secret number, which is an integer\n \t * in the interval (1, q-1).\n@@ -579,7 +575,12 @@ struct rte_crypto_ecdsa_op_param {\n \t/**< Public key of the signer for verification */\n \n \trte_crypto_param message;\n-\t/**< Input message digest to be signed or verified */\n+\t/**<\n+\t * Pointer to the input data\n+\t * In case RTE_CRYPTO_ASYM_FLAG_PLAIN_INPUT flag is set in the op flags field,\n+\t * it is a message to be signed by the PMD.\n+\t * Otherwise, it is a message hash.\n+\t */\n \n \trte_crypto_uint k;\n \t/**< The ECDSA per-message secret number, which is an integer\n@@ -652,52 +653,20 @@ struct rte_crypto_asym_xform {\n \t};\n };\n \n-/**\n- * SM2 operation params.\n- */\n-struct rte_crypto_sm2_op_param {\n+struct rte_crypto_sm2_signature {\n \tenum rte_crypto_asym_op_type op_type;\n \t/**< Signature generation or verification. */\n-\n-\trte_crypto_uint pkey;\n-\t/**< Private key for encryption or sign generation. */\n-\n-\tstruct rte_crypto_ec_point q;\n-\t/**< Public key for decryption 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 * (at least 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 (at least 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 * Pointer to the input data\n+\t * In case RTE_CRYPTO_ASYM_FLAG_PLAIN_INPUT flag is set in the op flags field,\n+\t * it is a message to be signed by the PMD.\n+\t * Otherwise, it is a message hash.\n \t */\n-\n \trte_crypto_uint id;\n-\t/**< The SM2 id used by signer and verifier. */\n-\n+\t/**< The SM2 id used by signer and verifier.\n+\t * In case RTE_CRYPTO_ASYM_FLAG_PLAIN_INPUT flag is set this field is unused.\n+\t */\n \trte_crypto_uint k;\n \t/**< The SM2 per-message secret number, which is an integer\n \t * in the interval (1, n-1).\n@@ -719,6 +688,46 @@ struct rte_crypto_sm2_op_param {\n \t */\n };\n \n+struct rte_crypto_sm2_cipher {\n+\tenum rte_crypto_asym_op_type op_type;\n+\t/**< Ecryption or decryption. */\n+\trte_crypto_param message;\n+\t/**<\n+\t * Pointer to input data\n+\t * - to be encrypted for SM2 public encrypt.\t *\n+\t * Pointer to output data\n+\t * - for SM2 private decrypt.\n+\t */\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 */\n+\trte_crypto_uint k;\n+\t/**< The SM2 per-message secret number, which is an integer\n+\t * in the interval (1, n-1).\n+\t * If the random number is generated by the PMD,\n+\t * the 'rte_crypto_param.data' parameter should be set to NULL.\n+\t */\n+};\n+\n+/*\n+ * Asymmetric SM2 transform data.\n+ *\n+ * Structure describing SM2 xform params.\n+ */\n+struct rte_crypto_sm2_xform {\n+\tenum rte_crypto_auth_algorithm hash;\n+\t/**< Hash algorithm used in SM2 op. */\n+\trte_crypto_uint dA;\n+\t/**< Private key. */\n+\tstruct rte_crypto_ec_point PA;\n+\t/**< Public key. */\n+};\n+\n /**\n  * Asymmetric Cryptographic Operation.\n  *\n@@ -743,7 +752,8 @@ 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\tstruct rte_crypto_sm2_signature sm2_signature;\n+\t\tstruct rte_crypto_sm2_cipher sm2_cipher;\n \t};\n \tuint16_t flags;\n \t/**<\n",
    "prefixes": [
        "RFC"
    ]
}