From patchwork Thu Sep 22 10:45:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 16018 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 DD8BE5921; Thu, 22 Sep 2016 12:46:11 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 9F89A58D8 for ; Thu, 22 Sep 2016 12:46:09 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 22 Sep 2016 03:46:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,378,1470726000"; d="scan'208";a="882625401" Received: from sivswdev03.ir.intel.com (HELO localhost.localdomain) ([10.237.217.157]) by orsmga003.jf.intel.com with ESMTP; 22 Sep 2016 03:46:07 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: fiona.trahe@intel.com, deepak.k.jain@intel.com, pablo.de.lara.guarch@intel.com, john.griffin@intel.com, Arek Kusztal Date: Thu, 22 Sep 2016 11:45:53 +0100 Message-Id: <1474541155-29367-2-git-send-email-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1474541155-29367-1-git-send-email-arkadiuszx.kusztal@intel.com> References: <1474541155-29367-1-git-send-email-arkadiuszx.kusztal@intel.com> Subject: [dpdk-dev] [PATCH v2 1/3] crypto/aesni_gcm: move pre-counter block to GCM driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch moves computing of pre-counter block into the AESNI-GCM driver so it can be moved from test files. Signed-off-by: Arek Kusztal Acked-by: Deepak Kumar Jain --- drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index dc0b033..857d74f 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -230,11 +230,20 @@ process_gcm_crypto_op(struct aesni_gcm_qp *qp, struct rte_crypto_sym_op *op, op->cipher.data.offset); /* sanity checks */ - if (op->cipher.iv.length != 16 && op->cipher.iv.length != 0) { + if (op->cipher.iv.length != 16 && op->cipher.iv.length != 12 && + op->cipher.iv.length != 0) { GCM_LOG_ERR("iv"); return -1; } + /* + * GCM working in 12B IV mode => 16B pre-counter block we need + * to set BE LSB to 1, driver expects that 16B is allocated + */ + if (op->cipher.iv.length == 12) { + op->cipher.iv.data[15] = 1; + } + if (op->auth.aad.length != 12 && op->auth.aad.length != 8 && op->auth.aad.length != 0) { GCM_LOG_ERR("iv");