From patchwork Fri Feb 18 16:34:41 2022 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: 107813 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1620EA0032; Fri, 18 Feb 2022 17:35:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09E6941143; Fri, 18 Feb 2022 17:35:10 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 1ED4F4068B; Fri, 18 Feb 2022 17:35:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645202108; x=1676738108; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f2Qbj+GMcphl3pqIJVjVfUafV+l63hD/Uik1RYxAb+o=; b=KJLsUUMo0k4fSjczBiANTBdh6cHuE9kTy/uJJ2Jq9w7Wjj/i4aHoqAEF ADMRpUR5giOEtbjpfhIxEjdF4EkAzd9F30qp8IVT41nQMzXmFHr/sqkqL x7gefrhIpwtFR+FdJdEw8MiEY90lxX77FQwfwTBmGgoQqj1Dhyc++QEoZ YZHB9qJuLlrpnWVCM667Ou+yE8uhdabLi15I09VTknNIacdTOh+6GTRAb ZWU7JPRThfPIuMtanNCTsnrXtw9WT/g4+xsD0nkcO9oCceNuxkB4sn1BQ bo5CU941H9FYnLK7C/fRQ1Co8lXko9wWyFMOwd/QXbgdyKnhkvgKeAyRB w==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="251101731" X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="251101731" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2022 08:35:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="546344016" Received: from silpixa00400493.ir.intel.com ([10.237.213.136]) by orsmga008.jf.intel.com with ESMTP; 18 Feb 2022 08:35:06 -0800 From: Pablo de Lara To: roy.fan.zhang@intel.com Cc: dev@dpdk.org, Pablo de Lara , stable@dpdk.org Subject: [PATCH 2/4] crypto/ipsec_mb: fix ZUC authentication verify Date: Fri, 18 Feb 2022 16:34:41 +0000 Message-Id: <20220218163443.3520756-3-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220218163443.3520756-1-pablo.de.lara.guarch@intel.com> References: <20220218163443.3520756-1-pablo.de.lara.guarch@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org ZUC authentication is done over multiple buffers at a time. When authentication verification is done, multiple scratch buffers are using to generate the tags that will be compared afterwards. However, the same scratch buffer was used always, instead of having different ones for each crypto operation. Fixes: 0b133c36ad7d ("crypto/zuc: support IPsec Multi-buffer lib v0.54") Cc: pablo.de.lara.guarch@intel.com Cc: stable@dpdk.org Signed-off-by: Pablo de Lara --- drivers/crypto/ipsec_mb/pmd_zuc.c | 2 +- drivers/crypto/ipsec_mb/pmd_zuc_priv.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ipsec_mb/pmd_zuc.c b/drivers/crypto/ipsec_mb/pmd_zuc.c index ec83d96dfc..07cf1462d2 100644 --- a/drivers/crypto/ipsec_mb/pmd_zuc.c +++ b/drivers/crypto/ipsec_mb/pmd_zuc.c @@ -166,7 +166,7 @@ process_zuc_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops, hash_keys[i] = sess->pKey_hash; if (sess->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) - dst[i] = (uint32_t *)qp_data->temp_digest; + dst[i] = (uint32_t *)qp_data->temp_digest[i]; else dst[i] = (uint32_t *)ops[i]->sym->auth.digest.data; diff --git a/drivers/crypto/ipsec_mb/pmd_zuc_priv.h b/drivers/crypto/ipsec_mb/pmd_zuc_priv.h index 46d5bfae37..76fd6758c2 100644 --- a/drivers/crypto/ipsec_mb/pmd_zuc_priv.h +++ b/drivers/crypto/ipsec_mb/pmd_zuc_priv.h @@ -75,7 +75,7 @@ struct zuc_session { struct zuc_qp_data { - uint8_t temp_digest[ZUC_DIGEST_LENGTH]; + uint8_t temp_digest[ZUC_MAX_BURST][ZUC_DIGEST_LENGTH]; /* *< Buffers used to store the digest generated * by the driver when verifying a digest provided * by the user (using authentication verify operation)