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.

Signed-off-by: Ciara Power <ciara.po...@intel.com>
Acked-by: Brian Dooley <brian.doo...@intel.com>
---
 app/test/test_cryptodev.c | 125 +++++++++++++++++++-------------------
 1 file changed, 62 insertions(+), 63 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index aa831d79a2..ca7f10557c 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -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()
        }
-- 
2.25.1

Reply via email to