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 DF9A3A0503; Fri, 20 May 2022 14:07:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5E0540222; Fri, 20 May 2022 14:07:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 7592540151 for ; Fri, 20 May 2022 14:07:32 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24KBEDOi018343; Fri, 20 May 2022 05:07:31 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3g6008tasq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 May 2022 05:07:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PHYC43aAtLJf4FGV2pqbBK3G1NZaf4f2sgHITFbSreYWsAR5jXu2Aoa4jztJNqADgiE5ZdqqyKu6GT5TGFCWmj4m4g8cvSy7uJOoW+TskRlYJvuVTzNMR/4LIKqFIbP/AH5wkn+YPtwksE91oASqtMxS5o8GilKZ10+YuQ9VoPr+jQ8qc+dh1KhM2OOB/nVWGExp/qvoU7O27rkxDkzyseJVx0GiLd+WveUifLXpMMY/a6247XLAYkm2yTgXZjqweVQnkoKPNT5vCM3eO/nK/F7qRRVYyB0t4Kwe8cex/LItLcvRymPJY+zVA3XXd22QFtFtA7wsToixdMTnQWrTvg== 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=ClS8KytJwb+oKVXKlFLvBUvVHp1Uyu3s/4OqRHpY11A=; b=R9Td1p0dqUaxMBTG7G1tp1WN2Mr7d+IJHM1aVIMG1lSOu3D9L+vCi4bcsueFX4hXQI/OooXTGvDG5n1Azsw1CIS+j5MasV5b7e0qGLApH4rIACzGFWzVaoTb0q0UG80lZHmPcGSsdMVWLr0iS79FHvjljyuW+CyJPtmqXut7ZHcFL50QgukOBsIYPj4DJkG5ZJb/jDiP8pHG4WPqx/uNYVwpU1j25H4RzRw6oZTLOedToQ4P++46IAIDURolPsVAPetTTHHdJz208eBZHxJHTugW7eDx6eXy3IPP5rYKQeCJQjAfBgSLZaCMqGX4SlFTM/RaXwhjbZmId//rXZrgHg== 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=ClS8KytJwb+oKVXKlFLvBUvVHp1Uyu3s/4OqRHpY11A=; b=V1HEn7bBCXSCSD8wv/okia8yOx+w9g5hyz2o5D+Sm2zVxVgpjfdtqTkzIjLZAxxl4cI+jMcswuYBycNDudXH5tlaary3d1jna3HP0gs6GpvbwkTL9n30GqHsofeNU4o1SOh6QD1utS1KNYjOF6bsGaJ6W5xIcJMKN+lrU1rMDLw= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by BN8PR18MB2419.namprd18.prod.outlook.com (2603:10b6:408:96::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Fri, 20 May 2022 12:07:26 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1d4a:ca8b:611a:9cf6]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1d4a:ca8b:611a:9cf6%5]) with mapi id 15.20.5273.018; Fri, 20 May 2022 12:07:26 +0000 From: Akhil Goyal To: Arek Kusztal , "dev@dpdk.org" CC: Anoob Joseph , "roy.fan.zhang@intel.com" Subject: RE: [EXT] [PATCH 37/40] cryptodev: add asym op flags Thread-Topic: [EXT] [PATCH 37/40] cryptodev: add asym op flags Thread-Index: AQHYbBfNLcw0RW4V2UG+rxlCsfhz4K0nqjQA Date: Fri, 20 May 2022 12:07:26 +0000 Message-ID: References: <20220520055445.40063-1-arkadiuszx.kusztal@intel.com> <20220520055445.40063-38-arkadiuszx.kusztal@intel.com> In-Reply-To: <20220520055445.40063-38-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-office365-filtering-correlation-id: 0c97ac8d-471e-4b20-a485-08da3a594e45 x-ms-traffictypediagnostic: BN8PR18MB2419:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aQ6RzRyDW7G8ddTl+BjeNUZ7qNrzCUhxd7MqVp4ixOgWcCixkB4XBPi/ZH1hmsgI9KMCgnJUJBqSyfdz8bSipBmhIi1P8N0O0XTTPca5t90XA/DUOcRArWMxwpSlYoyFuwL2YIh/iobyt/tkMQHgdsGbR9OnLwIzRXWzTDSB2lQcVEz4LIoUG3gvaiBNlceyOimBV0adzLmQaXUWGSVIkwOeUS1rwsAJ5nmwrXlJlAtnqDBCKfQOR+PgWCGNQFnpdKtOxfYOyq3cUbBdbD6QrZKm2FXgnNm/J00PrV/VRoI7Y5wiEvvaPHHzgfMdz6dVVhHM+rfv+a1EtZEd4oO6qeoHnoQ9zRj2IRjEU2bU/gZ36XR5nN+RPmtKPadpPW69yu9Oa8sutw4GvaWU3STsOhzhdFL8Nl/PJgTmwIScPXo7It6WrUzhsqG3Zvp0xR7wEKiYhU7LE0xLcnRcIgyK8dslpXjC/ApOG2Bx5Aq3fu4wlqKmwo2puFN+IMENp0baaDsovG84kS+MMT99mexiccEf/XXsJMHiArh1HNCso58QgVNVKNWrmf2FK1yl4Na2Ts91toPejhAUg9d8J8OoU7Nd5ZirF5qHczjAsO49R5dnd4FAoNuK67Kj/kmUFKzFyL8gsE2/qKEvW6LT2F+349bV0XViq2MWTrW8gH6zWBUAiEmb/ZrlK4ftfOcgjxnaquGErsnHr/G702JdQ96d3g== 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:(13230001)(4636009)(366004)(66946007)(66476007)(8936002)(76116006)(122000001)(38100700002)(38070700005)(5660300002)(8676002)(66446008)(66556008)(55016003)(52536014)(4326008)(86362001)(6506007)(316002)(55236004)(2906002)(110136005)(26005)(186003)(71200400001)(54906003)(508600001)(7696005)(64756008)(9686003)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qbqgJOEAsvn+NR8iPPHZbiygEnFBI78dfvqPquEeeZPGRUlMnmAJeplqVJvS?= =?us-ascii?Q?zu1Bsh4kRVTEzrymC3tLHk9Vj9+goCI8ecU/RBGSsP7BN+/GwZCRxt6QRZgM?= =?us-ascii?Q?xAt6FOtx6zp88AsSW9us52u2Zc8DGr8O8MYLJ0xYfKvV/wIQQHWvShOimRgh?= =?us-ascii?Q?vWTVPjOpC9zU6ZxQW1FqfDicNKIEFRHw/UgrIjjxUlKRIgCcvHP4iIKuVTF3?= =?us-ascii?Q?OU9M4bnnKd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ORkp/PwjQ?= =?us-ascii?Q?SuwSlGHhP5NCx2IVQJUkzRb/YAEPtnkAesda71EaJElXkLDOvhtfR2Q3aowE?= =?us-ascii?Q?lIgziODI+WZggBUAKzNK6AtXYtb8X0PWf0cAcyXKmoie2I3O/xWiWnYGrRB0?= =?us-ascii?Q?I7Cp0whf6G3VAO/QIfopFu3ILG+wRLd71poczP3w7zgwQGkGlCnbwqtlrVhM?= =?us-ascii?Q?WtsS0y9oVhgKWLltqSELPqfhXq0WynQTN82Cqmw3XieMKtwUJC0kP56UAMvZ?= =?us-ascii?Q?htVvNi63Gd1RdFL+ocxjS1K00ftg35PZFiBUvDxUvc1hja5Gb5i0FvsfPQEZ?= =?us-ascii?Q?bXV7YOjoJRsl8jxuzc2cKKIRHfAusOHAbBo7Q46NrtHj3XN4fw1DVNGv13gr?= =?us-ascii?Q?sv9mKZecO/lKtS13Dp9eu/3/VDg9aHyq0ooWOV6z+X44huDOEhEgJNHAYC4a?= =?us-ascii?Q?dmBuvt/bTHprIwWyBOdNpK+MInYJbQM0wACqy5KyRhKSoJljTC1s2XC6doTy?= =?us-ascii?Q?vZYncuyQ3ilhb1sGjFMByJ/3Wc7IWh+LpjmY2HEsjyutDXku5u+k92si3VUO?= =?us-ascii?Q?0PsDkm20uOPG1Jmg9HET6QWTLxnYFqA0hpWpeC7CJI8ZfT7pDezqC6sYzUa5?= =?us-ascii?Q?s4r7VoP//g=3D=3D?= 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: 0c97ac8d-471e-4b20-a485-08da3a594e45 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2022 12:07:26.5721 (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: Xsi2LT/A81lr3uGB7KaQtNMIoTsVjLwu5AfZRUhFMB4VQiqWwleRKxB9hR3+W5a2TdYD6eoHj1LnkgvhTvKMZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR18MB2419 X-Proofpoint-GUID: AXjKcmtSsLb-uSXRY_PTZfiQb9xZUAMN X-Proofpoint-ORIG-GUID: AXjKcmtSsLb-uSXRY_PTZfiQb9xZUAMN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-20_03,2022-05-20_02,2022-02-23_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 > - added flags to rte_crypto_asym_op struct. > It may be shared between different algorithms. > - added Diffie-Hellman padding flags. > Diffie-Hellman padding is used in certain protocols, > in others, leading zero bytes need to be stripped. > Even same protocol may use a different approach - most > glaring example is TLS1.2 - TLS1.3. > For ease of use, and to avoid additional copy > on certain occasions, driver should be able to return both. >=20 > Signed-off-by: Arek Kusztal > --- > lib/cryptodev/rte_crypto_asym.h | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) >=20 > diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_a= sym.h > index 37dd3b9d86..01b1fdd074 100644 > --- a/lib/cryptodev/rte_crypto_asym.h > +++ b/lib/cryptodev/rte_crypto_asym.h > @@ -41,6 +41,26 @@ rte_crypto_asym_ke_strings[]; > extern const char * > rte_crypto_asym_op_strings[]; >=20 > +#define RTE_CRYPTO_ASYM_FLAG_PUB_KEY_NO_PADDING 0 > +/**< > + * If set to 1 - public key will be returned > + * without leading zero bytes, otherwise it will be > + * padded to the left with zero bytes (default) > + */ > +#define RTE_CRYPTO_ASYM_FLAG_SHARED_KEY_NO_PADDING 1 > +/**< > + * If set to 1 - shared key will be returned > + * without leading zero bytes, otherwise it will be > + * padded to the left with zero bytes (default) > + */ > + > +#define RTE_CRYPTO_ASYM_FLAG_SET(op, flag) \ > + (op->flags |=3D (1ULL << flag)) > +#define RTE_CRYPTO_ASYM_FLAG_UNSET(op, flag) \ > + (op->flags &=3D (~(1ULL << flag))) > +#define RTE_CRYPTO_ASYM_FLAG_GET(op, flag) \ > + (!!(op->flags &=3D (1ULL << flag))) > + Why are these SET/GET macros needed? Is the following not sufficient #define RTE_CRYPTO_ASYM_FLAG_PUB_KEY_NO_PADDING RTE_BIT32(0) #define RTE_CRYPTO_ASYM_FLAG_SHARED_KEY_NO_PADDING RTE_BIT32(1) op->flags |=3D RTE_CRYPTO_ASYM_FLAG_PUB_KEY_NO_PADDING; > /** > * List of elliptic curves. This enum aligns with > * TLS "Supported Groups" registry (previously known as > @@ -607,6 +627,11 @@ struct rte_crypto_asym_op { > struct rte_crypto_ecdsa_op_param ecdsa; > struct rte_crypto_ecpm_op_param ecpm; > }; > + uint16_t flags; > + /**< Asymmetric crypto flags, every flag starts with > + * RTE_CRYPTO_ASYM_FLAG_*. Flags are set/unset with > + * RTE_CRYPTO_ASYM_SET_FLAGS, RTE_CRYPTO_ASYM_GET_FLAGS > + */ > }; >=20 > #ifdef __cplusplus > -- > 2.13.6