From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 76FAA20F for ; Thu, 29 Dec 2016 14:09:07 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 29 Dec 2016 05:09:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,427,1477983600"; d="scan'208";a="803300725" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by FMSMGA003.fm.intel.com with ESMTP; 29 Dec 2016 05:09:05 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.230]) by IRSMSX153.ger.corp.intel.com ([169.254.9.160]) with mapi id 14.03.0248.002; Thu, 29 Dec 2016 13:08:44 +0000 From: "Azarewicz, PiotrX T" To: "Kusztal, ArkadiuszX" , "dev@dpdk.org" CC: "Trahe, Fiona" , "De Lara Guarch, Pablo" , "Griffin, John" , "Jain, Deepak K" , "Doherty, Declan" , "Kusztal, ArkadiuszX" Thread-Topic: [dpdk-dev] [PATCH v2 1/3] crypto/aesni_gcm: fix J0 padding bytes for GCM Thread-Index: AQHSXPYepTynkyC8M02+Ct2TS7ElqaEe4tSA Date: Thu, 29 Dec 2016 13:08:43 +0000 Message-ID: <4837007523CC9A4B9414D20C13DE6E6413756B1A@IRSMSX102.ger.corp.intel.com> References: <1482481493-4369-1-git-send-email-arkadiuszx.kusztal@intel.com> <1482481493-4369-2-git-send-email-arkadiuszx.kusztal@intel.com> In-Reply-To: <1482481493-4369-2-git-send-email-arkadiuszx.kusztal@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 1/3] crypto/aesni_gcm: fix J0 padding bytes for GCM 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: , X-List-Received-Date: Thu, 29 Dec 2016 13:09:07 -0000 Hi Arek, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Arek Kusztal > Sent: Friday, December 23, 2016 9:25 AM > To: dev@dpdk.org > Cc: Trahe, Fiona ; De Lara Guarch, Pablo > ; Griffin, John ; > Jain, Deepak K ; Doherty, Declan > ; Kusztal, ArkadiuszX > > Subject: [dpdk-dev] [PATCH v2 1/3] crypto/aesni_gcm: fix J0 padding bytes > for GCM >=20 > This commit fixes pre-counter block (J0) padding by clearing four most > significant bytes before setting initial counter value. >=20 > Fixes: b2bb3597470c ("crypto/aesni_gcm: move pre-counter block to driver"= ) >=20 > Signed-off-by: Arek Kusztal > --- > drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > index dba5e15..af3d60f 100644 > --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > @@ -40,6 +40,7 @@ > #include > #include > #include > +#include >=20 > #include "aesni_gcm_pmd_private.h" >=20 > @@ -241,7 +242,8 @@ process_gcm_crypto_op(struct aesni_gcm_qp *qp, > struct rte_crypto_sym_op *op, > * to set BE LSB to 1, driver expects that 16B is allocated I think that 16B expected by driver while only 12B IV is supported is not c= lear from user perspective. I think that we should expect 12B only and allocate 16B locally. > */ > if (op->cipher.iv.length =3D=3D 12) { > - op->cipher.iv.data[15] =3D 1; > + uint32_t *iv_padd =3D (uint32_t *)&op->cipher.iv.data[12]; > + *iv_padd =3D rte_bswap32(1); Should not be that the last byte (number 15) always be set to 1? > } >=20 > if (op->auth.aad.length !=3D 12 && op->auth.aad.length !=3D 8 && > -- > 2.1.0