From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2A7595688; Thu, 22 Jun 2017 12:40:26 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2017 03:40:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,373,1493708400"; d="scan'208";a="1185686456" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by fmsmga002.fm.intel.com with ESMTP; 22 Jun 2017 03:40:25 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Jun 2017 11:40:24 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.133]) by irsmsx155.ger.corp.intel.com ([169.254.14.182]) with mapi id 14.03.0319.002; Thu, 22 Jun 2017 11:40:24 +0100 From: "De Lara Guarch, Pablo" To: "Trahe, Fiona" , "Doherty, Declan" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 2/9] test/crypto: fix wrong AAD setting Thread-Index: AQHS6pyGOAYpCXkijUm1Wzsc76SWK6IvhM4AgAEtzqA= Date: Thu, 22 Jun 2017 10:40:24 +0000 Message-ID: References: <20170621064154.25124-1-pablo.de.lara.guarch@intel.com> <20170621064154.25124-3-pablo.de.lara.guarch@intel.com> <348A99DA5F5B7549AA880327E580B43589221155@IRSMSX101.ger.corp.intel.com> In-Reply-To: <348A99DA5F5B7549AA880327E580B43589221155@IRSMSX101.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action 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 2/9] test/crypto: fix wrong AAD setting 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, 22 Jun 2017 10:40:27 -0000 > -----Original Message----- > From: Trahe, Fiona > Sent: Wednesday, June 21, 2017 6:40 PM > To: De Lara Guarch, Pablo ; Doherty, Decl= an > > Cc: dev@dpdk.org; De Lara Guarch, Pablo ; > stable@dpdk.org; Trahe, Fiona > Subject: RE: [dpdk-dev] [PATCH 2/9] test/crypto: fix wrong AAD setting >=20 > Hi Pablo, >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara > > Sent: Wednesday, June 21, 2017 7:42 AM > > To: Doherty, Declan > > Cc: dev@dpdk.org; De Lara Guarch, Pablo > > ; stable@dpdk.org > > Subject: [dpdk-dev] [PATCH 2/9] test/crypto: fix wrong AAD setting > > > > AAD should not point at IV for AES algorithms. > > For AES-GCM, AAD will point at additional data in the mbuf. > > For the other algorithms (such as AES CBC), AAD is not used. > > > > Fixes: ffbe3be0d4b5 ("app/test: add libcrypto") > > CC: stable@dpdk.org > > > > Signed-off-by: Pablo de Lara > > --- > > test/test/test_cryptodev_perf.c | 13 ++++++++----- > > 1 file changed, 8 insertions(+), 5 deletions(-) > > > > diff --git a/test/test/test_cryptodev_perf.c > > b/test/test/test_cryptodev_perf.c index d60028d..3568b01 100644 > > --- a/test/test/test_cryptodev_perf.c > > +++ b/test/test/test_cryptodev_perf.c > > @@ -2634,6 +2634,11 @@ static uint8_t aes_iv[] =3D { > > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; > > > > +static uint8_t aes_gcm_aad[] =3D { > > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; > > + > > static uint8_t triple_des_key[] =3D { > > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2895,7 > +2900,7 > > @@ test_perf_create_armv8_session(uint8_t dev_id, enum chain_mode > > chain, > > > > #define AES_BLOCK_SIZE 16 > > #define AES_CIPHER_IV_LENGTH 16 > > - > > +#define AES_GCM_AAD_LENGTH 16 > > #define TRIPLE_DES_BLOCK_SIZE 8 > > #define TRIPLE_DES_CIPHER_IV_LENGTH 8 > > > > @@ -2939,8 +2944,6 @@ test_perf_set_crypto_op_aes(struct rte_crypto_op > *op, struct rte_mbuf *m, > > op->sym->auth.digest.phys_addr =3D > rte_pktmbuf_mtophys_offset(m, > > AES_CIPHER_IV_LENGTH + data_len); > > op->sym->auth.digest.length =3D digest_len; > > - op->sym->auth.aad.data =3D aes_iv; > > - op->sym->auth.aad.length =3D AES_CIPHER_IV_LENGTH; > Same change should be made for triple_des case Good catch. Will fix in v2. >=20 > > op->sym->auth.data.offset =3D AES_CIPHER_IV_LENGTH; > > op->sym->auth.data.length =3D data_len; > > } > > @@ -2977,8 +2980,8 @@ test_perf_set_crypto_op_aes_gcm(struct > > rte_crypto_op *op, struct rte_mbuf *m, > > op->sym->auth.digest.phys_addr =3D > > rte_pktmbuf_mtophys_offset(m, data_len); > > op->sym->auth.digest.length =3D digest_len; > > - op->sym->auth.aad.data =3D aes_iv; > > - op->sym->auth.aad.length =3D AES_CIPHER_IV_LENGTH; > > + op->sym->auth.aad.data =3D aes_gcm_aad; > > + op->sym->auth.aad.length =3D AES_GCM_AAD_LENGTH; > > > > /* Cipher Parameters */ > > op->sym->cipher.iv.data =3D aes_iv; > > -- > > 2.9.4