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 2E589A3168 for ; Wed, 16 Oct 2019 12:57:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B0B631E933; Wed, 16 Oct 2019 12:57:44 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id B6DFF1E925 for ; Wed, 16 Oct 2019 12:57:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 03:57:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,303,1566889200"; d="scan'208";a="202041450" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 16 Oct 2019 03:57:41 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 16 Oct 2019 03:57:41 -0700 Received: from hasmsx111.ger.corp.intel.com (10.184.198.39) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 16 Oct 2019 03:57:41 -0700 Received: from HASMSX109.ger.corp.intel.com ([169.254.3.95]) by HASMSX111.ger.corp.intel.com ([169.254.5.5]) with mapi id 14.03.0439.000; Wed, 16 Oct 2019 13:57:39 +0300 From: "Kusztal, ArkadiuszX" To: "Trahe, Fiona" , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" , "Zhang, Roy Fan" , Shally Verma , Anoob Joseph , "De Lara Guarch, Pablo" , "Doherty, Declan" , "tdu@semihalf.com" Thread-Topic: [RFC] Chacha20 Poly1305 Support Thread-Index: AdV+edRLvl/CZXEDQ/uoyGQBqnN5NQAPhsIQAVXud6A= Date: Wed, 16 Oct 2019 10:57:38 +0000 Message-ID: <06EE24DD0B19E248B53F6DC8657831551B2B01CA@hasmsx109.ger.corp.intel.com> References: <06EE24DD0B19E248B53F6DC8657831551B29FD13@hasmsx109.ger.corp.intel.com> <348A99DA5F5B7549AA880327E580B43589831A03@IRSMSX101.ger.corp.intel.com> In-Reply-To: <348A99DA5F5B7549AA880327E580B43589831A03@IRSMSX101.ger.corp.intel.com> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.184.70.11] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC] Chacha20 Poly1305 Support 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" Hi Fiona, Thanks for your feedback, >=20 > Hi, >=20 > due to increasing interest of crypto protocols in Chacha20-Poly1305 > algorithm I would like to start discussion about adding it to cryptodev. > I would suggest adding something like: >=20 > @@ -348,6 +348,8 @@ enum rte_crypto_aead_algorithm { > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /**< AES algorithm in CCM mode. */ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_CRYPTO_AEAD_AES_GCM, > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /**< AES algorithm in GCM mode. */ > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_CRYPTO_AEAD_CHACHA20_POLY1305, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /**< Chacha20 encryption cipher with p= oly1305 authenticator > +*/ >=20 >=20 > In 'iv offset' of aead xform > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 * - For Chacha20-Poly1305 it is 96-bit > +nonce. Initial counter > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 * value for Chacha20 encryption is set by > +PMD to 1, meanwhile > + =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 =A0* for Poly1305 is set to 0 as per rfc7539 2.8. AEAD > construction. > [Fiona] I'd suggest moving initial counter description to next line as se= parate > from nonce. > And as Poly1305 is used twice in the procedure, maybe reword as: > PMD sets initial counter for Poly1305 key generation part to 0 and for > Chacha20 encryption to 1 as per rfc7539 2.8. AEAD construction. [Arek] - Yes, we can reword it this way. [Arek] - rfc7539 is obsoleted by rfc8439 so " as per rfc8439", no additiona= l changes are necessary due to this fact. >=20 > In 'iv length' of aead xform > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 * - For Chacha20-Poly1305 this field is always 12. >=20 > It is AEAD instead of cipher + auth as rfc7539 explicitly specifies initi= al > counters to one and zero with AEAD construction, which is not done for > Chacha and Poly separately. If in future someone would like to add these > algorithms to cipher and auth enums additional field that holds initial > counter should be added as well. >=20 > I have tested it with openssl pmd implementation I have created for test > purposes (Chacha Poly is supported since OpenSSL 1.1.0 version) which I m= ay > attach if needed. >=20 > (Sorry if I have not included someone in cc, please cc any interested per= son) >=20 > Regards, > Arek