Skip to contentSkip to conversation

test/crypto: add ZUC256 chained tests

PATCH Superseded Ciara Power 5 participants 17 messages Mar 1, 2023 – Mar 14, 2023

lore
Share & tools
lore
#0 lore raw

cover test/crypto: add ZUC256 chained tests

This patchset adds chained testcases for each ZUC256 digest size:
- cipher-auth
- auth-cipher
- auth-cipher-verify

To add these tests, some improvements were made to the existing code, allowing for the user to easily differentiate ZUC256 and ZUC128 tests.

Some fixes are also included, that were highlighted when these new tests were added.

Ciara Power (5):
test/crypto: improve readability of ZUC256 tests test/crypto: fix ZUC digest length in comparison test/crypto: fix auth op parameter for ZUC256 tests test/crypto: fix capability check for ZUC cipher auth test/crypto: add chained ZUC256 testcases

 app/test/test_cryptodev.c                  | 280 +++++---
 app/test/test_cryptodev_zuc_test_vectors.h | 714 +++++++++++++++++++++
 2 files changed, 913 insertions(+), 81 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/5 test/crypto: improve readability of ZUC256 tests

There were some ZUC256 tests for hash generate and hash verify mixed in with the ZUC128 tests, with no indication in the test name that they were for ZUC256.

These are now grouped with other ZUC256 tests, and all ZUC256 hash test names are modified to be more uniform, and indicate the digest length as this can vary with ZUC256.

---
 app/test/test_cryptodev.c | 125 +++++++++++++++++++-------------------
 1 file changed, 62 insertions(+), 63 deletions(-)
app/test/test_cryptodev.c +62 -63
index aa831d79a2..ca7f10557c 100644
@@ -7385,27 +7385,6 @@ test_zuc_hash_generate_test_case_8(void)
 			RTE_CRYPTO_AUTH_OP_GENERATE);
 }
 
-static int
-test_zuc_hash_generate_test_case_9(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,
-			RTE_CRYPTO_AUTH_OP_GENERATE);
-}
-
-static int
-test_zuc_hash_generate_test_case_10(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,
-			RTE_CRYPTO_AUTH_OP_GENERATE);
-}
-
-static int
-test_zuc_hash_generate_test_case_11(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,
-			RTE_CRYPTO_AUTH_OP_GENERATE);
-}
-
 static int
 test_zuc_hash_verify_test_case_1(void)
 {
@@ -7462,27 +7441,6 @@ test_zuc_hash_verify_test_case_8(void)
 			RTE_CRYPTO_AUTH_OP_VERIFY);
 }
 
-static int
-test_zuc_hash_verify_test_case_9(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,
-			RTE_CRYPTO_AUTH_OP_VERIFY);
-}
-
-static int
-test_zuc_hash_verify_test_case_10(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,
-			RTE_CRYPTO_AUTH_OP_VERIFY);
-}
-
-static int
-test_zuc_hash_verify_test_case_11(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,
-			RTE_CRYPTO_AUTH_OP_VERIFY);
-}
-
 static int
 test_zuc_cipher_auth_test_case_1(void)
 {
@@ -7608,29 +7566,71 @@ test_zuc256_decryption_test_case_2(void)
 }
 
 static int
-test_zuc256_authentication_test_case_1(void)
+test_zuc256_hash_generate_4b_tag_test_case_1(void)
 {
 	return test_zuc_authentication(&zuc256_test_case_auth_1, 0);
 }
 
 static int
-test_zuc256_authentication_test_case_2(void)
+test_zuc256_hash_generate_4b_tag_test_case_2(void)
 {
 	return test_zuc_authentication(&zuc256_test_case_auth_2, 0);
 }
 
 static int
-test_zuc256_authentication_verify_test_case_1(void)
+test_zuc256_hash_generate_4b_tag_test_case_3(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
+}
+
+static int
+test_zuc256_hash_generate_8b_tag_test_case_1(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
+}
+
+static int
+test_zuc256_hash_generate_16b_tag_test_case_1(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
+}
+
+static int
+test_zuc256_hash_verify_4b_tag_test_case_1(void)
 {
 	return test_zuc_authentication(&zuc256_test_case_auth_1, 1);
 }
 
 static int
-test_zuc256_authentication_verify_test_case_2(void)
+test_zuc256_hash_verify_4b_tag_test_case_2(void)
 {
 	return test_zuc_authentication(&zuc256_test_case_auth_2, 1);
 }
 
+static int
+test_zuc256_hash_verify_4b_tag_test_case_3(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
+}
+
+static int
+test_zuc256_hash_verify_8b_tag_test_case_1(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
+}
+
+static int
+test_zuc256_hash_verify_16b_tag_test_case_1(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
+}
+
 static int
 test_mixed_check_if_unsupported(const struct mixed_cipher_auth_test_data *tdata)
 {
@@ -16409,12 +16409,6 @@ static struct unit_test_suite cryptodev_zuc_testsuite  = {
 			test_zuc_hash_generate_test_case_7),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_zuc_hash_generate_test_case_8),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_9),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_10),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_11),
 
 		/** ZUC verify (EIA3) */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -16433,13 +16427,6 @@ static struct unit_test_suite cryptodev_zuc_testsuite  = {
 			test_zuc_hash_verify_test_case_7),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_zuc_hash_verify_test_case_8),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_verify_test_case_9),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_verify_test_case_10),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_verify_test_case_11),
