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 30B1943BDF; Fri, 8 Mar 2024 09:23:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F6ED42EF6; Fri, 8 Mar 2024 09:23:55 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id E8B3B40274; Fri, 8 Mar 2024 09:23:52 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4288Il1A022755; Fri, 8 Mar 2024 00:23:52 -0800 Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3wqkj621sg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 00:23:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e0zgd18MLS2366CorSkHksK/lW6gLlih2rU494VH04/QQKP0DzO44B4pp+H9zcNCSwQbgdGt9tdgaxGO7CvtL7ERY2Ov6I18L54XvbMbzsm8/oYmB0OF+7Symo4yrza7soSHvDx8BAa9OkQooPwDqjXP9MT2OF1lWYBM6I049tiFgXFPovHJp5isVg9vVktijzo6GW4yCngLJZdhsEzfXb2wAlpTTCBXrg7rwP/EqptMZXpTk9xktYpi+YJZqZySvbaavCBH8RW4eNKn8PsSzha8g15BuSXBKhTa0kuqqQCAt8GkWS5fZ5R0qfTiAWvdMmGiu1lHAsi7Ze8gjG46JA== 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=3PKhOgkKV3a97bqkK4fEWhr9ounV+elJt5VtI8DfK3U=; b=bmCeK5BOmQOmKZNmlgnupKP5EahXWaE+UN5TiSjZ8fs2bJlz6ZSQVc8TE27qmM1fQbAyCXJ0f+gb3gtF93hlo8o95QzWhryH4SBiGVctLeKkTELl+rPM/U5w1JBtjoJsmvLZljXPFX1RG/ZmV/p+Ih62Qa5HPPUc5+FO7zprcX3nyThWAP7Hq7LegBY6WSxE+/ziIMIDC+zwQJxkEDw4IYa+cLxRv+9Hxnp3EflbnJYPtKB5ecwFHcj466ESe7hMKvuP+RinxMNJ2Za/GQUY9dFbh0eteXgYMwCbjr8P+M6qz7WDZiPH2r+B8Sru+vYuqJVNDCz1Dkcsq9aG7R3wmw== 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.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3PKhOgkKV3a97bqkK4fEWhr9ounV+elJt5VtI8DfK3U=; b=s5ghzOdSNFuMc+dNH32MGHSq+RqINXpTBNJBybQNF5eTknQHPrdPbL+TwuZWE8nhbXdNZDaRVUDwOsOSh13aa5ckvO5I4B1iuWyeFQ1ZWOvLd1+BO7nBwGfIv4Bjl5x/TXGY2NmpSR+JV1R0b8hy2UgWQO6XrL55PoboUwNA5Kk= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by SN7PR18MB5261.namprd18.prod.outlook.com (2603:10b6:806:2eb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.28; Fri, 8 Mar 2024 08:23:49 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::9345:cddf:24ca:5be9]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::9345:cddf:24ca:5be9%5]) with mapi id 15.20.7362.028; Fri, 8 Mar 2024 08:23:49 +0000 From: Akhil Goyal To: Arkadiusz Kusztal , "dev@dpdk.org" CC: "ciara.power@intel.com" , "stable@dpdk.org" Subject: RE: [EXTERNAL] [PATCH] app/test: fix rsa tests in qat suite Thread-Topic: [EXTERNAL] [PATCH] app/test: fix rsa tests in qat suite Thread-Index: AQHacTEj4tWbc6GL3USiRu4NNlXOr7EtgUOA Date: Fri, 8 Mar 2024 08:23:49 +0000 Message-ID: References: <20240308081750.5157-1-arkadiuszx.kusztal@intel.com> In-Reply-To: <20240308081750.5157-1-arkadiuszx.kusztal@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR18MB4484:EE_|SN7PR18MB5261:EE_ x-ms-office365-filtering-correlation-id: 3de5e2be-888a-44b5-51e4-08dc3f4914cf x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3+TGhurMWqcK7/5KYZmGAYisGqZc/s3AuINkHQtdISBw2wVzZx+UDa9sBNZD+2eyUDMQXt8TIViI8XyeOcrn8hiXlLNXZf4/l7sBySpK+ukmP5JqozfUqBy+S9Jnk8gnoaWMFI/X2SRE4eP/rh+orG5LjlFP2VGnxvo2PfzKQs3aYugr4G+DDGaSD4NbUMLgyvoyLG21mqFFBE0hBFO1/8gQeuNUf62d0QOJvtVZcxZQw9qMY8HiLJKdKnQi9uHCmKoQTmnTjXJR4fUuZH5n5rQ2bE2cb523nQ7O07M+TQ+sS6PCSAfxoGlcmKBx0eY77WEsbiSMe6XVwPYeBBVsKzo/jd3wuJ+m6H/zEKsjj8skzQFGQydmQYzW9B9W5oUrEADVtrVNZ9TmOYons349SUp4W68GgMstV2Wyfcu3vvkHwaB/bYRV2Ap/+FnOqqG0v/Xr4aM1rRsUNVZx6MVlo8JtHLP3F8x/uGW29R/i7slgdTwY9Z64M+QpC2Y+Ek5WO7zIJOK+rB/ijTfivMEXsTuaeprFWerGuHCNYTjQ+W08IsGO62kDubB+E0geflX2y3E9y9roGkTE0DwzXAuWRNDvwz3M9aUEmQMGp19gj0XBCdNQcgH5VP0DwNMLwAlsBJMlx63PXxo2WgS/pvW82gf3YRIMIpwg+ttvo8Bpi18AJbBPhEUNi1cmCzpS7MdHyvOu1VFmQ18VZPr1yv3t4hdgEs+BjhIwKBk8g9X4fYc= 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:(13230031)(376005)(1800799015)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xHMz/BaUUIemjvGYSayxjIq79IzTGvhpA4is0oY+5HSPb6CnEah/a9i89ww/?= =?us-ascii?Q?GMLocWof+I//KiW7cZePq1Rd1vdzvpFGpdjy47uQaPJmuSGmJ5TXAab1t1ZB?= =?us-ascii?Q?LIar2sF56hMpFBJ4Lu8vgneSs3w4gLrrcAmWHK6CenSn45Cwv5/OA2m84Tly?= =?us-ascii?Q?nowa3v5tMIEcjXHWy4pyi2r28xjkbbsJ/HWhmLwC3Vauy3raZwKUxC8VNqBC?= =?us-ascii?Q?DKy5CKbnjhcaA3goxEqOgs7vcI/QK6EV4kg0j8/8NoKiuUrWYiakAlQmU5d0?= =?us-ascii?Q?QIhi6AmW02RtOqr90X8Udv/Ka23gjj40DrCUlJ75SHYhcfshZr8FrBmrKPwE?= =?us-ascii?Q?W99wtsiT33o3AKTI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oF5ga9aMEpnSOsH?= =?us-ascii?Q?v6Ka/eo1qfg52K04jnthVYq9xD9ECh+P3dONqknHVhKcOES4j0e/UkH1rO8k?= =?us-ascii?Q?ilSi3co431+sIVi16ReMds/N5EBboDvHiDIKgBRpIz0QhuQfMg5FmNusuPpd?= =?us-ascii?Q?jH1szYs8Vp3gfdUaS6OkS/31UH2NMlyko/6np81Ov6E8FGeaLfaY2kXfq+sr?= =?us-ascii?Q?aOlb2t9BkIxlp77kxSEvRNinuUyILam3SnQnItBJBOV6ASfFl6pBnnj2yRso?= =?us-ascii?Q?Ubl0LpFpId6d1pHuohyBUIuXGgpvuPlZufhaTlj5by6/SzL/DLJfvqgzyxSZ?= =?us-ascii?Q?bD/2oUS1EIMwaBot8hmaXbpRxjDyXzWbnpjsrHaN?= 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: 3de5e2be-888a-44b5-51e4-08dc3f4914cf X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2024 08:23:49.3550 (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: 1OfL+vs2KYtgKILiKYSBLdC3S2ir4hL06qS8xRlsExfduu++24R1EFpjIJCQ3EqM2+wU5Atlp8T+MGRI+ZaTWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR18MB5261 X-Proofpoint-GUID: keajZs7c9YIdYHhE0fl3XraZlviQ4mQy X-Proofpoint-ORIG-GUID: keajZs7c9YIdYHhE0fl3XraZlviQ4mQy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_06,2024-03-06_01,2023-05-22_02 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 > This commit fixes incorrectly set keys in the > QAT testsuite for the RSA algorithm. >=20 > Fixes: 9b5465867fb8 ("test/crypto: add RSA none padding cases") > Cc: stable@dpdk.org >=20 > Signed-off-by: Arkadiusz Kusztal > --- > app/test/test_cryptodev_asym.c | 74 +++++++++++++++++++++---------------= ---- > -- > 1 file changed, 37 insertions(+), 37 deletions(-) >=20 > diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asy= m.c > index 17daf734e8..241f9c30a0 100644 > --- a/app/test/test_cryptodev_asym.c > +++ b/app/test/test_cryptodev_asym.c > @@ -3292,9 +3292,6 @@ modular_multiplicative_inverse(const void *test_dat= a) > arg.qt.coef.data =3D coef; \ > arg.qt.coef.length =3D vector->coef.len >=20 > -typedef void (*rsa_key_init_t)(struct rte_crypto_asym_xform *, > - const struct rsa_test_data_2 *); > - > static int > RSA_Encrypt(const struct rsa_test_data_2 *vector, uint8_t *cipher_buf) > { > @@ -3335,41 +3332,14 @@ RSA_Decrypt(const struct rsa_test_data_2 *vector, > uint8_t *plaintext, > return 0; > } >=20 > -static void > -RSA_key_init_Exp(struct rte_crypto_asym_xform *xform, > - const struct rsa_test_data_2 *vector) > -{ > - SET_RSA_PARAM(xform->rsa, vector, n); > - SET_RSA_PARAM(xform->rsa, vector, e); > - SET_RSA_PARAM(xform->rsa, vector, d); > - xform->rsa.key_type =3D RTE_RSA_KEY_TYPE_EXP; > -} > - > -static void > -RSA_key_init_CRT(struct rte_crypto_asym_xform *xform, > - const struct rsa_test_data_2 *vector) > -{ > - SET_RSA_PARAM(xform->rsa, vector, n); > - SET_RSA_PARAM(xform->rsa, vector, e); > - SET_RSA_PARAM_QT(xform->rsa, vector, p); > - SET_RSA_PARAM_QT(xform->rsa, vector, q); > - SET_RSA_PARAM_QT(xform->rsa, vector, dP); > - SET_RSA_PARAM_QT(xform->rsa, vector, dQ); > - SET_RSA_PARAM_QT(xform->rsa, vector, qInv); > - xform->rsa.key_type =3D RTE_RSA_KEY_TYPE_QT; > -} > - > static int > -RSA_Init_Session(const struct rsa_test_data_2 *vector, > - rsa_key_init_t key_init) > +RSA_Init_Session(struct rte_crypto_asym_xform *xform) > { > const uint8_t dev_id =3D params->valid_devs[0]; > struct rte_cryptodev_info dev_info; > - struct rte_crypto_asym_xform xform =3D { }; > int ret =3D 0; >=20 > - key_init(&xform, vector); > - xform.xform_type =3D RTE_CRYPTO_ASYM_XFORM_RSA; > + xform->xform_type =3D RTE_CRYPTO_ASYM_XFORM_RSA; >=20 > rte_cryptodev_info_get(dev_id, &dev_info); > if (!(dev_info.feature_flags & > RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT)) { > @@ -3377,7 +3347,7 @@ RSA_Init_Session(const struct rsa_test_data_2 > *vector, > "Device doesn't support decrypt op with quintuple key > type. Test skipped\n"); > return TEST_SKIPPED; > } > - ret =3D rte_cryptodev_asym_session_create(dev_id, &xform, > + ret =3D rte_cryptodev_asym_session_create(dev_id, xform, > params->session_mpool, &self->sess); > if (ret < 0) { > RTE_LOG(ERR, USER1, > @@ -3392,7 +3362,13 @@ KAT_RSA_Encrypt(const void *data) > { > uint8_t cipher_buf[TEST_DATA_SIZE] =3D {0}; > const struct rsa_test_data_2 *vector =3D data; > - int ret =3D RSA_Init_Session(vector, RSA_key_init_Exp); > + struct rte_crypto_asym_xform xform =3D { }; > + > + SET_RSA_PARAM(xform.rsa, vector, n); > + SET_RSA_PARAM(xform.rsa, vector, e); > + SET_RSA_PARAM(xform.rsa, vector, d); > + xform.rsa.key_type =3D RTE_RSA_KEY_TYPE_EXP; > + int ret =3D RSA_Init_Session(&xform); Please fix camel casing of functions as well. This got missed in the original commit. >=20 > if (ret) { > RTE_LOG(ERR, USER1, "Failed to init session for RSA\n"); > @@ -3412,8 +3388,17 @@ KAT_RSA_Encrypt_CRT(const void *data) > { > uint8_t cipher_buf[TEST_DATA_SIZE] =3D {0}; > const struct rsa_test_data_2 *vector =3D data; > - int ret =3D RSA_Init_Session(vector, RSA_key_init_CRT); > + struct rte_crypto_asym_xform xform =3D { }; >=20 > + SET_RSA_PARAM(xform.rsa, vector, n); > + SET_RSA_PARAM(xform.rsa, vector, e); > + SET_RSA_PARAM_QT(xform.rsa, vector, p); > + SET_RSA_PARAM_QT(xform.rsa, vector, q); > + SET_RSA_PARAM_QT(xform.rsa, vector, dP); > + SET_RSA_PARAM_QT(xform.rsa, vector, dQ); > + SET_RSA_PARAM_QT(xform.rsa, vector, qInv); > + xform.rsa.key_type =3D RTE_RSA_KEY_TYPE_QT; > + int ret =3D RSA_Init_Session(&xform); > if (ret) { > RTE_LOG(ERR, USER1, "Failed to init session for RSA\n"); > return ret; > @@ -3432,7 +3417,13 @@ KAT_RSA_Decrypt(const void *data) > { > uint8_t message[TEST_DATA_SIZE] =3D {0}; > const struct rsa_test_data_2 *vector =3D data; > - int ret =3D RSA_Init_Session(vector, RSA_key_init_Exp); > + struct rte_crypto_asym_xform xform =3D { }; > + > + SET_RSA_PARAM(xform.rsa, vector, n); > + SET_RSA_PARAM(xform.rsa, vector, e); > + SET_RSA_PARAM(xform.rsa, vector, d); > + xform.rsa.key_type =3D RTE_RSA_KEY_TYPE_EXP; > + int ret =3D RSA_Init_Session(&xform); >=20 > if (ret) { > RTE_LOG(ERR, USER1, "Failed to init session for RSA\n"); > @@ -3452,8 +3443,17 @@ KAT_RSA_Decrypt_CRT(const void *data) > { > uint8_t message[TEST_DATA_SIZE] =3D {0}; > const struct rsa_test_data_2 *vector =3D data; > - int ret =3D RSA_Init_Session(vector, RSA_key_init_CRT); > + struct rte_crypto_asym_xform xform =3D { }; >=20 > + SET_RSA_PARAM(xform.rsa, vector, n); > + SET_RSA_PARAM(xform.rsa, vector, e); > + SET_RSA_PARAM_QT(xform.rsa, vector, p); > + SET_RSA_PARAM_QT(xform.rsa, vector, q); > + SET_RSA_PARAM_QT(xform.rsa, vector, dP); > + SET_RSA_PARAM_QT(xform.rsa, vector, dQ); > + SET_RSA_PARAM_QT(xform.rsa, vector, qInv); > + xform.rsa.key_type =3D RTE_RSA_KEY_TYPE_QT; > + int ret =3D RSA_Init_Session(&xform); > if (ret) { > RTE_LOG(ERR, USER1, "Failed to init session for RSA\n"); > return ret; > -- > 2.13.6