test/crypto: fix cipher offset for ZUC tests

Message ID 20220621114132.850412-1-ciara.power@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series test/crypto: fix cipher offset for ZUC tests |

Checks

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

Commit Message

Power, Ciara June 21, 2022, 11:41 a.m. UTC
  The cipher offset in bits was not being used in ZUC encryption test
functions when creating the operation, it was hardcoded to 0.
This is fixed to use the offset from the test vector as intended.

Fixes: fd01a9be38d5 ("test/crypto: move IV to crypto op private data")
Cc: pablo.de.lara.guarch@intel.com
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 app/test/test_cryptodev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ji, Kai June 21, 2022, 2:03 p.m. UTC | #1
> -----Original Message-----
> From: Power, Ciara <ciara.power@intel.com>
> Sent: Tuesday, June 21, 2022 12:42 PM
> To: Akhil Goyal <gakhil@marvell.com>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>
> Cc: dev@dpdk.org; Ji, Kai <kai.ji@intel.com>; Power, Ciara
> <ciara.power@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; stable@dpdk.org
> Subject: [PATCH] test/crypto: fix cipher offset for ZUC tests
> 
> The cipher offset in bits was not being used in ZUC encryption test functions
> when creating the operation, it was hardcoded to 0.
> This is fixed to use the offset from the test vector as intended.
> 
> Fixes: fd01a9be38d5 ("test/crypto: move IV to crypto op private data")
> Cc: pablo.de.lara.guarch@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
Acked-by Ji, Kai <kai.ji@intel.com>
  
Akhil Goyal June 21, 2022, 5:19 p.m. UTC | #2
> > The cipher offset in bits was not being used in ZUC encryption test functions
> > when creating the operation, it was hardcoded to 0.
> > This is fixed to use the offset from the test vector as intended.
> >
> > Fixes: fd01a9be38d5 ("test/crypto: move IV to crypto op private data")
> > Cc: pablo.de.lara.guarch@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ciara Power <ciara.power@intel.com>
> > ---
> Acked-by Ji, Kai <kai.ji@intel.com>

Please follow the naming convention in giving acks.
It should be Acked-by: Kai Ji <kai.ji@intel.com>

Applied to dpdk-next-crypto
Thanks.
  

Patch

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 2766e0cc10..49424496b0 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -6035,7 +6035,7 @@  test_zuc_encryption(const struct wireless_test_data *tdata)
 	retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data,
 					tdata->cipher_iv.len,
 					tdata->plaintext.len,
-					0);
+					tdata->validCipherOffsetInBits.len);
 	if (retval < 0)
 		return retval;
 
@@ -6130,7 +6130,7 @@  test_zuc_encryption_sgl(const struct wireless_test_data *tdata)
 	/* Create ZUC operation */
 	retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data,
 			tdata->cipher_iv.len, tdata->plaintext.len,
-			0);
+			tdata->validCipherOffsetInBits.len);
 	if (retval < 0)
 		return retval;