From patchwork Wed Jun 21 06:41:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 25570 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id F0B6B7CF6; Wed, 21 Jun 2017 16:41:44 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D87537CDB; Wed, 21 Jun 2017 16:41:40 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2017 07:41:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,369,1493708400"; d="scan'208";a="115791799" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by orsmga005.jf.intel.com with ESMTP; 21 Jun 2017 07:41:39 -0700 From: Pablo de Lara To: declan.doherty@intel.com Cc: dev@dpdk.org, Pablo de Lara , stable@dpdk.org Date: Wed, 21 Jun 2017 07:41:47 +0100 Message-Id: <20170621064154.25124-3-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170621064154.25124-1-pablo.de.lara.guarch@intel.com> References: <20170621064154.25124-1-pablo.de.lara.guarch@intel.com> Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static uint8_t aes_gcm_aad[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + static uint8_t triple_des_key[] = { 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 = rte_pktmbuf_mtophys_offset(m, AES_CIPHER_IV_LENGTH + data_len); op->sym->auth.digest.length = digest_len; - op->sym->auth.aad.data = aes_iv; - op->sym->auth.aad.length = AES_CIPHER_IV_LENGTH; op->sym->auth.data.offset = AES_CIPHER_IV_LENGTH; op->sym->auth.data.length = 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 = rte_pktmbuf_mtophys_offset(m, data_len); op->sym->auth.digest.length = digest_len; - op->sym->auth.aad.data = aes_iv; - op->sym->auth.aad.length = AES_CIPHER_IV_LENGTH; + op->sym->auth.aad.data = aes_gcm_aad; + op->sym->auth.aad.length = AES_GCM_AAD_LENGTH; /* Cipher Parameters */ op->sym->cipher.iv.data = aes_iv;