-
 
 		/** ZUC alg-chain (EEA3/EIA3) */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -16489,15 +16476,27 @@ static struct unit_test_suite cryptodev_zuc_testsuite  = {
 
 		/** ZUC-256 authentication only **/
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc256_authentication_test_case_1),
+			test_zuc256_hash_generate_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_generate_4b_tag_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc256_authentication_test_case_2),
+			test_zuc256_hash_generate_4b_tag_test_case_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_generate_8b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_generate_16b_tag_test_case_1),
 
 		/** ZUC-256 authentication verify only **/
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc256_authentication_verify_test_case_1),
+			test_zuc256_hash_verify_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_verify_4b_tag_test_case_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_verify_4b_tag_test_case_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_verify_8b_tag_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc256_authentication_verify_test_case_2),
+			test_zuc256_hash_verify_16b_tag_test_case_1),
 
 		TEST_CASES_END()
 	}
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/5 test/crypto: fix ZUC digest length in comparison

In reply to Ciara Power

The digest length used in ZUC tests for verifying the digest was hardcoded at 4 bytes, which was suitable for ZUC128 only. Now that ZUC256 is supported by these test functions, the digest length can vary.

Using the test vector digest length directly in these comparisons allows for variable digest length.

Fixes 83397b9f0739 ("test/crypto: add further ZUC test cases")
Fixes fa5bf9345d4e ("test/crypto: add ZUC cases with 256-bit keys")
---
 app/test/test_cryptodev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
app/test/test_cryptodev.c +3 -3
index ca7f10557c..72d359dd91 100644
@@ -4853,7 +4853,7 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			ut_params->digest,
 			tdata->digest.data,
-			4,
+			tdata->digest.len,
 			"ZUC Generated auth tag not as expected");
 	return 0;
 }
@@ -6499,7 +6499,7 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
 		TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			ut_params->digest,
 			tdata->digest.data,
-			DIGEST_BYTE_LENGTH_KASUMI_F9,
+			tdata->digest.len,
 			"ZUC Generated auth tag not as expected");
 	}
 	return 0;
@@ -6706,7 +6706,7 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata,
 		TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			digest,
 			tdata->digest.data,
-			DIGEST_BYTE_LENGTH_KASUMI_F9,
+			tdata->digest.len,
 			"ZUC Generated auth tag not as expected");
 	}
 	return 0;
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/5 test/crypto: fix auth op parameter for ZUC256 tests

In reply to Ciara Power

The incorrect value was being passed to the ZUC authentication test function, indicating the opposite of the intended GENERATE/VERIFY op. This is fixed to use the auth op enum rather than a value.

Fixes 83397b9f0739 ("test/crypto: add further ZUC test cases")
---
 app/test/test_cryptodev.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
