From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E434041DAC; Wed, 1 Mar 2023 17:39:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA3DA427F2; Wed, 1 Mar 2023 17:39:24 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 638AC4114A for ; Wed, 1 Mar 2023 17:39:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677688763; x=1709224763; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DPHlEY6z92h9oGrA+fOjcnebRiitHJpCorfvA7Neep0=; b=BNaNcdtsBDDp2EhYpXEyQb+DnlsbrZtGyc10OEAtxX1S9N9C+bh39oUy OtTf+5Lc7N/WS28XoeMZXiFBRGF4JZKN4fOEc3RHlY8Hj1hoqsy94X9Dm x/LhiAeyQYOaih40+Sqbzn7RzeZgk8DPNxERC2/H5erxKrxa/XbWrtq1e ktGmppkRngBsYtvzDSO0m3Sv6omYt4hCQUoWUdCn3SPbgbaRVkSkF6oaj +/SUo8apL118g0SmWhkqZsPlSOOjSAHeQLMpX8Da3SXB3eRCBQ6gRoGZ6 zad9Y4QGK2FihQFhqnyoHgGQMzHdeoabc0UyD1qnveMWgB6//Gt9Du0Qi A==; X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="362039448" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="362039448" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2023 08:39:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="667922803" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="667922803" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.80]) by orsmga007.jf.intel.com with ESMTP; 01 Mar 2023 08:39:20 -0800 From: Ciara Power To: Akhil Goyal , Fan Zhang Cc: dev@dpdk.org, kai.ji@intel.com, pablo.de.lara.guarch@intel.com, Ciara Power Subject: [PATCH 1/5] test/crypto: improve readability of ZUC256 tests Date: Wed, 1 Mar 2023 16:39:12 +0000 Message-Id: <20230301163916.2248543-2-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301163916.2248543-1-ciara.power@intel.com> References: <20230301163916.2248543-1-ciara.power@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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