From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id BBA605699; Wed, 21 Jun 2017 19:40:10 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2017 10:40:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,369,1493708400"; d="scan'208";a="1163131138" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga001.fm.intel.com with ESMTP; 21 Jun 2017 10:39:58 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.242]) by IRSMSX107.ger.corp.intel.com ([169.254.10.129]) with mapi id 14.03.0319.002; Wed, 21 Jun 2017 18:39:56 +0100 From: "Trahe, Fiona" To: "De Lara Guarch, Pablo" , "Doherty, Declan" CC: "dev@dpdk.org" , "De Lara Guarch, Pablo" , "stable@dpdk.org" , "Trahe, Fiona" Thread-Topic: [dpdk-dev] [PATCH 2/9] test/crypto: fix wrong AAD setting Thread-Index: AQHS6pyeduAQ5a/Er0qutH0OKwL+l6IvjYJQ Date: Wed, 21 Jun 2017 17:39:56 +0000 Message-ID: <348A99DA5F5B7549AA880327E580B43589221155@IRSMSX101.ger.corp.intel.com> References: <20170621064154.25124-1-pablo.de.lara.guarch@intel.com> <20170621064154.25124-3-pablo.de.lara.guarch@intel.com> In-Reply-To: <20170621064154.25124-3-pablo.de.lara.guarch@intel.com> Accept-Language: en-IE, 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-stable] [dpdk-dev] [PATCH 2/9] test/crypto: fix wrong AAD setting X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jun 2017 17:40:11 -0000 Hi Pablo, > -----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 >=20 > 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. >=20 > Fixes: ffbe3be0d4b5 ("app/test: add libcrypto") > CC: stable@dpdk.org >=20 > Signed-off-by: Pablo de Lara > --- > test/test/test_cryptodev_perf.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) >=20 > diff --git a/test/test/test_cryptodev_perf.c b/test/test/test_cryptodev_p= erf.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 > }; >=20 > +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, >=20 > #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 >=20 > @@ -2939,8 +2944,6 @@ test_perf_set_crypto_op_aes(struct rte_crypto_op *o= p, 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=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_o= p *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; >=20 > /* Cipher Parameters */ > op->sym->cipher.iv.data =3D aes_iv; > -- > 2.9.4