app/test/test_cryptodev.c +8 -4
index 72d359dd91..9b90bae206 100644
@@ -7568,13 +7568,15 @@ test_zuc256_decryption_test_case_2(void)
 static int
 test_zuc256_hash_generate_4b_tag_test_case_1(void)
 {
-	return test_zuc_authentication(&zuc256_test_case_auth_1, 0);
+	return test_zuc_authentication(&zuc256_test_case_auth_1,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
 }
 
 static int
 test_zuc256_hash_generate_4b_tag_test_case_2(void)
 {
-	return test_zuc_authentication(&zuc256_test_case_auth_2, 0);
+	return test_zuc_authentication(&zuc256_test_case_auth_2,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
 }
 
 static int
@@ -7601,13 +7603,15 @@ test_zuc256_hash_generate_16b_tag_test_case_1(void)
 static int
 test_zuc256_hash_verify_4b_tag_test_case_1(void)
 {
-	return test_zuc_authentication(&zuc256_test_case_auth_1, 1);
+	return test_zuc_authentication(&zuc256_test_case_auth_1,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
 }
 
 static int
 test_zuc256_hash_verify_4b_tag_test_case_2(void)
 {
-	return test_zuc_authentication(&zuc256_test_case_auth_2, 1);
+	return test_zuc_authentication(&zuc256_test_case_auth_2,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
 }
 
 static int
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/5 test/crypto: fix capability check for ZUC cipher auth

In reply to Ciara Power

The cipher-auth test function for ZUC was not using the improved cipher and auth capability check functions. This meant the required key and IV lengths were not being checked, leading to problems with ZUC256 tests running, and failing, on devices that only support ZUC128.

Fixes 27b787132484 ("test/crypto: check cipher parameters")
Fixes f93fce6de4aa ("test/crypto: check auth parameters")
---
 app/test/test_cryptodev.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)
app/test/test_cryptodev.c +16 -11
index 9b90bae206..80e98ed2c7 100644
@@ -136,6 +136,17 @@ security_proto_supported(enum rte_security_session_action_type action,
 static int
 dev_configure_and_start(uint64_t ff_disable);
 
+static int
+check_cipher_capability(const struct crypto_testsuite_params *ts_params,
+			const enum rte_crypto_cipher_algorithm cipher_algo,
+			const uint16_t key_size, const uint16_t iv_size);
+
+static int
+check_auth_capability(const struct crypto_testsuite_params *ts_params,
+			const enum rte_crypto_auth_algorithm auth_algo,
+			const uint16_t key_size, const uint16_t iv_size,
+			const uint16_t tag_size);
+
 static struct rte_mbuf *
 setup_test_string(struct rte_mempool *mpool,
 		const char *string, size_t len, uint8_t blocksize)
@@ -4761,7 +4772,6 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 	unsigned int plaintext_len;
 
 	struct rte_cryptodev_info dev_info;
-	struct rte_cryptodev_sym_capability_idx cap_idx;
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -4783,19 +4793,14 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 		return TEST_SKIPPED;
 
 	/* Check if device supports ZUC EEA3 */
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_ZUC_EEA3;
-
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
+	if (check_cipher_capability(ts_params, RTE_CRYPTO_CIPHER_ZUC_EEA3,
+			tdata->key.len, tdata->cipher_iv.len) < 0)
 		return TEST_SKIPPED;
 
 	/* Check if device supports ZUC EIA3 */
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	cap_idx.algo.auth = RTE_CRYPTO_AUTH_ZUC_EIA3;
-
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
+	if (check_auth_capability(ts_params, RTE_CRYPTO_AUTH_ZUC_EIA3,
+			tdata->key.len, tdata->auth_iv.len,
+			tdata->digest.len) < 0)
 		return TEST_SKIPPED;
 
 	/* Create ZUC session */
Signature · 1 line
2.25.1
#5 lore raw

PATCH 5/5 test/crypto: add chained ZUC256 testcases

In reply to Ciara Power

Testcases are added for ZUC256 cipher-auth, auth-cipher, and auth-cipher-verify.
4 byte, 8 byte, and 16 byte tags are tested for each chained type.

---
 app/test/test_cryptodev.c                  | 110 ++++
 app/test/test_cryptodev_zuc_test_vectors.h | 714 +++++++++++++++++++++
 2 files changed, 824 insertions(+)
app/test/test_cryptodev.c +110 -0
index 80e98ed2c7..776e025270 100644
@@ -7640,6 +7640,86 @@ test_zuc256_hash_verify_16b_tag_test_case_1(void)
 			RTE_CRYPTO_AUTH_OP_VERIFY);
 }
 
+static int
+test_zuc256_cipher_auth_4b_tag_test_case_1(void)
+{
+	return test_zuc_cipher_auth(&zuc256_test_case_cipher_auth_1);
+}
+
+static int
+test_zuc256_cipher_auth_4b_tag_test_case_2(void)
+{
+	return test_zuc_cipher_auth(&zuc256_test_case_cipher_auth_2);
+}
+
+static int
+test_zuc256_cipher_auth_8b_tag_test_case_1(void)
+{
+	return test_zuc_cipher_auth(&zuc256_test_case_cipher_auth_3);
+}
+
+static int
+test_zuc256_cipher_auth_16b_tag_test_case_1(void)
+{
+	return test_zuc_cipher_auth(&zuc256_test_case_cipher_auth_4);
+}
+
+static int
+test_zuc256_auth_cipher_4b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_1, IN_PLACE, 0);
+}
+
+static int
+test_zuc256_auth_cipher_4b_tag_test_case_2(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_2, IN_PLACE, 0);
+}
+
+static int
+test_zuc256_auth_cipher_8b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_3, IN_PLACE, 0);
+}
+
+static int
+test_zuc256_auth_cipher_16b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_4, IN_PLACE, 0);
+}
+
+static int
+test_zuc256_auth_cipher_verify_4b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_1, IN_PLACE, 1);
+}
+
+static int
+test_zuc256_auth_cipher_verify_4b_tag_test_case_2(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_2, IN_PLACE, 1);
+}
+
+static int
+test_zuc256_auth_cipher_verify_8b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_3, IN_PLACE, 1);
+}
+
+static int
+test_zuc256_auth_cipher_verify_16b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_4, IN_PLACE, 1);
+}
+
 static int
 test_mixed_check_if_unsupported(const struct mixed_cipher_auth_test_data *tdata)
 {
@@ -16507,6 +16587,36 @@ static struct unit_test_suite cryptodev_zuc_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_zuc256_hash_verify_16b_tag_test_case_1),
 
+		/** ZUC-256 encrypt and authenticate **/
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_cipher_auth_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_cipher_auth_4b_tag_test_case_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_cipher_auth_8b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_cipher_auth_16b_tag_test_case_1),
+
+		/** ZUC-256 generate auth, then encrypt */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_4b_tag_test_case_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_8b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_16b_tag_test_case_1),
+
+		/** ZUC-256 decrypt, then verify auth */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_verify_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_verify_4b_tag_test_case_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_verify_8b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_verify_16b_tag_test_case_1),
+
 		TEST_CASES_END()
 	}
 };
