patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org, gakhil@marvell.com
Cc: Gagandeep Singh <g.singh@nxp.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2 09/11] common/dpaax: fix IV value for shortMAC-I for SNOW algo
Date: Wed, 25 Aug 2021 13:48:35 +0530	[thread overview]
Message-ID: <20210825081837.23830-9-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com>

From: Gagandeep Singh <g.singh@nxp.com>

The logic was incorecly doing conditional swap. It need to
be bit swap always.

Fixes: 73a24060cd70 ("crypto/dpaa2_sec: add sample PDCP descriptor APIs")
Cc: stable@dpdk.org

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/common/dpaax/caamflib/desc/pdcp.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h
index 5b3d846099..8e8daf5ba8 100644
--- a/drivers/common/dpaax/caamflib/desc/pdcp.h
+++ b/drivers/common/dpaax/caamflib/desc/pdcp.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause or GPL-2.0+
  * Copyright 2008-2013 Freescale Semiconductor, Inc.
- * Copyright 2019-2020 NXP
+ * Copyright 2019-2021 NXP
  */
 
 #ifndef __DESC_PDCP_H__
@@ -3715,9 +3715,10 @@ cnstr_shdsc_pdcp_short_mac(uint32_t *descbuf,
 		break;
 
 	case PDCP_AUTH_TYPE_SNOW:
+		/* IV calculation based on 3GPP specs. 36331, section:5.3.7.4 */
 		iv[0] = 0xFFFFFFFF;
-		iv[1] = swap ? swab32(0x04000000) : 0x04000000;
-		iv[2] = swap ? swab32(0xF8000000) : 0xF8000000;
+		iv[1] = swab32(0x04000000);
+		iv[2] = swab32(0xF8000000);
 
 		KEY(p, KEY2, authdata->key_enc_flags, authdata->key,
 		    authdata->keylen, INLINE_KEY(authdata));
-- 
2.17.1


  reply	other threads:[~2021-08-25  8:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21  7:39 [dpdk-stable] [PATCH 1/5] crypto/dpaa2_sec: fix to check next null for auth only case Hemant Agrawal
2021-08-25  8:18 ` [dpdk-stable] [PATCH v2 01/11] " Hemant Agrawal
2021-08-25  8:18   ` Hemant Agrawal [this message]
2021-09-02 12:46   ` [dpdk-stable] [EXT] " Akhil Goyal
2021-09-02 13:48     ` [dpdk-stable] [dpdk-dev] " Hemant Agrawal
     [not found]   ` <20210907083953.8948-1-hemant.agrawal@nxp.com>
2021-09-07  8:39     ` [dpdk-stable] [PATCH v3 08/10] common/dpaax: fix IV value for shortMAC-I for SNOW algo Hemant Agrawal
     [not found]     ` <20210908065953.28349-1-hemant.agrawal@nxp.com>
2021-09-08  6:59       ` [dpdk-stable] [PATCH v4 " Hemant Agrawal

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=20210825081837.23830-9-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=gakhil@marvell.com \
    --cc=stable@dpdk.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).