From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E983AA0471 for ; Fri, 19 Jul 2019 06:43:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C6A442BE5; Fri, 19 Jul 2019 06:43:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 610112BA8 for ; Fri, 19 Jul 2019 06:43:03 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6J4edG2029373; Thu, 18 Jul 2019 21:43:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=K57pdJQUnNROX9v9jdABl6tBmGGM3GKjGbq+0UqZuAc=; b=gLpLXc02e2QaO1A8OvSCqbimcQFRpuIZVVIqp+FwI2y6l3ojS9Hv78b0PHoNqnZ+SyNL eeUHSSYP0+jvc69xiVZZLvNfaI+YixOqKW9I7XyJ1o7ucS5AzYYjIDGISsG4pnTX2GtQ VT7Drn+YyH0Pwkmfq9ydGiYc98+otOMLFgyX+UZjF/PyyM4Bab9ap26VfxxbDz3+VAFP +AKGcDRwYyckAap/mwRXoB3252ZiAzU7LxiGMPd5bToo4nfiU3qYYJqScSfUdTrwvxEt U20df1gVcCK9C2dCGBcE8RN2Ilxx4GQHEEM5k5jGQ4lR/H6huDMr5YCHCR2wSIAyH3Nc /w== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2ts0a2f4ep-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 18 Jul 2019 21:43:02 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 18 Jul 2019 21:43:00 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (104.47.50.57) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Thu, 18 Jul 2019 21:43:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A3aEpKM4AJouKYcHwYM3XTFX3eFNP2WaOBq12aCEdilRa6vAIK1TzLhOqcW49RJl9ArTjTSXpgtdrbMSEg6KGFo2ahcuyH3gzYxdb4S/hAFL6Yq0bfb0X8SalW0jx0cQHoVoQrw8ZUMcEXVFdaKSI4iNcr+lgWYm5Tb7lVuxZsIyyI7PujuBfhw7WqNXmSGQwAaoIXtxj71y1g8J9nBGMkwP+by6ELZcu1fNHuOkNXnoM6L379iaUTfvOKz3rgzZGBoSfRwWztZvQK2m44MLyoXCIt/t40Uhh7YA8u7LL/XpWfAWBKVDR4ubyZoeCLPi/fpCr4SdCni0SFzlbv/+CA== 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-SenderADCheck; bh=K57pdJQUnNROX9v9jdABl6tBmGGM3GKjGbq+0UqZuAc=; b=ChenPuT/EWHs0rY4QIouc/thvwN3p/0odjfTeUE2z+EjVy8uOrdIZUpTshvNAOzHyABhRTEGgO0OGhomKeZOmKxQ3wXYA31yJ+sOYspKdUXn0VNj1fILoscGPzGKI37dnwm0kc0XDp4f0IYJpfaaiLYbtESCnpkNFqfS0sxpYoHQITez5cIVBW50ARGtmAsr50+QISXpBuOgBc7z3372NLTJh3PGfQjhj0OFNXdiK3jl6y4VZIoGYeuusrnhSB5M6mVFg878V5TbCHi9BsC4tYzgGTV3Yn6HoSBdrvFBpPYwUGWRNTBtmtPhTtykuNNyMlWffIsDoml8Uqnx2zYqnQ== 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=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K57pdJQUnNROX9v9jdABl6tBmGGM3GKjGbq+0UqZuAc=; b=CdYe86QhSUI5CHqbjp2Tl+eF8A02QxU5Y+MnzZoQC6LuZOESD7mxe0aed3xvdpd/yNL3/Ux6o5E+uOed+kCkx933SAXVQnaed0/qlMFnj/+dInHPWfJ4B16iTjCFhoEhNMqkzOWD7PQESBeas9P8cRPXmBgblfaFb7qAQaWAGJo= Received: from BN6PR1801MB2052.namprd18.prod.outlook.com (10.161.157.11) by BN6PR1801MB1810.namprd18.prod.outlook.com (10.161.157.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12; Fri, 19 Jul 2019 04:42:58 +0000 Received: from BN6PR1801MB2052.namprd18.prod.outlook.com ([fe80::b9c4:1fd1:a47e:cd72]) by BN6PR1801MB2052.namprd18.prod.outlook.com ([fe80::b9c4:1fd1:a47e:cd72%6]) with mapi id 15.20.2073.012; Fri, 19 Jul 2019 04:42:58 +0000 From: Shally Verma To: Arek Kusztal , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" , "fiona.trahe@intel.com" , "damianx.nowak@intel.com" , Sunila Sahu , Ayuj Verma , "Kanaka Durga Kotamarthy" Thread-Topic: [EXT] [PATCH v5 2/7] cryptodev: add cipher field to RSA op Thread-Index: AQHVPYNs5+6RwXcle0i2lMS5+Kn/rabRXFKg Date: Fri, 19 Jul 2019 04:42:58 +0000 Message-ID: References: <20190718160943.10724-1-arkadiuszx.kusztal@intel.com> <20190718160943.10724-3-arkadiuszx.kusztal@intel.com> In-Reply-To: <20190718160943.10724-3-arkadiuszx.kusztal@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e993cc0f-d25b-461a-4e24-08d70c03930e x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:BN6PR1801MB1810; x-ms-traffictypediagnostic: BN6PR1801MB1810: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 01039C93E4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(136003)(376002)(39860400002)(396003)(189003)(199004)(13464003)(5660300002)(7696005)(71190400001)(71200400001)(8936002)(8676002)(25786009)(229853002)(52536014)(54906003)(3846002)(33656002)(4326008)(110136005)(316002)(6436002)(6116002)(53936002)(486006)(186003)(7736002)(446003)(11346002)(99286004)(476003)(26005)(305945005)(102836004)(6506007)(81166006)(107886003)(53546011)(256004)(14444005)(81156014)(55236004)(76176011)(2501003)(74316002)(9686003)(66476007)(6246003)(55016002)(68736007)(478600001)(2906002)(86362001)(66946007)(76116006)(66556008)(66066001)(14454004)(66446008)(64756008); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1801MB1810; H:BN6PR1801MB2052.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2YI2jitWPpnGBtZc/f1Xz9/tVt33tcskKbS26oJsoX5t+jNBCWzfxaZ6mXvM+axrja923n5wn5AELuBbEc6eocDYyPw5u2LVTHht9rMDcUu0Sh4tQk+lJayBNABiha0eZSqYzH66QIGqgMVKb+5nrciBxQAsygMF7zkXXDSdmDUFSBZZvdYBYHc+Iob4OZu61OTBaJ3uHaOXGXwluBIDfw06B14kCab00jjXcTr+K1VrwPfByQ3Zml89y1fnue4vXG+sdG8FA2OpZtE9cEg27uJH+aGBZRpzNdr2ZOFEIdkw8IEeJEFWU/gtum0bNM596aMJBT8YSroYauAudCdJ3ntbxM+5TLYZAPVO1K6rQv8S6s5HAtlG3i4NtCz+Us9UcI5FmQ5sU1kLIgfi4ebnQkirRwmTyAqpqL2nKtoL5gc= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e993cc0f-d25b-461a-4e24-08d70c03930e X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2019 04:42:58.6438 (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: shallyv@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1801MB1810 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-19_03:2019-07-19,2019-07-19 signatures=0 Subject: Re: [dpdk-dev] [EXT] [PATCH v5 2/7] cryptodev: add cipher field to RSA op X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Arek Kusztal > Sent: Thursday, July 18, 2019 9:40 PM > To: dev@dpdk.org > Cc: akhil.goyal@nxp.com; fiona.trahe@intel.com; Shally Verma > ; damianx.nowak@intel.com; Arek Kusztal > > Subject: [EXT] [PATCH v5 2/7] cryptodev: add cipher field to RSA op >=20 > External Email >=20 > ---------------------------------------------------------------------- > Asymmetric nature of RSA algorithm suggest to use additional field for > output. In place operations still can be done by setting cipher and messa= ge > pointers with the same memory address. >=20 > Signed-off-by: Arek Kusztal > --- > lib/librte_cryptodev/rte_crypto_asym.h | 43 > ++++++++++++++++++++++++++++------ > 1 file changed, 36 insertions(+), 7 deletions(-) >=20 > diff --git a/lib/librte_cryptodev/rte_crypto_asym.h > b/lib/librte_cryptodev/rte_crypto_asym.h > index 02ec304..1d4ec80 100644 > --- a/lib/librte_cryptodev/rte_crypto_asym.h > +++ b/lib/librte_cryptodev/rte_crypto_asym.h > @@ -395,21 +395,50 @@ struct rte_crypto_rsa_op_param { >=20 > rte_crypto_param message; > /**< > - * Pointer to data > + * Pointer to input data > * - to be encrypted for RSA public encrypt. > - * - to be decrypted for RSA private decrypt. > * - to be signed for RSA sign generation. > * - to be authenticated for RSA sign verification. > + * > + * Pointer to output data > + * - for RSA private decrypt. > + * In this case the underlying array should have been > + * allocated with enough memory to hold plaintext output > + * (i.e. must be at least RSA key size). The message.length > + * field should be 0 and will be overwritten by the PMD > + * with the decrypted length. > + * > + * All data is in Octet-string network byte order format. > + */ As per Fiona feedback in another email, for PMD it does not matter what out= put buffer length is set to. All matters if it should be allocated large en= ough as per description in spec. Given that, there is no need to mention specifically, that length should be= set to 0. App can leave it to anything as PMD don't care. It does not and = should not check for any valid params here. Ditto is my feedback on cipher.length description below. There is no need t= o mention, it should be set to 0 specifically If we agree, this change can be taken as part of next patch set. Current on= e can still go on. Thanks Shally > + > + rte_crypto_param cipher; > + /**< > + * Pointer to input data > + * - to be decrypted for RSA private decrypt. > + * > + * Pointer to output data > + * - for RSA public encrypt. > + * In this case the underlying array should have been allocated > + * with enough memory to hold ciphertext output (i.e. must be > + * at least RSA key size). The cipher.length field should > + * be 0 and will be overwritten by the PMD with the encrypted > length. > + * > + * All data is in Octet-string network byte order format. > */ >=20 > rte_crypto_param sign; > /**< > - * Pointer to RSA signature data. If operation is RSA > - * sign @ref RTE_CRYPTO_ASYM_OP_SIGN, buffer will be > - * over-written with generated signature. > + * Pointer to input data > + * - to be verified for RSA public decrypt. > + * > + * Pointer to output data > + * - for RSA private encrypt. > + * In this case the underlying array should have been allocated > + * with enough memory to hold signature output (i.e. must be > + * at least RSA key size). The sign.length field should > + * be 0 and will be overwritten by the PMD with the signature length. > * > - * Length of the signature data will be equal to the > - * RSA modulus length. > + * All data is in Octet-string network byte order format. > */ >=20 > enum rte_crypto_rsa_padding_type pad; > -- > 2.1.0