app/test/test_cryptodev_zuc_test_vectors.h +714 -0

718 lines not on this page · raw message

Signature · 1 line
2.25.1
#6 lore raw

RE: [PATCH 5/5] test/crypto: add chained ZUC256 testcases

Hi Ciara,

Quoted 14 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Wednesday, March 1, 2023 5:39 PM
To: Akhil Goyal <[email protected]>; Fan Zhang <[email protected]>
Cc: [email protected]; Ji, Kai <[email protected]>; De Lara Guarch, Pablo <[email protected]>; Power, Ciara <[email protected]>
Subject: [PATCH 5/5] test/crypto: add chained ZUC256 testcases

Testcases are added for ZUC256 cipher-auth, auth-cipher, and auth-cipher- verify.
4 byte, 8 byte, and 16 byte tags are tested for each chained type.

...

Quoted 36 lines
app/test/test_cryptodev_zuc_test_vectors.h +29 -0
@@ -1602,4 +1602,718 @@ static struct wireless_test_data
 zuc256_test_case_auth_2 = {
 	}
 };
 
+static struct wireless_test_data zuc256_test_case_cipher_auth_1 = {
+	.key = {
+		.data = {
+			0xf7, 0xb4, 0x04, 0x5a, 0x81, 0x5c, 0x1b, 0x01,
+			0x82, 0xf9, 0xf4, 0x26, 0x80, 0xd4, 0x56, 0x26,
+			0xd5, 0xf7, 0x4b, 0x68, 0x48, 0x6b, 0x92, 0x6a,
+			0x34, 0x1f, 0x86, 0x66, 0x60, 0x0a, 0xfc, 0x57
+		},
+		.len = 32
+	},
+	.cipher_iv = {
+		.data = {
+			0x8e, 0x5d, 0xbc, 0x3f, 0xb9, 0xae, 0x66, 0xa3,
+			0xb9, 0x5c, 0x12, 0x14, 0xdb, 0xc5, 0xbc, 0x18,
+			0x48, 0x12, 0x09, 0x06, 0x25, 0x33, 0x2e, 0x12,
+			0x12
+		},
+		.len = 25
+	},
+	.plaintext = {
+		.data = {
+			0x36, 0xdb, 0x63, 0x68, 0xb5, 0x1f, 0x4e, 0x92,
+			0x46, 0x1f, 0xde, 0xdb, 0xc2, 0xec, 0xfa, 0x7e,
+			0x49, 0x85, 0x77, 0xaa, 0x46, 0x98, 0x30, 0x2d,
+			0x3b, 0xc4, 0x11, 0x24, 0x98, 0x20, 0xa9, 0xce,
+			0xfb, 0x0d, 0x36, 0xb0, 0x2c, 0x85, 0x42, 0x72,
+			0xa4, 0x21, 0x4e, 0x66, 0x0d, 0x48, 0xe4, 0x57,
+			0xce, 0x5b, 0x01, 0x14, 0xf3, 0x31, 0x42, 0x2e,
+			0xf5, 0x53, 0x52, 0x8d, 0x73, 0xfc, 0x5c, 0x6e,

app/test/test_cryptodev_zuc_test_vectors.h static struct wireless_test_data · line 1644

Quoted 10 lines
app/test/test_cryptodev_zuc_test_vectors.h +10 -0
+			0x09, 0x92, 0x1e, 0x35, 0x17, 0x60, 0xa8, 0xbb,
+			0x81, 0xf6, 0x21, 0x8f, 0x3e, 0x05, 0xe6, 0x0c,
+			0x60, 0xe7, 0x21, 0x53, 0x18, 0x63, 0x81, 0x0d,
+			0xb6, 0xd4, 0x9a, 0x29, 0xd0, 0xf6, 0x97, 0xd9,
+			0x89, 0xb5, 0x0e, 0xa0, 0x15, 0xb6, 0x5c, 0x97,
+			0xac, 0x7d, 0x26, 0xeb, 0x83, 0x0c, 0xf7, 0xe3,
+			0xf3, 0x18, 0x37, 0x0b, 0x7b, 0xb8, 0x18, 0x31,
+			0x8c, 0xb2, 0x5a, 0x5c, 0xa9, 0xf1, 0x35, 0x32
+		},
+		.len = 1024

My only comment is that you could use "128 << 3", same as you did with other vectors below, so it's clear that these is 128 bytes passed as bits (same for the lengths below).

#7 lore raw
In reply to Ciara Power

Hi Ciara,

Quoted 25 lines

-----Original Message-----
From: Ciara Power <[email protected]>
Sent: Wednesday 1 March 2023 16:39
Cc: [email protected]; Ji, Kai <[email protected]>; De Lara Guarch, Pablo <[email protected]>; Power, Ciara <[email protected]>
Subject: [PATCH 0/5] test/crypto: add ZUC256 chained tests

This patchset adds chained testcases for each ZUC256 digest size:
- cipher-auth
- auth-cipher
- auth-cipher-verify

To add these tests, some improvements were made to the existing code,
allowing for the user to easily differentiate ZUC256 and ZUC128 tests.

Some fixes are also included, that were highlighted when these new tests
were added.

Ciara Power (5):
test/crypto: improve readability of ZUC256 tests test/crypto: fix ZUC digest length in comparison test/crypto: fix auth op parameter for ZUC256 tests test/crypto: fix capability check for ZUC cipher auth test/crypto: add chained ZUC256 testcases

Quoted 7 lines
 app/test/test_cryptodev.c                  | 280 +++++---
 app/test/test_cryptodev_zuc_test_vectors.h | 714
+++++++++++++++++++++
 2 files changed, 913 insertions(+), 81 deletions(-)

--
2.25.1

#8 lore raw

v2 cover test/crypto: add ZUC256 chained tests

In reply to Ciara Power

This patchset adds chained testcases for each ZUC256 digest size:
- cipher-auth
- auth-cipher
- auth-cipher-verify

To add these tests, some improvements were made to the existing code, allowing for the user to easily differentiate ZUC256 and ZUC128 tests.

Some fixes are also included, that were highlighted when these new tests were added.

v2: changed bit lengths to byte length representation.

Ciara Power (5):
test/crypto: improve readability of ZUC256 tests test/crypto: fix ZUC digest length in comparison test/crypto: fix auth op parameter for ZUC256 tests test/crypto: fix capability check for ZUC cipher auth test/crypto: add chained ZUC256 testcases

 app/test/test_cryptodev.c                  | 280 +++++---
 app/test/test_cryptodev_zuc_test_vectors.h | 714 +++++++++++++++++++++
 2 files changed, 913 insertions(+), 81 deletions(-)
Signature · 1 line
2.25.1
#9 lore raw

PATCH v2 1/5 test/crypto: improve readability of ZUC256 tests

There were some ZUC256 tests for hash generate and hash verify mixed in with the ZUC128 tests, with no indication in the test name that they were for ZUC256.

These are now grouped with other ZUC256 tests, and all ZUC256 hash test names are modified to be more uniform, and indicate the digest length as this can vary with ZUC256.

---
 app/test/test_cryptodev.c | 125 +++++++++++++++++++-------------------
 1 file changed, 62 insertions(+), 63 deletions(-)
app/test/test_cryptodev.c +62 -63
index aa831d79a2..ca7f10557c 100644
@@ -7385,27 +7385,6 @@ test_zuc_hash_generate_test_case_8(void)
 			RTE_CRYPTO_AUTH_OP_GENERATE);
 }
 
