From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 57C9342B22; Tue, 16 May 2023 14:10:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2AED742D16; Tue, 16 May 2023 14:10:17 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id A6DEB42D17 for ; Tue, 16 May 2023 14:10:14 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34G7Fjbf020505; Tue, 16 May 2023 05:10:13 -0700 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2172.outbound.protection.outlook.com [104.47.59.172]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3qkvbmk511-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 05:10:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dTCia+sZvOdzxPiMP6aG8rsC0AOBWqsXLxgYjzkuCplYoAxljCsQNBy10Rw+IDzwEwXy4cNSxBYIRjEtIx2aY0V4GkTbj61dFL+vgd+A5ou/iLEbIn8TPwSUpJ6yh+jOkb9foxKl2vSpNtk3M8BzGZcYUiTKncmIuqGPzUG2veoXdq5ST5zgHiOvBZGt4SqRUUpz8CTGszgPEKBBRnvhH3qORMqCKbitBt5Tou7UR0Yo/O405eGLKLnI1uD1ms+55NjmZfOS0s4riG2/WTmMTYekSi2Ne5SScG4Q/JSkPrCLWAwCX7DsA+nARFJ16wU1PCrzhHq/0d1GTTVoTpAtWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R1AdPUUzF4Kw50RiCdAzSySJVyDl14v3XOI27ECsPkM=; b=AiVOEyh8mVWSiQK8XLXO1idF0kmsfI0hhqwi+eHALVR4oYGaq5tTQA66WaICu/F0aKsB9T9nKkcBpyJlolSbjsjECGcq7dl4JC8YqsBzLfTel5dhN//buPKcAJg5NiL5VQrNjnRYUafqSVcpLjl9buhLTzb5qlptTFdZq8rU4uxFI0N4MTnSVrH35PG9In7sWZ4cWSrCdG/sYQ2NzX3kDZ8PwONHbp9zZPu5Uj6q4KwFefCvAQadDP6M021OmYeigvgn2GNK2QefBTd1Wl10ub7/LhENs9NCVR84CTlyQFOfxk3AgAN71dYMDd0YVMBqk5KxFtzMjUVDyfZ/6wu6+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R1AdPUUzF4Kw50RiCdAzSySJVyDl14v3XOI27ECsPkM=; b=k9vyUx6ETky2TtanNv70zddY3dosdn9TNf38BxyKpkN5iYMfu3POVpZZLdXfWfVG16J2rdVJuPYmigeA4OX8Qd9r/jxz51haoPeCkuAri32gStGF0N8m7lh2uDtJ5M+1nq+mam/YlSB+FWBGrbGcIEiyYdONRl2UePeLbj4jxsU= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO6PR18MB4051.namprd18.prod.outlook.com (2603:10b6:5:34e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 12:10:08 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::831b:85d2:9a45:8489]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::831b:85d2:9a45:8489%6]) with mapi id 15.20.6387.033; Tue, 16 May 2023 12:10:08 +0000 From: Akhil Goyal To: Gowrishankar Muthukrishnan , "dev@dpdk.org" CC: Anoob Joseph , Fan Zhang , Gowrishankar Muthukrishnan , Kai Ji , "ciara.power@intel.com" Subject: RE: [v1, 2/3] test/test_cryptodev_asym: add SM2 tests Thread-Topic: [v1, 2/3] test/test_cryptodev_asym: add SM2 tests Thread-Index: AQHZebPRu43YkEscAk2UCf++QI31YK9c5ciw Date: Tue, 16 May 2023 12:10:08 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-dg-rorf: true x-dg-ref: =?us-ascii?Q?PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNcZ2FraGlsXGFw?= =?us-ascii?Q?cGRhdGFccm9hbWluZ1wwOWQ4NDliNi0zMmQzLTRhNDAtODVlZS02Yjg0YmEy?= =?us-ascii?Q?OWUzNWJcbXNnc1xtc2ctOTc0MjI3ZDEtZjNlMi0xMWVkLWEwOTMtOTRlNmY3?= =?us-ascii?Q?NjYxOTA3XGFtZS10ZXN0XDk3NDIyN2QyLWYzZTItMTFlZC1hMDkzLTk0ZTZm?= =?us-ascii?Q?NzY2MTkwN2JvZHkudHh0IiBzej0iMjMwNzciIHQ9IjEzMzI4NzEyNjA1NjM0?= =?us-ascii?Q?NTkyMyIgaD0iKzNta2YrTFVESTFLVlIxN2VVYnIrMFo3K1hRPSIgaWQ9IiIg?= =?us-ascii?Q?Ymw9IjAiIGJvPSIxIiBjaT0iY0FBQUFFUkhVMVJTUlVGTkNnVUFBTWdNQUFC?= =?us-ascii?Q?RG9iaFo3NGZa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08db56067df5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YHfnP463pqVOtrxM+238EbEesVeQAvkg+EWvWrhJQ/+zi1IDYmHbDbMXyZ3GyAfxW+PPSvESNVjtGg/pLM0KI1jU5Y6jijSbtlGG+ui7/EFfBAdc0Y3VmXFyZv05bSBBtoHQT5twKBPQQPu0Z9Vg4EeQQPw0arYSXObY7EY2G6JoJ9LYNqJT8k4SZo7o6C4681AzH5i+iDCw11nOxms6Dk2S48YrZmE47WcbUe8YtIsg5YkH+MX865R4lEbROElo0cWb/JnZ7N99CW3rpS4l+vWk9HXqbcb5awRKuQyqsNdu/ZJH6h/StwYMUb9GHa5uyrLlnuc5hLSxoxDvsbyf9lJkv7lnc8Rq+vychnQWByADC7Xu2wTp3A50enZI2f6l8JhIwkrDa8+b+8ttGQBsCVenfOVS6okEu/SNo0YGiEj579YO/Ovpy65z2Yen3CL78ODHrWlb85RHJbPgdRoRRNYKky1XruxIa1fbuFrZaPjeaHedGOU9QIUVhn9a5DB7187xuFQzmRuNpL0pN3Z+AqV99meM2xRSCjiaERVyE3/dXor9X5+DDV8q2aWFNrFmLkrq3j/M6SSB8R6VuXXOje0tBJdSbIlDwY2/PWBn+eJ13rcLRxOwUX9HS/RQxEKf x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(376002)(39860400002)(136003)(396003)(346002)(451199021)(71200400001)(55016003)(122000001)(38100700002)(26005)(186003)(83380400001)(9686003)(55236004)(33656002)(2906002)(8676002)(6506007)(41300700001)(30864003)(52536014)(5660300002)(8936002)(110136005)(38070700005)(478600001)(7696005)(66556008)(66446008)(76116006)(66946007)(66476007)(64756008)(316002)(54906003)(4326008)(86362001)(579004)(559001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gui/T/pSYtxbpWynaN5g2JEBan+EARrldl4dxB+UlB3QO3DhD6ZikJoyZOeA?= =?us-ascii?Q?cSc5/YSpYMevMe2Q6lHBAUEDph6r6VY0rqusYo6/0HZPb/ofvwdBOO7RS8gg?= =?us-ascii?Q?zku2kF1leOy9kGhy0RmCZNpiDikXsdF2Oq9WUkOlY3h7Qvp5MflscbXBUxcb?= =?us-ascii?Q?SWUnlma8gW2+cSMQ7cfQ903rTyziAeTbUSD6if9zLmaDJKSawyKfDXBUsjhe?= =?us-ascii?Q?jRxtJbCcWcHcAXgPcXMlxZEQvCzECKEQCG4MGi+yrkADVOO3xBqMpU3ntBhT?= =?us-ascii?Q?pNWDYC08UJDWpvBFOH22okPTtAb8RIgmyIOpCdOjpVye9xSNhAjqFQze4gfm?= =?us-ascii?Q?hiRPmafyXbIVX/4jMiQ1N5QD/tQzBa5P1MKG6EyKPXd2592p5pNmW3CsITXN?= =?us-ascii?Q?GHUgz3NI31lIKTH5FEQ8UhFFkrZscpYWX//UyWH636a2P+Aelmd6Xnh3tGPC?= =?us-ascii?Q?F2q2W4/xPMy5ClPadZ7BPu+7eYNZU7WaBXMjT0BsldGDA0eN2C1ucd8oDn57?= =?us-ascii?Q?be69OqpH3COUaQzoGl0+a+/Ur+4oYt7uq6LnAKhmY0yOqqkRfnH8DD8PiBuS?= =?us-ascii?Q?FwEeey/Iy9IKY1KEiXciFTXB5rhJRdCVOGo637gSAJG5F2jmvyM+b96rRbIt?= =?us-ascii?Q?FrwFpsyq9DxebB/rgoGmxfshSxMDwZMTmoASVGfJJyC0QiEETKOD6GmuoQGq?= =?us-ascii?Q?FdJHEmTpq2+rRDeSEXImnj56PLJHT/4UBX0stILpl9fJ3/8ZCnxluVUFfLTm?= =?us-ascii?Q?mft/9P5BKZ9KU5bKCoumKSDwcu7rlHWHgy4s51WSku4/SnX+dW/Ir/u5cJ9N?= =?us-ascii?Q?xlBDlmk6XtIa6nLWcEqNhUJheWQyHvjATbcpnPRXfik04mpp1R2ZmFnrFuQw?= =?us-ascii?Q?tanvhgVuRirp11L7opS2JCjUhp3BP2zn9UC3IHQalU+zN+urZ7YPQwOKK7Eg?= =?us-ascii?Q?NW2pYcgYZ7d98rHbAbTzfESVceh7aivTGPRlcIxr1b1gjxUfWJQhdPtAf6yE?= =?us-ascii?Q?GxE3S1JR6BlXZS8Fnd/Hmb8DTJMIPA6fwSkZHJSJqLMeVIXsc0Hs3xv9JTOh?= =?us-ascii?Q?b65dutOug+m9WaNdzgYluP/ExcTINnb4Mw2pXxReNUfVfJyhfJcGHv60jJb8?= =?us-ascii?Q?c6qnQGF5JXptlBqfjZ1/DI/3/b0GBnyVBXJTGnCQ/nc35LDxkWfK34M5Su6c?= =?us-ascii?Q?2YHu7XPwptBj2GZwnzxWVfF37Q1xwYIWljWYX5E3JpvEJ0dtS8z8SZgZcQ1D?= =?us-ascii?Q?Erw3WsKyBpwpKImoqwx7g903yF8LMgVbDObxwToOGJ/A+n2JOehXBJ8zpRss?= =?us-ascii?Q?Lb6uWQu+7FbuuRcOtgDnpBeiuQl8zOybTbo5vfj8M4tLDyL06R7n0Aq3ZP+m?= =?us-ascii?Q?VPS78pbzl2l+cCwjebb17q0xwoClYQnMRFEvuuAfS3/K5ftM6++Eg8cDE5pH?= =?us-ascii?Q?3nI/6QNfiTsJr639+SKLw5CsnKkNnQQfyTqAp8x34idvnVitaxgKb5b6DQru?= =?us-ascii?Q?wmHu9XugBHUoRku35wQNyIAV+35iG2V27LvXjUxYYTSC5ToNk2L9GH6hU+sR?= =?us-ascii?Q?5kJvsVUDM/SYx7q77rQ+/t41gggAH7GEdgJ+/5Za?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b6a365d-ba87-42e9-3c5e-08db56067df5 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2023 12:10:08.5696 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: C5xpo3ehhK+2quJ+IlgN6qjc2R8zYS6UXLK1mGvBvOWkJp+K1Zil72W+8pHo8O3xbZoffUxZeKd8HJvUSu5wZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR18MB4051 X-Proofpoint-GUID: A2uuEiU-e2WuK7lRTnMLb9PiXHpg71V8 X-Proofpoint-ORIG-GUID: A2uuEiU-e2WuK7lRTnMLb9PiXHpg71V8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-16_05,2023-05-16_01,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Gowri, > Subject: [v1, 2/3] test/test_cryptodev_asym: add SM2 tests >=20 Title should be test/crypto: add asymmetric SM2 cases > Add SM2 tests. Added test cases and test vectors for asymmetric SM2 crypto verification. Cases are added for sign/verify/encrypt/decrypt. If you have the reference from where the vectors are taken it can also be m= entioned. >=20 > Signed-off-by: Gowrishankar Muthukrishnan > --- > app/test/test_cryptodev_asym.c | 506 +++++++++++++++++++++ > app/test/test_cryptodev_sm2_test_vectors.h | 120 +++++ > 2 files changed, 626 insertions(+) > create mode 100644 app/test/test_cryptodev_sm2_test_vectors.h >=20 > diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asy= m.c > index 9236817650..bfaeedee27 100644 > --- a/app/test/test_cryptodev_asym.c > +++ b/app/test/test_cryptodev_asym.c > @@ -21,6 +21,7 @@ > #include "test_cryptodev_ecpm_test_vectors.h" > #include "test_cryptodev_mod_test_vectors.h" > #include "test_cryptodev_rsa_test_vectors.h" > +#include "test_cryptodev_sm2_test_vectors.h" > #include "test_cryptodev_asym_util.h" > #include "test.h" >=20 > @@ -2196,6 +2197,507 @@ test_ecpm_all_curve(void) > return overall_status; > } >=20 > +static int > +test_sm2_sign(void) > +{ > + struct crypto_testsuite_params_asym *ts_params =3D &testsuite_params; > + struct crypto_testsuite_sm2_params input_params =3D > sm2_param_fp256; > + struct rte_mempool *sess_mpool =3D ts_params->session_mpool; > + struct rte_mempool *op_mpool =3D ts_params->op_mpool; > + uint8_t dev_id =3D ts_params->valid_devs[0]; > + struct rte_crypto_op *result_op =3D NULL; > + uint8_t output_buf_r[TEST_DATA_SIZE]; > + uint8_t output_buf_s[TEST_DATA_SIZE]; > + struct rte_crypto_asym_xform xform; > + struct rte_crypto_asym_op *asym_op; > + struct rte_cryptodev_info dev_info; > + struct rte_crypto_op *op =3D NULL; > + int ret, status =3D TEST_SUCCESS; > + void *sess =3D NULL; > + > + rte_cryptodev_info_get(dev_id, &dev_info); dev_info is being unused. Not checking for capabilities? > + > + /* Setup crypto op data structure */ > + op =3D rte_crypto_op_alloc(op_mpool, > RTE_CRYPTO_OP_TYPE_ASYMMETRIC); > + if (op =3D=3D NULL) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to allocate asymmetric crypto " > + "operation struct\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + asym_op =3D op->asym; > + > + /* Setup asym xform */ > + xform.next =3D NULL; > + xform.xform_type =3D RTE_CRYPTO_ASYM_XFORM_SM2; > + xform.sm2.pkey.data =3D input_params.pkey.data; > + xform.sm2.pkey.length =3D input_params.pkey.length; > + xform.sm2.q.x.data =3D input_params.pubkey_qx.data; > + xform.sm2.q.x.length =3D input_params.pubkey_qx.length; > + xform.sm2.q.y.data =3D input_params.pubkey_qy.data; > + xform.sm2.q.y.length =3D input_params.pubkey_qy.length; > + > + ret =3D rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, > &sess); > + if (ret < 0) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Session creation failed\n"); > + status =3D (ret =3D=3D -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED; > + goto exit; > + } > + > + /* Attach asymmetric crypto session to crypto operations */ > + rte_crypto_op_attach_asym_session(op, sess); > + > + /* Compute sign */ > + > + /* Populate op with operational details */ > + op->asym->sm2.op_type =3D RTE_CRYPTO_ASYM_OP_SIGN; > + op->asym->sm2.message.data =3D input_params.message.data; > + op->asym->sm2.message.length =3D input_params.message.length; > + op->asym->sm2.id.data =3D input_params.id.data; > + op->asym->sm2.id.length =3D input_params.id.length; > + > + /* Init out buf */ > + op->asym->sm2.r.data =3D output_buf_r; > + op->asym->sm2.s.data =3D output_buf_s; > + > + RTE_LOG(DEBUG, USER1, "Process ASYM operation\n"); > + > + /* Process crypto operation */ > + if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) !=3D 1) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Error sending packet for operation\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + while (rte_cryptodev_dequeue_burst(dev_id, 0, &result_op, 1) =3D=3D 0) > + rte_pause(); Shouldn't this be a finite loop and mark test as failed after some retries? > + > + if (result_op =3D=3D NULL) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to process asym crypto op\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + if (result_op->status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to process asym crypto op\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + asym_op =3D result_op->asym; > + > + debug_hexdump(stdout, "r:", > + asym_op->sm2.r.data, asym_op->sm2.r.length); > + debug_hexdump(stdout, "s:", > + asym_op->sm2.s.data, asym_op->sm2.s.length); > + > + /* Verify sign (in roundtrip) */ > + > + /* Populate op with operational details */ > + op->asym->sm2.op_type =3D RTE_CRYPTO_ASYM_OP_VERIFY; > + > + /* Enqueue sign result for verify */ > + if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) !=3D 1) { > + status =3D TEST_FAILED; > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Error sending packet for operation\n"); > + goto exit; > + } > + > + while (rte_cryptodev_dequeue_burst(dev_id, 0, &result_op, 1) =3D=3D 0) > + rte_pause(); > + > + if (result_op =3D=3D NULL) { > + status =3D TEST_FAILED; > + goto exit; > + } > + if (result_op->status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > + status =3D TEST_FAILED; > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "SM2 verify failed.\n"); > + goto exit; > + } > + > +exit: > + if (sess !=3D NULL) > + rte_cryptodev_asym_session_free(dev_id, sess); > + rte_crypto_op_free(op); > + return status; > +}; > + > +static int > +test_sm2_verify(void) > +{ > + struct crypto_testsuite_params_asym *ts_params =3D &testsuite_params; > + struct crypto_testsuite_sm2_params input_params =3D > sm2_param_fp256; > + struct rte_mempool *sess_mpool =3D ts_params->session_mpool; > + struct rte_mempool *op_mpool =3D ts_params->op_mpool; > + uint8_t dev_id =3D ts_params->valid_devs[0]; > + struct rte_crypto_op *result_op =3D NULL; > + struct rte_crypto_asym_xform xform; > + struct rte_cryptodev_info dev_info; > + struct rte_crypto_op *op =3D NULL; > + int ret, status =3D TEST_SUCCESS; > + void *sess =3D NULL; > + > + rte_cryptodev_info_get(dev_id, &dev_info); > + > + /* Setup crypto op data structure */ > + op =3D rte_crypto_op_alloc(op_mpool, > RTE_CRYPTO_OP_TYPE_ASYMMETRIC); > + if (op =3D=3D NULL) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to allocate asymmetric crypto " > + "operation struct\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + /* Setup asym xform */ > + xform.next =3D NULL; > + xform.xform_type =3D RTE_CRYPTO_ASYM_XFORM_SM2; > + xform.sm2.q.x.data =3D input_params.pubkey_qx.data; > + xform.sm2.q.x.length =3D input_params.pubkey_qx.length; > + xform.sm2.q.y.data =3D input_params.pubkey_qy.data; > + xform.sm2.q.y.length =3D input_params.pubkey_qy.length; > + > + ret =3D rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, > &sess); > + if (ret < 0) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Session creation failed\n"); > + status =3D (ret =3D=3D -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED; > + goto exit; > + } > + > + /* Attach asymmetric crypto session to crypto operations */ > + rte_crypto_op_attach_asym_session(op, sess); > + > + /* Verify given sign */ > + > + /* Populate op with operational details */ > + op->asym->sm2.op_type =3D RTE_CRYPTO_ASYM_OP_VERIFY; > + op->asym->sm2.message.data =3D input_params.message.data; > + op->asym->sm2.message.length =3D input_params.message.length; > + op->asym->sm2.r.data =3D input_params.sign_r.data; > + op->asym->sm2.r.length =3D input_params.sign_r.length; > + op->asym->sm2.s.data =3D input_params.sign_s.data; > + op->asym->sm2.s.length =3D input_params.sign_s.length; > + op->asym->sm2.id.data =3D input_params.id.data; > + op->asym->sm2.id.length =3D input_params.id.length; > + > + RTE_LOG(DEBUG, USER1, "Process ASYM operation\n"); > + > + /* Process crypto operation */ > + if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) !=3D 1) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Error sending packet for operation\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + while (rte_cryptodev_dequeue_burst(dev_id, 0, &result_op, 1) =3D=3D 0) > + rte_pause(); > + > + if (result_op =3D=3D NULL) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to process asym crypto op\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + if (result_op->status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to process asym crypto op\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > +exit: > + if (sess !=3D NULL) > + rte_cryptodev_asym_session_free(dev_id, sess); > + rte_crypto_op_free(op); > + return status; > +}; > + > +static int > +test_sm2_encrypt(void) > +{ > + struct crypto_testsuite_params_asym *ts_params =3D &testsuite_params; > + struct crypto_testsuite_sm2_params input_params =3D > sm2_param_fp256; > + struct rte_mempool *sess_mpool =3D ts_params->session_mpool; > + struct rte_mempool *op_mpool =3D ts_params->op_mpool; > + uint8_t output_buf[TEST_DATA_SIZE], *pbuf =3D NULL; > + uint8_t dev_id =3D ts_params->valid_devs[0]; > + struct rte_crypto_op *result_op =3D NULL; > + struct rte_crypto_asym_xform xform; > + struct rte_crypto_asym_op *asym_op; > + struct rte_cryptodev_info dev_info; > + struct rte_crypto_op *op =3D NULL; > + int ret, status =3D TEST_SUCCESS; > + void *sess =3D NULL; > + > + rte_cryptodev_info_get(dev_id, &dev_info); > + > + /* Setup crypto op data structure */ > + op =3D rte_crypto_op_alloc(op_mpool, > RTE_CRYPTO_OP_TYPE_ASYMMETRIC); > + if (op =3D=3D NULL) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to allocate asymmetric crypto " > + "operation struct\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + asym_op =3D op->asym; > + > + /* Setup asym xform */ > + xform.next =3D NULL; > + xform.xform_type =3D RTE_CRYPTO_ASYM_XFORM_SM2; > + xform.sm2.pkey.data =3D input_params.pkey.data; > + xform.sm2.pkey.length =3D input_params.pkey.length; > + xform.sm2.q.x.data =3D input_params.pubkey_qx.data; > + xform.sm2.q.x.length =3D input_params.pubkey_qx.length; > + xform.sm2.q.y.data =3D input_params.pubkey_qy.data; > + xform.sm2.q.y.length =3D input_params.pubkey_qy.length; > + > + ret =3D rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, > &sess); > + if (ret < 0) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Session creation failed\n"); > + status =3D (ret =3D=3D -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED; > + goto exit; > + } > + > + /* Attach asymmetric crypto session to crypto operations */ > + rte_crypto_op_attach_asym_session(op, sess); > + > + /* Compute encrypt */ > + > + /* Populate op with operational details */ > + op->asym->sm2.op_type =3D RTE_CRYPTO_ASYM_OP_ENCRYPT; > + op->asym->sm2.message.data =3D input_params.message.data; > + op->asym->sm2.message.length =3D input_params.message.length; > + > + /* Init out buf */ > + op->asym->sm2.cipher.data =3D output_buf; > + > + RTE_LOG(DEBUG, USER1, "Process ASYM operation\n"); > + > + /* Process crypto operation */ > + if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) !=3D 1) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Error sending packet for operation\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + while (rte_cryptodev_dequeue_burst(dev_id, 0, &result_op, 1) =3D=3D 0) > + rte_pause(); > + > + if (result_op =3D=3D NULL) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to process asym crypto op\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + if (result_op->status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to process asym crypto op\n"); > + status =3D TEST_FAILED; > + goto exit; > + } Shouldn't we do content comparison of the cipher text with vectors here as = well? Content is matched only after round trip which will not catch the hardware = bug during encryption. > + > + asym_op =3D result_op->asym; > + > + debug_hexdump(stdout, "cipher:", > + asym_op->sm2.cipher.data, asym_op- > >sm2.cipher.length); > + > + /* Verify cipher (in roundtrip) */ > + > + /* Populate op with operational details */ > + op->asym->sm2.op_type =3D RTE_CRYPTO_ASYM_OP_DECRYPT; > + pbuf =3D rte_malloc(NULL, TEST_DATA_SIZE, 0); > + op->asym->sm2.message.data =3D pbuf; > + op->asym->sm2.message.length =3D TEST_DATA_SIZE; > + > + /* Enqueue cipher result for decrypt */ > + if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) !=3D 1) { > + status =3D TEST_FAILED; > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Error sending packet for operation\n"); > + goto exit; > + } > + > + while (rte_cryptodev_dequeue_burst(dev_id, 0, &result_op, 1) =3D=3D 0) > + rte_pause(); > + > + if (result_op =3D=3D NULL) { > + status =3D TEST_FAILED; > + goto exit; > + } > + if (result_op->status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > + status =3D TEST_FAILED; > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "SM2 encrypt failed.\n"); > + goto exit; > + } > + > + asym_op =3D result_op->asym; > + if (memcmp(input_params.message.data, asym_op- > >sm2.message.data, > + asym_op->sm2.message.length) !=3D 0) { > + status =3D TEST_FAILED; > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "SM2 encrypt failed.\n"); > + goto exit; > + } > +exit: > + if (pbuf !=3D NULL) > + rte_free(pbuf); > + > + if (sess !=3D NULL) > + rte_cryptodev_asym_session_free(dev_id, sess); > + rte_crypto_op_free(op); > + return status; > +}; > + > +static int > +test_sm2_decrypt(void) > +{ > + struct crypto_testsuite_params_asym *ts_params =3D &testsuite_params; > + struct crypto_testsuite_sm2_params input_params =3D > sm2_param_fp256; > + struct rte_mempool *sess_mpool =3D ts_params->session_mpool; > + struct rte_mempool *op_mpool =3D ts_params->op_mpool; > + uint8_t dev_id =3D ts_params->valid_devs[0]; > + struct rte_crypto_op *result_op =3D NULL; > + uint8_t output_buf_m[TEST_DATA_SIZE]; > + struct rte_crypto_asym_xform xform; > + struct rte_crypto_asym_op *asym_op; > + struct rte_cryptodev_info dev_info; > + struct rte_crypto_op *op =3D NULL; > + int ret, status =3D TEST_SUCCESS; > + void *sess =3D NULL; > + > + rte_cryptodev_info_get(dev_id, &dev_info); > + > + /* Setup crypto op data structure */ > + op =3D rte_crypto_op_alloc(op_mpool, > RTE_CRYPTO_OP_TYPE_ASYMMETRIC); > + if (op =3D=3D NULL) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to allocate asymmetric crypto " > + "operation struct\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + asym_op =3D op->asym; > + > + /* Setup asym xform */ > + xform.next =3D NULL; > + xform.xform_type =3D RTE_CRYPTO_ASYM_XFORM_SM2; > + xform.sm2.pkey.data =3D input_params.pkey.data; > + xform.sm2.pkey.length =3D input_params.pkey.length; > + xform.sm2.q.x.data =3D input_params.pubkey_qx.data; > + xform.sm2.q.x.length =3D input_params.pubkey_qx.length; > + xform.sm2.q.y.data =3D input_params.pubkey_qy.data; > + xform.sm2.q.y.length =3D input_params.pubkey_qy.length; > + > + ret =3D rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, > &sess); > + if (ret < 0) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Session creation failed\n"); > + status =3D (ret =3D=3D -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED; > + goto exit; > + } > + > + /* Attach asymmetric crypto session to crypto operations */ > + rte_crypto_op_attach_asym_session(op, sess); > + > + /* Compute decrypt */ > + > + /* Populate op with operational details */ > + op->asym->sm2.op_type =3D RTE_CRYPTO_ASYM_OP_DECRYPT; > + op->asym->sm2.cipher.data =3D input_params.cipher.data; > + op->asym->sm2.cipher.length =3D input_params.cipher.length; > + > + /* Init out buf */ > + op->asym->sm2.message.data =3D output_buf_m; > + op->asym->sm2.message.length =3D RTE_DIM(output_buf_m); > + > + RTE_LOG(DEBUG, USER1, "Process ASYM operation\n"); > + > + /* Process crypto operation */ > + if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) !=3D 1) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Error sending packet for operation\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + while (rte_cryptodev_dequeue_burst(dev_id, 0, &result_op, 1) =3D=3D 0) > + rte_pause(); > + > + if (result_op =3D=3D NULL) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to process asym crypto op\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + if (result_op->status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "Failed to process asym crypto op\n"); > + status =3D TEST_FAILED; > + goto exit; > + } > + > + asym_op =3D result_op->asym; > + > + debug_hexdump(stdout, "message:", > + asym_op->sm2.message.data, asym_op- > >sm2.message.length); > + > + if (memcmp(input_params.message.data, asym_op- > >sm2.message.data, > + op->asym->sm2.message.length)) { > + status =3D TEST_FAILED; > + RTE_LOG(ERR, USER1, > + "line %u FAILED: %s", __LINE__, > + "SM2 decrypt failed.\n"); > + goto exit; > + } > +exit: > + if (sess !=3D NULL) > + rte_cryptodev_asym_session_free(dev_id, sess); > + rte_crypto_op_free(op); > + return status; > +}; > + > static struct unit_test_suite cryptodev_openssl_asym_testsuite =3D { > .suite_name =3D "Crypto Device OPENSSL ASYM Unit Test Suite", > .setup =3D testsuite_setup, > @@ -2205,6 +2707,10 @@ static struct unit_test_suite > cryptodev_openssl_asym_testsuite =3D { > TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_dsa), > TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, > test_dh_keygenration), > + TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, > test_sm2_encrypt), > + TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, > test_sm2_sign), > + TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, > test_sm2_verify), > + TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, > test_sm2_decrypt), > TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, > test_rsa_enc_dec), > TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, > test_rsa_sign_verify), > diff --git a/app/test/test_cryptodev_sm2_test_vectors.h > b/app/test/test_cryptodev_sm2_test_vectors.h > new file mode 100644 > index 0000000000..d70d3ccaa0 > --- /dev/null > +++ b/app/test/test_cryptodev_sm2_test_vectors.h > @@ -0,0 +1,120 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2023 Marvell. > + */ > + > +#ifndef __TEST_CRYPTODEV_SM2_TEST_VECTORS_H__ > +#define __TEST_CRYPTODEV_SM2_TEST_VECTORS_H__ > + > +#include "rte_crypto_asym.h" > + > +struct crypto_testsuite_sm2_params { > + rte_crypto_param pubkey_qx; > + rte_crypto_param pubkey_qy; > + rte_crypto_param pkey; > + rte_crypto_param sign_r; > + rte_crypto_param sign_s; > + rte_crypto_param id; > + rte_crypto_param cipher; > + rte_crypto_param message; > +}; > + > +static uint8_t fp256_pkey[] =3D { > + 0x77, 0x84, 0x35, 0x65, 0x4c, 0x7a, 0x6d, 0xb1, > + 0x1e, 0x63, 0x0b, 0x41, 0x97, 0x36, 0x04, 0xf4, > + 0xec, 0x35, 0xee, 0x3b, 0x76, 0xc2, 0x34, 0x08, > + 0xd9, 0x4a, 0x22, 0x0d, 0x7f, 0xf6, 0xc6, 0x90 > +}; > + > +static uint8_t fp256_qx[] =3D { > + 0x7b, 0x24, 0xa3, 0x03, 0xcf, 0xb2, 0x22, 0xfa, > + 0x4c, 0xb3, 0x88, 0x54, 0xf9, 0x30, 0xd1, 0x4d, > + 0xe3, 0x50, 0xda, 0xba, 0xe6, 0xa7, 0x0b, 0x91, > + 0x4c, 0x04, 0x0d, 0x5c, 0xe0, 0x8e, 0x86, 0xc5 > +}; > + > +static uint8_t fp256_qy[] =3D { > + 0xbc, 0x39, 0xe3, 0x19, 0x4e, 0xd2, 0x29, 0x22, > + 0x5b, 0x37, 0x2d, 0xeb, 0xcc, 0x05, 0x52, 0x8d, > + 0xb9, 0x40, 0xa3, 0xab, 0x3c, 0xbe, 0x16, 0x30, > + 0x1c, 0xe4, 0xe8, 0x7f, 0xba, 0x6e, 0x0b, 0xae > +}; > + > +static uint8_t fp256_sign_r[] =3D { > + 0xf3, 0x26, 0x10, 0xde, 0xfb, 0xbf, 0x13, 0xd4, > + 0x73, 0xb1, 0xc2, 0x80, 0x51, 0x06, 0x29, 0xf9, > + 0xfb, 0xc8, 0x11, 0xa7, 0x8d, 0x2c, 0xcb, 0x09, > + 0x7c, 0xb2, 0xcf, 0x58, 0x0b, 0x5e, 0x25, 0xff > +}; > + > +static uint8_t fp256_sign_s[] =3D { > + 0x8d, 0x8d, 0xb5, 0x40, 0xe3, 0xfb, 0x98, 0xf9, > + 0x8c, 0xe4, 0x58, 0x60, 0xf2, 0x78, 0x8f, 0xd9, > + 0xbf, 0xb8, 0x47, 0x73, 0x88, 0xc1, 0xd1, 0xcd, > + 0x2d, 0xdb, 0xe3, 0xc1, 0x44, 0x30, 0x25, 0x86 > +}; > + > +static uint8_t fp256_id[] =3D { > + 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8 > +}; > + > +static uint8_t fp256_message[] =3D { > + 0x6D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, > + 0x64, 0x69, 0x67, 0x65, 0x73, 0x74 > +}; > + > +static uint8_t fp256_cipher[] =3D { > + 0x30, 0x78, 0x02, 0x21, 0x00, 0xAB, 0xBD, 0xE8, > + 0xE8, 0x80, 0x93, 0x36, 0x77, 0xB6, 0x44, 0x47, > + 0x6D, 0x00, 0xF6, 0x51, 0xC8, 0x80, 0x9C, 0x9E, > + 0xD9, 0xEC, 0x36, 0x8A, 0x60, 0x8E, 0x26, 0x2D, > + 0x71, 0x31, 0xB7, 0xC1, 0x38, 0x02, 0x21, 0x00, > + 0xE1, 0xBF, 0x4C, 0x13, 0x7A, 0x87, 0x40, 0x32, > + 0xF5, 0xA1, 0xE2, 0xA1, 0x3B, 0x83, 0xBF, 0x6B, > + 0x3F, 0xFB, 0xC8, 0x13, 0x01, 0xDE, 0xCF, 0xC0, > + 0xF4, 0x24, 0x66, 0x52, 0x89, 0xDA, 0x6D, 0x7A, > + 0x04, 0x20, 0x8E, 0xFD, 0x52, 0x77, 0xC9, 0xE7, > + 0x90, 0xD1, 0x17, 0x75, 0xDE, 0xEE, 0xF3, 0xE5, > + 0x11, 0x0C, 0x5D, 0xE1, 0x3A, 0xB6, 0x2B, 0x72, > + 0x60, 0xE5, 0xD5, 0xF3, 0x0F, 0xE2, 0x44, 0xDB, > + 0xBC, 0x66, 0x04, 0x0E, 0x78, 0x2D, 0xC0, 0x3D, > + 0x38, 0xA2, 0x42, 0xA4, 0x8E, 0x8B, 0xF5, 0x06, > + 0x32, 0xFA > +}; > + > +/** SM2 Fp256 elliptic curve test params */ > +struct crypto_testsuite_sm2_params sm2_param_fp256 =3D { > + .pubkey_qx =3D { > + .data =3D fp256_qx, > + .length =3D sizeof(fp256_qx), > + }, > + .pubkey_qy =3D { > + .data =3D fp256_qy, > + .length =3D sizeof(fp256_qy), > + }, > + .sign_r =3D { > + .data =3D fp256_sign_r, > + .length =3D sizeof(fp256_sign_r), > + }, > + .sign_s =3D { > + .data =3D fp256_sign_s, > + .length =3D sizeof(fp256_sign_s), > + }, > + .id =3D { > + .data =3D fp256_id, > + .length =3D sizeof(fp256_id), > + }, > + .pkey =3D { > + .data =3D fp256_pkey, > + .length =3D sizeof(fp256_pkey), > + }, > + .message =3D { > + .data =3D fp256_message, > + .length =3D sizeof(fp256_message), > + }, > + .cipher =3D { > + .data =3D fp256_cipher, > + .length =3D sizeof(fp256_cipher), > + } > +}; > + > +#endif /* __TEST_CRYPTODEV_SM2_TEST_VECTORS_H__ */ > -- > 2.25.1