[17/17] common/cnxk: remove salt from session

Message ID 20221220143232.2519650-18-ktejasree@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series fixes and improvements to cnxk crytpo PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing fail Testing issues
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-aarch64-compile-testing success Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Tejasree Kondoj Dec. 20, 2022, 2:32 p.m. UTC
  From: Anoob Joseph <anoobj@marvell.com>

Complete 16B IV can be passed in DPTR to microcode. Passing salt in CPTR
cannot be supported as the salt need to be given in different formats
when CTX is enabled.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 drivers/common/cnxk/roc_se.c  | 17 +++--------------
 drivers/common/cnxk/roc_se.h  |  2 +-
 drivers/crypto/cnxk/cnxk_se.h |  6 +++---
 3 files changed, 7 insertions(+), 18 deletions(-)
  

Patch

diff --git a/drivers/common/cnxk/roc_se.c b/drivers/common/cnxk/roc_se.c
index f335c2367f..6f0a81b22c 100644
--- a/drivers/common/cnxk/roc_se.c
+++ b/drivers/common/cnxk/roc_se.c
@@ -497,8 +497,9 @@  roc_se_auth_key_set(struct roc_se_ctx *se_ctx, roc_se_auth_type type,
 }
 
 int
-roc_se_ciph_key_set(struct roc_se_ctx *se_ctx, roc_se_cipher_type type,
-		    const uint8_t *key, uint16_t key_len, uint8_t *salt)
+roc_se_ciph_key_set(struct roc_se_ctx *se_ctx, roc_se_cipher_type type, const uint8_t *key,
+		    uint16_t key_len)
+
 {
 	bool chained_op = se_ctx->ciph_then_auth || se_ctx->auth_then_ciph;
 	struct roc_se_zuc_snow3g_ctx *zs_ctx = &se_ctx->se_ctx.zs_ctx;
@@ -520,18 +521,6 @@  roc_se_ciph_key_set(struct roc_se_ctx *se_ctx, roc_se_cipher_type type,
 		zuc_const = zs_ctx->zuc.otk_ctx.zuc_const;
 	}
 
-	/* For AES-GCM, salt is taken from ctx even if IV source
-	 * is from DPTR
-	 */
-	if ((salt != NULL) && (type == ROC_SE_AES_GCM)) {
-		memcpy(fctx->enc.encr_iv, salt, 4);
-		/* Assuming it was just salt update
-		 * and nothing else
-		 */
-		if (key == NULL)
-			return 0;
-	}
-
 	if (type == ROC_SE_AES_GCM)
 		se_ctx->template_w4.s.opcode_minor = BIT(5);
 
diff --git a/drivers/common/cnxk/roc_se.h b/drivers/common/cnxk/roc_se.h
index d1ef71577c..e9415f21a5 100644
--- a/drivers/common/cnxk/roc_se.h
+++ b/drivers/common/cnxk/roc_se.h
@@ -370,7 +370,7 @@  int __roc_api roc_se_auth_key_set(struct roc_se_ctx *se_ctx, roc_se_auth_type ty
 				  const uint8_t *key, uint16_t key_len, uint16_t mac_len);
 
 int __roc_api roc_se_ciph_key_set(struct roc_se_ctx *se_ctx, roc_se_cipher_type type,
-				  const uint8_t *key, uint16_t key_len, uint8_t *salt);
+				  const uint8_t *key, uint16_t key_len);
 
 void __roc_api roc_se_ctx_swap(struct roc_se_ctx *se_ctx);
 void __roc_api roc_se_ctx_init(struct roc_se_ctx *se_ctx);
diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h
index 1827b0d7b3..0e5d2dde39 100644
--- a/drivers/crypto/cnxk/cnxk_se.h
+++ b/drivers/crypto/cnxk/cnxk_se.h
@@ -1708,7 +1708,7 @@  fill_sess_aead(struct rte_crypto_sym_xform *xform, struct cnxk_se_sess *sess)
 	}
 
 	if (unlikely(roc_se_ciph_key_set(&sess->roc_se_ctx, enc_type, aead_form->key.data,
-					 aead_form->key.length, NULL)))
+					 aead_form->key.length)))
 		return -1;
 
 	if (unlikely(roc_se_auth_key_set(&sess->roc_se_ctx, auth_type, NULL, 0,
@@ -1866,7 +1866,7 @@  fill_sess_cipher(struct rte_crypto_sym_xform *xform, struct cnxk_se_sess *sess)
 		}
 
 	if (unlikely(roc_se_ciph_key_set(&sess->roc_se_ctx, enc_type, c_form->key.data,
-					 c_form->key.length, NULL)))
+					 c_form->key.length)))
 		return -1;
 
 	if ((enc_type >= ROC_SE_ZUC_EEA3) && (enc_type <= ROC_SE_AES_CTR_EEA2))
@@ -2072,7 +2072,7 @@  fill_sess_gmac(struct rte_crypto_sym_xform *xform, struct cnxk_se_sess *sess)
 	}
 
 	if (unlikely(roc_se_ciph_key_set(&sess->roc_se_ctx, enc_type, a_form->key.data,
-					 a_form->key.length, NULL)))
+					 a_form->key.length)))
 		return -1;
 
 	if (unlikely(roc_se_auth_key_set(&sess->roc_se_ctx, auth_type, NULL, 0,