-static int
-test_zuc_hash_generate_test_case_9(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,
-			RTE_CRYPTO_AUTH_OP_GENERATE);
-}
-
-static int
-test_zuc_hash_generate_test_case_10(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,
-			RTE_CRYPTO_AUTH_OP_GENERATE);
-}
-
-static int
-test_zuc_hash_generate_test_case_11(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,
-			RTE_CRYPTO_AUTH_OP_GENERATE);
-}
-
 static int
 test_zuc_hash_verify_test_case_1(void)
 {
@@ -7462,27 +7441,6 @@ test_zuc_hash_verify_test_case_8(void)
 			RTE_CRYPTO_AUTH_OP_VERIFY);
 }
 
-static int
-test_zuc_hash_verify_test_case_9(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,
-			RTE_CRYPTO_AUTH_OP_VERIFY);
-}
-
-static int
-test_zuc_hash_verify_test_case_10(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,
-			RTE_CRYPTO_AUTH_OP_VERIFY);
-}
-
-static int
-test_zuc_hash_verify_test_case_11(void)
-{
-	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,
-			RTE_CRYPTO_AUTH_OP_VERIFY);
-}
-
 static int
 test_zuc_cipher_auth_test_case_1(void)
 {
@@ -7608,29 +7566,71 @@ test_zuc256_decryption_test_case_2(void)
 }
 
 static int
-test_zuc256_authentication_test_case_1(void)
+test_zuc256_hash_generate_4b_tag_test_case_1(void)
 {
 	return test_zuc_authentication(&zuc256_test_case_auth_1, 0);
 }
 
 static int
-test_zuc256_authentication_test_case_2(void)
+test_zuc256_hash_generate_4b_tag_test_case_2(void)
 {
 	return test_zuc_authentication(&zuc256_test_case_auth_2, 0);
 }
 
 static int
-test_zuc256_authentication_verify_test_case_1(void)
+test_zuc256_hash_generate_4b_tag_test_case_3(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
+}
+
+static int
+test_zuc256_hash_generate_8b_tag_test_case_1(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
+}
+
+static int
+test_zuc256_hash_generate_16b_tag_test_case_1(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
+}
+
+static int
+test_zuc256_hash_verify_4b_tag_test_case_1(void)
 {
 	return test_zuc_authentication(&zuc256_test_case_auth_1, 1);
 }
 
 static int
-test_zuc256_authentication_verify_test_case_2(void)
+test_zuc256_hash_verify_4b_tag_test_case_2(void)
 {
 	return test_zuc_authentication(&zuc256_test_case_auth_2, 1);
 }
 
