Skip to contentSkip to conversation

test/crypto: fix cipher offset for ZUC tests

PATCH Applied Ciara Power 3 participants 3 messages Jun 21, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 app/test/test_cryptodev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test/test_cryptodev.c +2 -2
index 2766e0cc10..49424496b0 100644
@@ -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;
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 14 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Tuesday, June 21, 2022 12:42 PM
To: Akhil Goyal <[email protected]>; Zhang, Roy Fan <[email protected]>
Cc: [email protected]; Ji, Kai <[email protected]>; Power, Ciara <[email protected]>; De Lara Guarch, Pablo <[email protected]>; [email protected]
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.

Quoted 6 lines
Fixes fd01a9be38d5 ("test/crypto: move IV to crypto op private data")

---

Acked-by Ji, Kai <[email protected]>

Applied
#2 lore raw
Quoted 11 lines
Quoted 10 lines

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")

---

Acked-by Ji, Kai <[email protected]>

Please follow the naming convention in giving acks. It should be Acked-by: Kai Ji <[email protected]>

Applied to dpdk-next-crypto
Thanks.