All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ciara Power <ciara.power@intel.com>
To: Kai Ji <kai.ji@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>
Cc: dev@dpdk.org, Ciara Power <ciara.power@intel.com>
Subject: [PATCH] crypto/ipsec_mb: fix zuc256 maximum tag length
Date: Tue, 31 Jan 2023 17:20:27 +0000	[thread overview]
Message-ID: <20230131172027.524502-1-ciara.power@intel.com> (raw)

The AESNI_MB PMD supports 8 and 16 byte tag lengths for ZUC256 when
intel-ipsec-mb version is 1.3 or newer.
The conditional check to enable these tag lengths had the incorrect
operator, which enabled 8 and 16 byte tag lengths for versions below 1.2,
which is not supported.

Fixes: 7babda4316f9 ("crypto/ipsec_mb: support all tag sizes for ZUC-EIA3-256")
Cc: pablo.de.lara.guarch@intel.com

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c      | 2 +-
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index 147a38932d..ac20d01937 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -199,7 +199,7 @@ aesni_mb_set_session_auth_parameters(const IMB_MGR *mb_mgr,
 			}
 		} else if (xform->auth.key.length == 32) {
 			sess->auth.algo = IMB_AUTH_ZUC256_EIA3_BITLEN;
-#if IMB_VERSION(1, 2, 0) > IMB_VERSION_NUM
+#if IMB_VERSION(1, 2, 0) < IMB_VERSION_NUM
 			if (sess->auth.req_digest_len != 4 &&
 					sess->auth.req_digest_len != 8 &&
 					sess->auth.req_digest_len != 16) {
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
index 55fafbbbec..8a7c74f621 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
@@ -566,7 +566,7 @@ static const struct rte_cryptodev_capabilities aesni_mb_capabilities[] = {
 				},
 				.digest_size = {
 					.min = 4,
-#if IMB_VERSION(1, 2, 0) > IMB_VERSION_NUM
+#if IMB_VERSION(1, 2, 0) < IMB_VERSION_NUM
 					.max = 16,
 					.increment = 4
 #else
-- 
2.25.1


             reply	other threads:[~2023-01-31 17:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 17:20 Ciara Power [this message]
2023-02-02 14:10 ` [PATCH] crypto/ipsec_mb: fix zuc256 maximum tag length Dooley, Brian
2023-02-05 17:32   ` Akhil Goyal
2023-02-05 17:33     ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230131172027.524502-1-ciara.power@intel.com \
    --to=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=kai.ji@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.