+static int
+test_zuc256_hash_verify_4b_tag_test_case_3(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
+}
+
+static int
+test_zuc256_hash_verify_8b_tag_test_case_1(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
+}
+
+static int
+test_zuc256_hash_verify_16b_tag_test_case_1(void)
+{
+	return test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
+}
+
 static int
 test_mixed_check_if_unsupported(const struct mixed_cipher_auth_test_data *tdata)
 {
@@ -16409,12 +16409,6 @@ static struct unit_test_suite cryptodev_zuc_testsuite  = {
 			test_zuc_hash_generate_test_case_7),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_zuc_hash_generate_test_case_8),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_9),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_10),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_11),
 
 		/** ZUC verify (EIA3) */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -16433,13 +16427,6 @@ static struct unit_test_suite cryptodev_zuc_testsuite  = {
 			test_zuc_hash_verify_test_case_7),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_zuc_hash_verify_test_case_8),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_verify_test_case_9),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_verify_test_case_10),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_verify_test_case_11),
-
 
 		/** ZUC alg-chain (EEA3/EIA3) */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -16489,15 +16476,27 @@ static struct unit_test_suite cryptodev_zuc_testsuite  = {
 
 		/** ZUC-256 authentication only **/
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc256_authentication_test_case_1),
+			test_zuc256_hash_generate_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_generate_4b_tag_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc256_authentication_test_case_2),
+			test_zuc256_hash_generate_4b_tag_test_case_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_generate_8b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_generate_16b_tag_test_case_1),
 
 		/** ZUC-256 authentication verify only **/
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc256_authentication_verify_test_case_1),
+			test_zuc256_hash_verify_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_verify_4b_tag_test_case_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_verify_4b_tag_test_case_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_hash_verify_8b_tag_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc256_authentication_verify_test_case_2),
+			test_zuc256_hash_verify_16b_tag_test_case_1),
 
 		TEST_CASES_END()
 	}
Signature · 1 line
2.25.1
#10 lore raw

PATCH v2 2/5 test/crypto: fix ZUC digest length in comparison

In reply to Ciara Power

The digest length used in ZUC tests for verifying the digest was hardcoded at 4 bytes, which was suitable for ZUC128 only. Now that ZUC256 is supported by these test functions, the digest length can vary.

Using the test vector digest length directly in these comparisons allows for variable digest length.

Fixes 83397b9f0739 ("test/crypto: add further ZUC test cases")
Fixes fa5bf9345d4e ("test/crypto: add ZUC cases with 256-bit keys")
---
 app/test/test_cryptodev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
app/test/test_cryptodev.c +3 -3
index ca7f10557c..72d359dd91 100644
@@ -4853,7 +4853,7 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			ut_params->digest,
 			tdata->digest.data,
-			4,
+			tdata->digest.len,
 			"ZUC Generated auth tag not as expected");
 	return 0;
 }
@@ -6499,7 +6499,7 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
 		TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			ut_params->digest,
 			tdata->digest.data,
-			DIGEST_BYTE_LENGTH_KASUMI_F9,
+			tdata->digest.len,
 			"ZUC Generated auth tag not as expected");
 	}
 	return 0;
@@ -6706,7 +6706,7 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata,
 		TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			digest,
 			tdata->digest.data,
-			DIGEST_BYTE_LENGTH_KASUMI_F9,
+			tdata->digest.len,
 			"ZUC Generated auth tag not as expected");
 	}
 	return 0;
Signature · 1 line
2.25.1
#11 lore raw

PATCH v2 3/5 test/crypto: fix auth op parameter for ZUC256 tests

In reply to Ciara Power

The incorrect value was being passed to the ZUC authentication test function, indicating the opposite of the intended GENERATE/VERIFY op. This is fixed to use the auth op enum rather than a value.

Fixes 83397b9f0739 ("test/crypto: add further ZUC test cases")
---
 app/test/test_cryptodev.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
app/test/test_cryptodev.c +8 -4
index 72d359dd91..9b90bae206 100644
@@ -7568,13 +7568,15 @@ test_zuc256_decryption_test_case_2(void)
 static int
 test_zuc256_hash_generate_4b_tag_test_case_1(void)
 {
-	return test_zuc_authentication(&zuc256_test_case_auth_1, 0);
+	return test_zuc_authentication(&zuc256_test_case_auth_1,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
 }
 
 static int
 test_zuc256_hash_generate_4b_tag_test_case_2(void)
 {
-	return test_zuc_authentication(&zuc256_test_case_auth_2, 0);
+	return test_zuc_authentication(&zuc256_test_case_auth_2,
+			RTE_CRYPTO_AUTH_OP_GENERATE);
 }
 
 static int
@@ -7601,13 +7603,15 @@ test_zuc256_hash_generate_16b_tag_test_case_1(void)
 static int
 test_zuc256_hash_verify_4b_tag_test_case_1(void)
 {
-	return test_zuc_authentication(&zuc256_test_case_auth_1, 1);
+	return test_zuc_authentication(&zuc256_test_case_auth_1,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
 }
 
 static int
 test_zuc256_hash_verify_4b_tag_test_case_2(void)
 {
-	return test_zuc_authentication(&zuc256_test_case_auth_2, 1);
+	return test_zuc_authentication(&zuc256_test_case_auth_2,
+			RTE_CRYPTO_AUTH_OP_VERIFY);
 }
 
 static int
Signature · 1 line
2.25.1
#12 lore raw

PATCH v2 4/5 test/crypto: fix capability check for ZUC cipher auth

In reply to Ciara Power

The cipher-auth test function for ZUC was not using the improved cipher and auth capability check functions. This meant the required key and IV lengths were not being checked, leading to problems with ZUC256 tests running, and failing, on devices that only support ZUC128.

Fixes 27b787132484 ("test/crypto: check cipher parameters")
Fixes f93fce6de4aa ("test/crypto: check auth parameters")
---
 app/test/test_cryptodev.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)
app/test/test_cryptodev.c +16 -11
index 9b90bae206..80e98ed2c7 100644
@@ -136,6 +136,17 @@ security_proto_supported(enum rte_security_session_action_type action,
 static int
 dev_configure_and_start(uint64_t ff_disable);
 
+static int
+check_cipher_capability(const struct crypto_testsuite_params *ts_params,
+			const enum rte_crypto_cipher_algorithm cipher_algo,
+			const uint16_t key_size, const uint16_t iv_size);
+
+static int
+check_auth_capability(const struct crypto_testsuite_params *ts_params,
+			const enum rte_crypto_auth_algorithm auth_algo,
+			const uint16_t key_size, const uint16_t iv_size,
+			const uint16_t tag_size);
+
 static struct rte_mbuf *
 setup_test_string(struct rte_mempool *mpool,
 		const char *string, size_t len, uint8_t blocksize)
@@ -4761,7 +4772,6 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 	unsigned int plaintext_len;
 
 	struct rte_cryptodev_info dev_info;
-	struct rte_cryptodev_sym_capability_idx cap_idx;
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -4783,19 +4793,14 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 		return TEST_SKIPPED;
 
 	/* Check if device supports ZUC EEA3 */
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_ZUC_EEA3;
-
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
+	if (check_cipher_capability(ts_params, RTE_CRYPTO_CIPHER_ZUC_EEA3,
+			tdata->key.len, tdata->cipher_iv.len) < 0)
 		return TEST_SKIPPED;
 
 	/* Check if device supports ZUC EIA3 */
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	cap_idx.algo.auth = RTE_CRYPTO_AUTH_ZUC_EIA3;
-
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
+	if (check_auth_capability(ts_params, RTE_CRYPTO_AUTH_ZUC_EIA3,
+			tdata->key.len, tdata->auth_iv.len,
+			tdata->digest.len) < 0)
 		return TEST_SKIPPED;
 
 	/* Create ZUC session */
Signature · 1 line
2.25.1
#13 lore raw

PATCH v2 5/5 test/crypto: add chained ZUC256 testcases

In reply to Ciara Power

Testcases are added for ZUC256 cipher-auth, auth-cipher, and auth-cipher-verify.
4 byte, 8 byte, and 16 byte tags are tested for each chained type.

---
v2: changed from bit to byte length representation

---
 app/test/test_cryptodev.c                  | 110 ++++
 app/test/test_cryptodev_zuc_test_vectors.h | 714 +++++++++++++++++++++
 2 files changed, 824 insertions(+)
app/test/test_cryptodev.c +110 -0
index 80e98ed2c7..776e025270 100644
@@ -7640,6 +7640,86 @@ test_zuc256_hash_verify_16b_tag_test_case_1(void)
 			RTE_CRYPTO_AUTH_OP_VERIFY);
 }
 
+static int
+test_zuc256_cipher_auth_4b_tag_test_case_1(void)
+{
+	return test_zuc_cipher_auth(&zuc256_test_case_cipher_auth_1);
+}
+
+static int
+test_zuc256_cipher_auth_4b_tag_test_case_2(void)
+{
+	return test_zuc_cipher_auth(&zuc256_test_case_cipher_auth_2);
+}
+
+static int
+test_zuc256_cipher_auth_8b_tag_test_case_1(void)
+{
+	return test_zuc_cipher_auth(&zuc256_test_case_cipher_auth_3);
+}
+
+static int
+test_zuc256_cipher_auth_16b_tag_test_case_1(void)
+{
+	return test_zuc_cipher_auth(&zuc256_test_case_cipher_auth_4);
+}
+
+static int
+test_zuc256_auth_cipher_4b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_1, IN_PLACE, 0);
+}
+
+static int
+test_zuc256_auth_cipher_4b_tag_test_case_2(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_2, IN_PLACE, 0);
+}
+
+static int
+test_zuc256_auth_cipher_8b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_3, IN_PLACE, 0);
+}
+
+static int
+test_zuc256_auth_cipher_16b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_4, IN_PLACE, 0);
+}
+
+static int
+test_zuc256_auth_cipher_verify_4b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_1, IN_PLACE, 1);
+}
+
+static int
+test_zuc256_auth_cipher_verify_4b_tag_test_case_2(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_2, IN_PLACE, 1);
+}
+
+static int
+test_zuc256_auth_cipher_verify_8b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_3, IN_PLACE, 1);
+}
+
+static int
+test_zuc256_auth_cipher_verify_16b_tag_test_case_1(void)
+{
+	return test_zuc_auth_cipher(
+		&zuc256_auth_cipher_test_case_4, IN_PLACE, 1);
+}
+
 static int
 test_mixed_check_if_unsupported(const struct mixed_cipher_auth_test_data *tdata)
 {
@@ -16507,6 +16587,36 @@ static struct unit_test_suite cryptodev_zuc_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_zuc256_hash_verify_16b_tag_test_case_1),
 
+		/** ZUC-256 encrypt and authenticate **/
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_cipher_auth_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_cipher_auth_4b_tag_test_case_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_cipher_auth_8b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_cipher_auth_16b_tag_test_case_1),
+
+		/** ZUC-256 generate auth, then encrypt */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_4b_tag_test_case_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_8b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_16b_tag_test_case_1),
+
+		/** ZUC-256 decrypt, then verify auth */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_verify_4b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_verify_4b_tag_test_case_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_verify_8b_tag_test_case_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_zuc256_auth_cipher_verify_16b_tag_test_case_1),
+
 		TEST_CASES_END()
 	}
 };
app/test/test_cryptodev_zuc_test_vectors.h +714 -0

718 lines not on this page · raw message

Signature · 1 line
2.25.1
Acked-by on the v2 series
#14 lore raw
In reply to Ciara Power
Quoted 36 lines

-----Original Message-----
From: Ciara Power <[email protected]>
Sent: Friday, March 3, 2023 3:08 PM
Cc: [email protected]; [email protected]; [email protected]; Ciara Power <[email protected]>
Subject: [EXT] [PATCH v2 0/5] test/crypto: add ZUC256 chained tests

External Email

----------------------------------------------------------------------
This patchset adds chained testcases for each ZUC256 digest size:
- cipher-auth
- auth-cipher
- auth-cipher-verify

To add these tests, some improvements were made to the existing code,
allowing for the user to easily differentiate ZUC256 and ZUC128 tests.

Some fixes are also included, that were highlighted when these new tests
were added.

v2: changed bit lengths to byte length representation.

Ciara Power (5):
test/crypto: improve readability of ZUC256 tests test/crypto: fix ZUC digest length in comparison test/crypto: fix auth op parameter for ZUC256 tests test/crypto: fix capability check for ZUC cipher auth test/crypto: add chained ZUC256 testcases

 app/test/test_cryptodev.c                  | 280 +++++---
 app/test/test_cryptodev_zuc_test_vectors.h | 714 +++++++++++++++++++++
 2 files changed, 913 insertions(+), 81 deletions(-)

--
2.25.1

#15 lore raw
In reply to Ciara Power
Quoted 29 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Friday, March 3, 2023 10:38 AM
Cc: [email protected]; Ji, Kai <[email protected]>; De Lara Guarch, Pablo <[email protected]>; Power, Ciara <[email protected]>
Subject: [PATCH v2 0/5] test/crypto: add ZUC256 chained tests

This patchset adds chained testcases for each ZUC256 digest size:
- cipher-auth
- auth-cipher
- auth-cipher-verify

To add these tests, some improvements were made to the existing code,
allowing for the user to easily differentiate ZUC256 and ZUC128 tests.

Some fixes are also included, that were highlighted when these new tests
were added.

v2: changed bit lengths to byte length representation.

Ciara Power (5):
test/crypto: improve readability of ZUC256 tests test/crypto: fix ZUC digest length in comparison test/crypto: fix auth op parameter for ZUC256 tests test/crypto: fix capability check for ZUC cipher auth test/crypto: add chained ZUC256 testcases

Quoted 6 lines
 app/test/test_cryptodev.c                  | 280 +++++---
 app/test/test_cryptodev_zuc_test_vectors.h | 714 +++++++++++++++++++++
 2 files changed, 913 insertions(+), 81 deletions(-)

--
2.25.1

Applied
#16 lore raw
Quoted 22 lines
Quoted 22 lines

Subject: [PATCH v2 0/5] test/crypto: add ZUC256 chained tests

This patchset adds chained testcases for each ZUC256 digest size:
- cipher-auth
- auth-cipher
- auth-cipher-verify

To add these tests, some improvements were made to the existing code,
allowing for the user to easily differentiate ZUC256 and ZUC128 tests.

Some fixes are also included, that were highlighted when these new tests
were added.

v2: changed bit lengths to byte length representation.

Ciara Power (5):
test/crypto: improve readability of ZUC256 tests test/crypto: fix ZUC digest length in comparison test/crypto: fix auth op parameter for ZUC256 tests test/crypto: fix capability check for ZUC cipher auth test/crypto: add chained ZUC256 testcases

Quoted 8 lines
Quoted 6 lines
 app/test/test_cryptodev.c                  | 280 +++++---
 app/test/test_cryptodev_zuc_test_vectors.h | 714 +++++++++++++++++++++
 2 files changed, 913 insertions(+), 81 deletions(-)

--
2.25.1

Applied to dpdk-next-crypto

Thanks.