From patchwork Wed Mar 1 16:39:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124611 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 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() } From patchwork Wed Mar 1 16:39:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124612 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 61BC941DAC; Wed, 1 Mar 2023 17:39:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4F9442B8B; Wed, 1 Mar 2023 17:39:26 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id B4B3B42B71; Wed, 1 Mar 2023 17:39:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677688766; x=1709224766; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/2ZMUKjLMIWQi7wrNJzehcvThTIIrJTZVe4szZBtVgQ=; b=Ert93ZsqxM1HqVmdPcYhM6zAV/R5RI/m/Jk0URrm6xZ+ja9ujdlaUGpk 1sSJcZ0xJBhiPJRFdffaceMhCMHF44n2iEFRu74rU3ySCAQsxBIskJkhJ yI7i5zu8ipxMVoaF8LTfsI0qSBf/ee/cHSt2ddBTxGujfIJe6Ik14Pqej DHHRTAqjWdF3W707KKKW0P6q0VjSCOPX9qPi8d+3rv1OnOOEdSDo6geKK 2j3opapX9cNIDfii85kDqj6eJv0F2kYHov534ph3BOqSdPt0Mdic2wBTW Obo97Jq5bFCvUUxiWVQ0wFrt/TFXA/NillIf/+RVK2JhWL79g9ehTp5UU A==; X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="362039459" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="362039459" 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:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="667922816" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="667922816" 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:22 -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 , vvelumuri@marvell.com, stable@dpdk.org Subject: [PATCH 2/5] test/crypto: fix ZUC digest length in comparison Date: Wed, 1 Mar 2023 16:39:13 +0000 Message-Id: <20230301163916.2248543-3-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 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 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") Cc: vvelumuri@marvell.com Cc: stable@dpdk.org Signed-off-by: Ciara Power --- app/test/test_cryptodev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index ca7f10557c..72d359dd91 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -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; From patchwork Wed Mar 1 16:39:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124613 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 69D0841DAC; Wed, 1 Mar 2023 17:39:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E7EA42BB1; Wed, 1 Mar 2023 17:39:29 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id A5E7D42BAC for ; Wed, 1 Mar 2023 17:39:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677688767; x=1709224767; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gyWw3h3uZfgwmTp2J4Ce2P5O8cItetHjAmnY3Cu9u1c=; b=JUkfgMMyaC14Q5Ztm/agsNJBwL6G6ikQWPCDXwWZyGgHTVh7hOGKN3aL DHpLQzXzcreov9NkCYOjL80uIxXL/zALHJVhm8drPTwy+n7ciMekfBaNr QVCsQEwHSyf4kx5EsZiGbjuj0U9Zr9r/revnT+iT/XAILAHMGgbk9JN6T o9pc+h0rQw4pm93j5SKOh9StHby9kjACcYhuvOOjTuwLmvoUpdegVll39 1zsF+oYx5Re2tqgKzKimKJyyNNpyKWJ0kmK+MTPA8yQoa9sYfWSk+9lzQ YQPCIq1Bv95I3L7R3ArTLvS8+TVcvj3td1cEQODIgxsECxcLMAFvN4JT5 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="362039473" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="362039473" 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:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="667922837" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="667922837" 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:25 -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 3/5] test/crypto: fix auth op parameter for ZUC256 tests Date: Wed, 1 Mar 2023 16:39:14 +0000 Message-Id: <20230301163916.2248543-4-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 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 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") Signed-off-by: Ciara Power --- app/test/test_cryptodev.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 72d359dd91..9b90bae206 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -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 From patchwork Wed Mar 1 16:39:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124614 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77A2841DAC; Wed, 1 Mar 2023 17:39:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 881E542D12; Wed, 1 Mar 2023 17:39:33 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id E7D6542BFE; Wed, 1 Mar 2023 17:39:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677688771; x=1709224771; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HZNV2s4VSJPyxR30T2QPRfkC/IAL0e/+9Viap4Q5tk8=; b=dilqwbTe8ud4d6pUoFHz1rtlvDCSRHxY7nEEhglDXhRxZ4FXcYIz7sj4 IgQB9J6dMDaA6ohc1Lyi0MGWqCiJsLspIivl6IXORR7LSgXbHq5ZSWY0F VdwUH4wJ2p3/Vf2fJy9BMIeDhxW6KzNawKR7ux621R+Mcfb6vgiIYF7Sl yv8icfmEGXGi0qlvatKKUnyyZ1HlFr7+KFDuB3GTCdt8QNhwBeGZry1v0 lTiZ8zti1I7D0M0liCwv8kZnf8EIprMHUDF6UJkoxrhl6FNmDF6xPODgc NknYjJYDpBaHRt3uuwGOdytDIaJsOij8fCX2MUKJYSorO5jST69jGj9Fn A==; X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="362039483" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="362039483" 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:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="667922853" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="667922853" 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:27 -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 , stable@dpdk.org Subject: [PATCH 4/5] test/crypto: fix capability check for ZUC cipher auth Date: Wed, 1 Mar 2023 16:39:15 +0000 Message-Id: <20230301163916.2248543-5-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 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 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") Cc: pablo.de.lara.guarch@intel.com Cc: stable@dpdk.org Signed-off-by: Ciara Power --- app/test/test_cryptodev.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 9b90bae206..80e98ed2c7 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -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 */ From patchwork Wed Mar 1 16:39:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124615 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C748041DAC; Wed, 1 Mar 2023 17:39:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF57942C54; Wed, 1 Mar 2023 17:39:35 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id F2A5942C4D for ; Wed, 1 Mar 2023 17:39:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677688773; x=1709224773; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=shNg8q0EJoU4poO1u29YLjDJvf9fBtr+hZOcmYTzZ5M=; b=RK9RNT8K3OJezSRZfb/W8itH/xEdUp0Ks4bgIOmdVq96aiCVoDLfJTDW cZmO0gGng0YKhsy7nI7O6M5IlJZCMjI87z16/RKCwhuZcTvUKU4lX1lKK GQUNB3NxGc7aa2yPKXlEP0S6AqnT0Lq9VYlxQRr9m3Vx6d94cx2GMCPsr 7iqPoaOcFSqdmdI+9gZBQu8n54AqX9MxsADpvPe5eKd0HMOqfaKp7rQj5 +RaZlJlJffPGIMqyU96BKg9Rk3SPo22UU4BaoiQtGDDAc+15mA0QdNk+M VaxHxTJHHGISlwEt7qVXJngAuy6I2IKnzoSIAPZ4Fo/U/KwX2ohW9NDcR g==; X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="362039492" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="362039492" 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:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="667922865" X-IronPort-AV: E=Sophos;i="5.98,225,1673942400"; d="scan'208";a="667922865" 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:29 -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 5/5] test/crypto: add chained ZUC256 testcases Date: Wed, 1 Mar 2023 16:39:16 +0000 Message-Id: <20230301163916.2248543-6-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 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 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. Signed-off-by: Ciara Power --- app/test/test_cryptodev.c | 110 ++++ app/test/test_cryptodev_zuc_test_vectors.h | 714 +++++++++++++++++++++ 2 files changed, 824 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 80e98ed2c7..776e025270 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -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() } }; diff --git a/app/test/test_cryptodev_zuc_test_vectors.h b/app/test/test_cryptodev_zuc_test_vectors.h index 25297a2f8b..374068b846 100644 --- a/app/test/test_cryptodev_zuc_test_vectors.h +++ b/app/test/test_cryptodev_zuc_test_vectors.h @@ -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, + 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 + }, + .ciphertext = { + .data = { + 0xa6, 0xe5, 0x71, 0x58, 0x5c, 0xcf, 0x5d, 0x0d, + 0x59, 0xb5, 0x51, 0xab, 0xf5, 0xfa, 0x31, 0xf9, + 0x8d, 0x4f, 0xf0, 0x3c, 0x7d, 0x61, 0x8d, 0x7a, + 0x6b, 0xcb, 0x2c, 0x79, 0xca, 0x99, 0x06, 0x6f, + 0xff, 0x5d, 0x12, 0x5f, 0x0e, 0x7a, 0x33, 0x6b, + 0x51, 0xbc, 0x58, 0x53, 0xff, 0xbd, 0x85, 0xc9, + 0xac, 0x5f, 0x33, 0xc2, 0xa2, 0xf1, 0x17, 0x7a, + 0xd9, 0x3f, 0x81, 0x82, 0x2f, 0x0a, 0xb0, 0xaf, + 0xb9, 0x19, 0x3b, 0xfa, 0xcd, 0xa4, 0x06, 0x81, + 0x2a, 0x7a, 0xbf, 0x2c, 0x07, 0xde, 0xc1, 0xa4, + 0x8c, 0x15, 0x85, 0x81, 0xa6, 0xd3, 0x73, 0x1c, + 0x29, 0x0b, 0xee, 0x3c, 0x57, 0xfa, 0x82, 0xad, + 0x6f, 0xe0, 0xa1, 0x54, 0x8d, 0xa4, 0x92, 0x29, + 0xf4, 0xfa, 0x6d, 0x01, 0xe3, 0x6c, 0xb9, 0x76, + 0x80, 0x53, 0xbb, 0x27, 0xb8, 0x18, 0x47, 0x6c, + 0xae, 0xb5, 0x44, 0x60, 0x43, 0x9d, 0xa7, 0x3f + }, + .len = 1024 + }, + .validDataLenInBits = { + .len = 1024 + }, + .validCipherLenInBits = { + .len = 1024 + }, + .auth_iv = { + .data = { + 0xf5, 0x8d, 0x08, 0x26, 0x94, 0x14, 0xc7, 0x4d, + 0xf5, 0x7c, 0x9c, 0xaa, 0x45, 0x53, 0xfd, 0x85, + 0x23, 0x0b, 0x00, 0x0e, 0x26, 0x2b, 0x0f, 0x01, + 0x26 + }, + .len = 25 + }, + .digest = { + .data = {0x95, 0x86, 0xe4, 0x46}, + .len = 4 + }, + .validAuthLenInBits = { + .len = 1024 + } +}; + +static struct wireless_test_data zuc256_test_case_cipher_auth_2 = { + .key = { + .data = { + 0x1d, 0x0f, 0x0e, 0x75, 0x86, 0xb3, 0xfc, 0x65, + 0x94, 0xbf, 0xaa, 0xa8, 0xf5, 0xd0, 0x0f, 0xe8, + 0x14, 0x7a, 0x96, 0x61, 0x15, 0x49, 0x79, 0x71, + 0x13, 0x82, 0xb4, 0xae, 0x34, 0x04, 0x75, 0x51 + }, + .len = 32 + }, + .cipher_iv = { + .data = { + 0x98, 0xcc, 0x89, 0x9f, 0xaf, 0x6d, 0x64, 0xb6, + 0xb1, 0xe8, 0x21, 0x72, 0xee, 0xb6, 0xcc, 0xe3, + 0xcf, 0x32, 0x28, 0x21, 0x21, 0x0d, 0x1e, 0x1c, + 0x34 + }, + .len = 25 + }, + .plaintext = { + .data = { + 0xa4, 0xcb, 0x6e, 0x76, 0x99, 0xfb, 0x0c, 0xab, + 0x6d, 0x57, 0xb1, 0x69, 0xc0, 0x47, 0x80, 0x63, + 0x00, 0xe1, 0xf9, 0x51, 0x10, 0xbe, 0xc0, 0x0f, + 0x99, 0x62, 0x2d, 0x71, 0xca, 0x75, 0xa0, 0x6e, + 0x41, 0x0e, 0xe4, 0xda, 0x09, 0xf1, 0x86, 0x76, + 0x48, 0x37, 0xe0, 0x08, 0x7e, 0x60, 0x6c, 0x7f, + 0x41, 0x65, 0xd0, 0x51, 0x24, 0x91, 0x61, 0xbd, + 0xf3, 0x8e, 0x2e, 0xbd, 0x04, 0xce, 0x2b, 0x45, + 0xdc, 0x0f, 0x1f, 0xe5, 0x00, 0xa5, 0x5c, 0x48, + 0xdd, 0x3c, 0x51, 0x5b, 0x9c, 0xbd, 0xda, 0xde, + 0x22, 0xab, 0x2f, 0x46, 0x3c, 0x90, 0x03, 0x2f, + 0x1f, 0x31, 0xec, 0x23, 0xff, 0x17, 0x68, 0xdb, + 0x26, 0x87, 0xc1, 0x27, 0x2d, 0x1d, 0x6f, 0x0a, + 0x59, 0xc0, 0x65, 0xf5, 0x7d, 0x40, 0xd3, 0xa0, + 0xeb, 0x03, 0xe6, 0x27, 0x93, 0xea, 0x56, 0xb2, + 0x1b, 0x42, 0xd5, 0x1b, 0x59, 0x3d, 0xf6, 0x7f, + 0xc5, 0xb7, 0xa6, 0xf2, 0xd4, 0x16, 0xfc, 0x2d, + 0xd6, 0x61, 0x23, 0x54, 0xa1, 0xf6, 0xf4, 0x8c, + 0xf9, 0xda, 0xb3, 0x8d, 0xc4, 0x09, 0x3f, 0xe0, + 0x4b, 0x15, 0xfb, 0xa4, 0x52, 0xf1, 0x24, 0x17, + 0xa9, 0xca, 0x09, 0x7d, 0xe0, 0x05, 0xab, 0xb7, + 0x67, 0xce, 0x0b, 0x08, 0xc4, 0xff, 0x95, 0xbe, + 0xd9, 0x48, 0x4b, 0x9e, 0x52, 0x8a, 0x7e, 0x9d, + 0x9f, 0x79, 0x42, 0xf2, 0x6a, 0x66, 0x09, 0x13, + 0x30, 0x13, 0x91, 0x11, 0x18, 0x3c, 0xc8, 0x7f, + 0x0a, 0xd3, 0x88, 0xce, 0xd2, 0x1d, 0x8c, 0xab, + 0x65, 0xd7, 0x49, 0xb7, 0x62, 0xc7, 0x55, 0x01, + 0x40, 0x97, 0xf3, 0xab, 0xfd, 0xfd, 0xbe, 0x2d, + 0x10, 0x4f, 0x3e, 0x28, 0x8b, 0x06, 0xa8, 0x95, + 0xd9, 0x30, 0x64, 0xab, 0x4d, 0xf0, 0x57, 0xb2, + 0xc8 + }, + .len = 1928 + }, + .ciphertext = { + .data = { + 0xd0, 0xf9, 0xff, 0xce, 0x03, 0x81, 0x14, 0x9c, + 0xd5, 0xf2, 0xbf, 0xe5, 0xff, 0xc8, 0x15, 0x4a, + 0x9c, 0x06, 0x2b, 0x17, 0x99, 0xe3, 0x48, 0x70, + 0x37, 0x01, 0x5e, 0x24, 0x80, 0x9a, 0x46, 0x4e, + 0xa8, 0xc0, 0x59, 0xd7, 0x03, 0x74, 0x28, 0x91, + 0x79, 0xb4, 0xb5, 0xd6, 0x52, 0x92, 0x04, 0x77, + 0x5b, 0x4f, 0x34, 0xd1, 0xbe, 0xaa, 0x74, 0xd9, + 0x01, 0x40, 0x24, 0xc7, 0x8c, 0x62, 0x2a, 0x51, + 0x5a, 0x58, 0x0e, 0xc8, 0x70, 0x12, 0x06, 0x1c, + 0x62, 0x7f, 0xf5, 0x23, 0xcb, 0x3c, 0xc1, 0xbe, + 0x8b, 0x7f, 0x9d, 0x12, 0xb8, 0x26, 0xc8, 0xa3, + 0x77, 0x7e, 0x83, 0xda, 0x83, 0xe1, 0x9f, 0xef, + 0x33, 0x62, 0x17, 0xa7, 0x74, 0x68, 0x34, 0x5e, + 0x16, 0xcc, 0xbc, 0x6c, 0x33, 0x2f, 0x73, 0xf0, + 0xfc, 0xe5, 0x2c, 0x2d, 0xfb, 0x81, 0xbe, 0x1e, + 0x6e, 0x4f, 0xf4, 0x14, 0x37, 0x7c, 0x97, 0xac, + 0xa9, 0xac, 0x68, 0x95, 0xf3, 0x55, 0xb3, 0xfb, + 0xf6, 0x64, 0xd9, 0x1b, 0xe1, 0x54, 0x79, 0x6e, + 0xfa, 0x21, 0xa4, 0x19, 0x9f, 0xb4, 0x4b, 0xb7, + 0xef, 0x52, 0xd8, 0x44, 0x75, 0x99, 0x07, 0x6d, + 0xa9, 0xcf, 0x32, 0xc5, 0xc1, 0x31, 0x0c, 0xa8, + 0x86, 0x40, 0x75, 0xeb, 0x12, 0xcf, 0x26, 0x5c, + 0x5f, 0xa3, 0x3c, 0xb6, 0x12, 0x45, 0xf3, 0x0a, + 0x38, 0x09, 0xa8, 0x36, 0x32, 0x4a, 0x2f, 0xad, + 0x50, 0x11, 0x38, 0xba, 0x8f, 0xdd, 0xd1, 0x58, + 0xd7, 0x3d, 0x3a, 0x40, 0x7c, 0x3f, 0xa7, 0x98, + 0xf3, 0x12, 0x7f, 0x9f, 0x89, 0xcf, 0x48, 0x58, + 0x01, 0xeb, 0x98, 0x7c, 0x59, 0x11, 0x9f, 0x57, + 0x74, 0x5f, 0x70, 0x72, 0x74, 0xa4, 0x82, 0x3c, + 0x36, 0xe6, 0x31, 0x9e, 0xba, 0x7b, 0x53, 0xfc, + 0x56 + }, + .len = 1928 + }, + .validDataLenInBits = { + .len = 1928 + }, + .validCipherLenInBits = { + .len = 1928 + }, + .auth_iv = { + .data = { + 0x60, 0xaa, 0xd2, 0xb2, 0xd0, 0x85, 0xfa, 0x54, + 0xd8, 0x35, 0xe8, 0xd4, 0x66, 0x82, 0x64, 0x98, + 0xd9, 0x2a, 0x08, 0x1d, 0x35, 0x19, 0x17, 0x01, + 0x1A + }, + .len = 25 + }, + .digest = { + .data = {0x2c, 0x48, 0x3a, 0xe5}, + .len = 4 + }, + .validAuthLenInBits = { + .len = 1928 + } +}; + +static struct wireless_test_data zuc256_test_case_cipher_auth_3 = { + .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, + 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 + }, + .ciphertext = { + .data = { + 0xa6, 0xe5, 0x71, 0x58, 0x5c, 0xcf, 0x5d, 0x0d, + 0x59, 0xb5, 0x51, 0xab, 0xf5, 0xfa, 0x31, 0xf9, + 0x8d, 0x4f, 0xf0, 0x3c, 0x7d, 0x61, 0x8d, 0x7a, + 0x6b, 0xcb, 0x2c, 0x79, 0xca, 0x99, 0x06, 0x6f, + 0xff, 0x5d, 0x12, 0x5f, 0x0e, 0x7a, 0x33, 0x6b, + 0x51, 0xbc, 0x58, 0x53, 0xff, 0xbd, 0x85, 0xc9, + 0xac, 0x5f, 0x33, 0xc2, 0xa2, 0xf1, 0x17, 0x7a, + 0xd9, 0x3f, 0x81, 0x82, 0x2f, 0x0a, 0xb0, 0xaf, + 0xb9, 0x19, 0x3b, 0xfa, 0xcd, 0xa4, 0x06, 0x81, + 0x2a, 0x7a, 0xbf, 0x2c, 0x07, 0xde, 0xc1, 0xa4, + 0x8c, 0x15, 0x85, 0x81, 0xa6, 0xd3, 0x73, 0x1c, + 0x29, 0x0b, 0xee, 0x3c, 0x57, 0xfa, 0x82, 0xad, + 0x6f, 0xe0, 0xa1, 0x54, 0x8d, 0xa4, 0x92, 0x29, + 0xf4, 0xfa, 0x6d, 0x01, 0xe3, 0x6c, 0xb9, 0x76, + 0x80, 0x53, 0xbb, 0x27, 0xb8, 0x18, 0x47, 0x6c, + 0xae, 0xb5, 0x44, 0x60, 0x43, 0x9d, 0xa7, 0x3f + }, + .len = 1024 + }, + .validDataLenInBits = { + .len = 1024 + }, + .validCipherLenInBits = { + .len = 1024 + }, + .auth_iv = { + .data = { + 0xf5, 0x8d, 0x08, 0x26, 0x94, 0x14, 0xc7, 0x4d, + 0xf5, 0x7c, 0x9c, 0xaa, 0x45, 0x53, 0xfd, 0x85, + 0x23, 0x0b, 0x00, 0x0e, 0x26, 0x2b, 0x0f, 0x01, + 0x26 + }, + .len = 25 + }, + .digest = { + .data = {0xD5, 0x2F, 0xC4, 0x2B, 0xC2, 0x03, 0xAC, 0xF7}, + .len = 8 + }, + .validAuthLenInBits = { + .len = 1024 + } +}; + +static struct wireless_test_data zuc256_test_case_cipher_auth_4 = { + .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, + 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 + }, + .ciphertext = { + .data = { + 0xa6, 0xe5, 0x71, 0x58, 0x5c, 0xcf, 0x5d, 0x0d, + 0x59, 0xb5, 0x51, 0xab, 0xf5, 0xfa, 0x31, 0xf9, + 0x8d, 0x4f, 0xf0, 0x3c, 0x7d, 0x61, 0x8d, 0x7a, + 0x6b, 0xcb, 0x2c, 0x79, 0xca, 0x99, 0x06, 0x6f, + 0xff, 0x5d, 0x12, 0x5f, 0x0e, 0x7a, 0x33, 0x6b, + 0x51, 0xbc, 0x58, 0x53, 0xff, 0xbd, 0x85, 0xc9, + 0xac, 0x5f, 0x33, 0xc2, 0xa2, 0xf1, 0x17, 0x7a, + 0xd9, 0x3f, 0x81, 0x82, 0x2f, 0x0a, 0xb0, 0xaf, + 0xb9, 0x19, 0x3b, 0xfa, 0xcd, 0xa4, 0x06, 0x81, + 0x2a, 0x7a, 0xbf, 0x2c, 0x07, 0xde, 0xc1, 0xa4, + 0x8c, 0x15, 0x85, 0x81, 0xa6, 0xd3, 0x73, 0x1c, + 0x29, 0x0b, 0xee, 0x3c, 0x57, 0xfa, 0x82, 0xad, + 0x6f, 0xe0, 0xa1, 0x54, 0x8d, 0xa4, 0x92, 0x29, + 0xf4, 0xfa, 0x6d, 0x01, 0xe3, 0x6c, 0xb9, 0x76, + 0x80, 0x53, 0xbb, 0x27, 0xb8, 0x18, 0x47, 0x6c, + 0xae, 0xb5, 0x44, 0x60, 0x43, 0x9d, 0xa7, 0x3f + }, + .len = 1024 + }, + .validDataLenInBits = { + .len = 1024 + }, + .validCipherLenInBits = { + .len = 1024 + }, + .auth_iv = { + .data = { + 0xf5, 0x8d, 0x08, 0x26, 0x94, 0x14, 0xc7, 0x4d, + 0xf5, 0x7c, 0x9c, 0xaa, 0x45, 0x53, 0xfd, 0x85, + 0x23, 0x0b, 0x00, 0x0e, 0x26, 0x2b, 0x0f, 0x01, + 0x26 + }, + .len = 25 + }, + .digest = { + .data = { + 0x8B, 0x31, 0x9E, 0x86, 0x7F, 0xB1, 0x94, 0xE5, + 0xA5, 0x53, 0x73, 0xC5, 0x59, 0xD5, 0x6D, 0x37 + }, + .len = 16 + }, + .validAuthLenInBits = { + .len = 1024 + } +}; + +struct wireless_test_data zuc256_auth_cipher_test_case_1 = { + .key = { + .data = { + 0xe3, 0x8e, 0xaf, 0x08, 0xde, 0x8c, 0x08, 0x41, + 0x7f, 0x2b, 0x97, 0x20, 0x10, 0x87, 0xc7, 0xf7, + 0xbe, 0x3c, 0xd2, 0x68, 0x80, 0x10, 0x1e, 0x71, + 0xfd, 0xb2, 0xbb, 0xad, 0x25, 0x0f, 0x06, 0x08 + }, + .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 + }, + .auth_iv = { + .data = { + 0xf5, 0x8d, 0x08, 0x26, 0x94, 0x14, 0xc7, 0x4d, + 0xf5, 0x7c, 0x9c, 0xaa, 0x45, 0x53, 0xfd, 0x85, + 0x23, 0x0b, 0x00, 0x0e, 0x26, 0x2b, 0x0f, 0x01, + 0x26 + }, + .len = 25 + }, + .plaintext = { + .data = { + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A + }, + .len = 128 << 3 + }, + .ciphertext = { + .data = { + 0xF8, 0xBA, 0xBD, 0x3E, 0x52, 0xC7, 0xF9, 0x86, + 0x5F, 0xA3, 0x84, 0xE8, 0x20, 0xE1, 0xBB, 0x80, + 0xDB, 0x2D, 0x02, 0xA7, 0x35, 0x6A, 0x54, 0x98, + 0x90, 0x32, 0xCE, 0x99, 0xE7, 0x66, 0x0E, 0x5D, + 0x43, 0xBB, 0x4D, 0xF3, 0x4A, 0xB7, 0x9F, 0x3B, + 0x44, 0xFF, 0x0D, 0xB9, 0xAE, 0xEA, 0xAB, 0x95, + 0x5F, 0xA7, 0x39, 0x6D, 0xBC, 0x72, 0x59, 0x8B, + 0x75, 0xD3, 0x7E, 0xC6, 0x90, 0x7B, 0xE7, 0x3C, + 0x12, 0x38, 0xDD, 0x50, 0xD6, 0x74, 0x91, 0x02, + 0x66, 0x3D, 0xBA, 0x59, 0x1B, 0x93, 0xED, 0x87, + 0xAB, 0xD7, 0x2E, 0xEF, 0xFF, 0x80, 0x98, 0x7E, + 0x0F, 0x2A, 0x4E, 0x5F, 0xEB, 0x3A, 0x0E, 0xCC, + 0xBF, 0xDA, 0x67, 0xA0, 0x54, 0xC6, 0x56, 0x29, + 0x5D, 0x3C, 0x1A, 0x73, 0xA7, 0xE3, 0xC9, 0xD2, + 0x08, 0x33, 0x73, 0x13, 0xEC, 0x56, 0x59, 0x11, + 0xC9, 0x8A, 0x4B, 0x7A, 0xB1, 0xDD, 0x55, 0x9B + }, + .len = 128 << 3 + }, + .validDataLenInBits = { + .len = 128 << 3 + }, + .validCipherLenInBits = { + .len = 128 << 3 + }, + .validAuthLenInBits = { + .len = 124 << 3 + }, + .digest = { + .data = {0xB1, 0xDD, 0x55, 0x9B}, + .len = 4, + .offset_bytes = 124 + } +}; + +struct wireless_test_data zuc256_auth_cipher_test_case_2 = { + .key = { + .data = { + 0x6a, 0x7e, 0x4c, 0x7e, 0x51, 0x25, 0xb3, 0x48, + 0x84, 0x53, 0x3a, 0x94, 0xfb, 0x31, 0x99, 0x90, + 0x32, 0x57, 0x44, 0xee, 0x9b, 0xbc, 0xe9, 0xe5, + 0x25, 0xcf, 0x08, 0xf5, 0xe9, 0xe2, 0x5e, 0x53 + }, + .len = 32 + }, + .cipher_iv = { + .data = { + 0x98, 0xcc, 0x89, 0x9f, 0xaf, 0x6d, 0x64, 0xb6, + 0xb1, 0xe8, 0x21, 0x72, 0xee, 0xb6, 0xcc, 0xe3, + 0xcf, 0x32, 0x28, 0x21, 0x21, 0x0d, 0x1e, 0x1c, + 0x34 + }, + .len = 25 + }, + .auth_iv = { + .data = { + 0x60, 0xaa, 0xd2, 0xb2, 0xd0, 0x85, 0xfa, 0x54, + 0xd8, 0x35, 0xe8, 0xd4, 0x66, 0x82, 0x64, 0x98, + 0xd9, 0x2a, 0x08, 0x1d, 0x35, 0x19, 0x17, 0x01, + 0x1A + }, + .len = 25 + }, + .plaintext = { + .data = { + 0x14, 0xA8, 0xEF, 0x69, 0x3D, 0x67, 0x85, 0x07, + 0xBB, 0xE7, 0x27, 0x0A, 0x7F, 0x67, 0xFF, 0x50, + 0x06, 0xC3, 0x52, 0x5B, 0x98, 0x07, 0xE4, 0x67, + 0xC4, 0xE5, 0x60, 0x00, 0xBA, 0x33, 0x8F, 0x5D, + 0x42, 0x95, 0x59, 0x03, 0x67, 0x51, 0x82, 0x22, + 0x46, 0xC8, 0x0D, 0x3B, 0x38, 0xF0, 0x7F, 0x4B, + 0xE2, 0xD8, 0xFF, 0x58, 0x05, 0xF5, 0x13, 0x22, + 0x29, 0xBD, 0xE9, 0x3B, 0xBB, 0xDC, 0xAF, 0x38, + 0x2B, 0xF1, 0xEE, 0x97, 0x2F, 0xBF, 0x99, 0x77, + 0xBA, 0xDA, 0x89, 0x45, 0x84, 0x7A, 0x2A, 0x6C, + 0x9A, 0xD3, 0x4A, 0x66, 0x75, 0x54, 0xE0, 0x4D, + 0x1F, 0x7F, 0xA2, 0xC3, 0x32, 0x41, 0xBD, 0x8F, + 0x01, 0xBA, 0x22, 0x0D + }, + .len = 96 << 3 + }, + .ciphertext = { + .data = { + 0x52, 0x4E, 0x50, 0x7A, 0x90, 0x37, 0x65, 0x66, + 0xD5, 0x46, 0x04, 0x68, 0x2A, 0x42, 0xD1, 0xE9, + 0x73, 0x9F, 0xE9, 0x53, 0x8C, 0x0E, 0x72, 0x05, + 0x05, 0xA9, 0xDB, 0x8C, 0x2A, 0x18, 0xFD, 0x73, + 0xB9, 0x2C, 0x45, 0x48, 0xA4, 0x54, 0xF7, 0x62, + 0xB9, 0x8B, 0x42, 0x62, 0x0B, 0xA8, 0xE7, 0x79, + 0x67, 0x3C, 0x96, 0xB6, 0x4B, 0x23, 0x66, 0x13, + 0xC9, 0x74, 0x71, 0x3E, 0x23, 0x0D, 0x4B, 0x08, + 0x78, 0x36, 0x9E, 0xAC, 0x82, 0xDF, 0xDE, 0xE9, + 0xF4, 0xD6, 0x62, 0x28, 0x44, 0x86, 0x6C, 0xEA, + 0xD0, 0x59, 0x34, 0x83, 0x67, 0x28, 0xDE, 0xC8, + 0x89, 0xFE, 0x21, 0x9B, 0x87, 0x88, 0x8D, 0xAB, + 0x51, 0x05, 0x0F, 0x5C + }, + .len = 100 << 3 + }, + .validDataLenInBits = { + .len = 100 << 3 + }, + .validCipherLenInBits = { + .len = 100 << 3 + }, + .validAuthLenInBits = { + .len = 96 << 3 + }, + .digest = { + .data = {0x51, 0x05, 0x0F, 0x5C}, + .len = 4, + .offset_bytes = 96 + } +}; + +struct wireless_test_data zuc256_auth_cipher_test_case_3 = { + .key = { + .data = { + 0xe3, 0x8e, 0xaf, 0x08, 0xde, 0x8c, 0x08, 0x41, + 0x7f, 0x2b, 0x97, 0x20, 0x10, 0x87, 0xc7, 0xf7, + 0xbe, 0x3c, 0xd2, 0x68, 0x80, 0x10, 0x1e, 0x71, + 0xfd, 0xb2, 0xbb, 0xad, 0x25, 0x0f, 0x06, 0x08 + }, + .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 + }, + .auth_iv = { + .data = { + 0xf5, 0x8d, 0x08, 0x26, 0x94, 0x14, 0xc7, 0x4d, + 0xf5, 0x7c, 0x9c, 0xaa, 0x45, 0x53, 0xfd, 0x85, + 0x23, 0x0b, 0x00, 0x0e, 0x26, 0x2b, 0x0f, 0x01, + 0x26 + }, + .len = 25 + }, + .plaintext = { + .data = { + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A + }, + .len = 128 << 3 + }, + .ciphertext = { + .data = { + 0xF8, 0xBA, 0xBD, 0x3E, 0x52, 0xC7, 0xF9, 0x86, + 0x5F, 0xA3, 0x84, 0xE8, 0x20, 0xE1, 0xBB, 0x80, + 0xDB, 0x2D, 0x02, 0xA7, 0x35, 0x6A, 0x54, 0x98, + 0x90, 0x32, 0xCE, 0x99, 0xE7, 0x66, 0x0E, 0x5D, + 0x43, 0xBB, 0x4D, 0xF3, 0x4A, 0xB7, 0x9F, 0x3B, + 0x44, 0xFF, 0x0D, 0xB9, 0xAE, 0xEA, 0xAB, 0x95, + 0x5F, 0xA7, 0x39, 0x6D, 0xBC, 0x72, 0x59, 0x8B, + 0x75, 0xD3, 0x7E, 0xC6, 0x90, 0x7B, 0xE7, 0x3C, + 0x12, 0x38, 0xDD, 0x50, 0xD6, 0x74, 0x91, 0x02, + 0x66, 0x3D, 0xBA, 0x59, 0x1B, 0x93, 0xED, 0x87, + 0xAB, 0xD7, 0x2E, 0xEF, 0xFF, 0x80, 0x98, 0x7E, + 0x0F, 0x2A, 0x4E, 0x5F, 0xEB, 0x3A, 0x0E, 0xCC, + 0xBF, 0xDA, 0x67, 0xA0, 0x54, 0xC6, 0x56, 0x29, + 0x5D, 0x3C, 0x1A, 0x73, 0xA7, 0xE3, 0xC9, 0xD2, + 0x08, 0x33, 0x73, 0x13, 0xEC, 0x56, 0x59, 0x11, + 0x4C, 0x7C, 0x4D, 0xC7, 0x3E, 0x81, 0x35, 0x20 + }, + .len = 128 << 3 + }, + .validDataLenInBits = { + .len = 128 << 3 + }, + .validCipherLenInBits = { + .len = 128 << 3 + }, + .validAuthLenInBits = { + .len = 120 << 3 + }, + .digest = { + .data = {0x4C, 0x7C, 0x4D, 0xC7, 0x3E, 0x81, 0x35, 0x20}, + .len = 8, + .offset_bytes = 120 + } +}; + +struct wireless_test_data zuc256_auth_cipher_test_case_4 = { + .key = { + .data = { + 0xe3, 0x8e, 0xaf, 0x08, 0xde, 0x8c, 0x08, 0x41, + 0x7f, 0x2b, 0x97, 0x20, 0x10, 0x87, 0xc7, 0xf7, + 0xbe, 0x3c, 0xd2, 0x68, 0x80, 0x10, 0x1e, 0x71, + 0xfd, 0xb2, 0xbb, 0xad, 0x25, 0x0f, 0x06, 0x08 + }, + .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 + }, + .auth_iv = { + .data = { + 0xf5, 0x8d, 0x08, 0x26, 0x94, 0x14, 0xc7, 0x4d, + 0xf5, 0x7c, 0x9c, 0xaa, 0x45, 0x53, 0xfd, 0x85, + 0x23, 0x0b, 0x00, 0x0e, 0x26, 0x2b, 0x0f, 0x01, + 0x26 + }, + .len = 25 + }, + .plaintext = { + .data = { + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A + }, + .len = 128 << 3 + }, + .ciphertext = { + .data = { + 0xF8, 0xBA, 0xBD, 0x3E, 0x52, 0xC7, 0xF9, 0x86, + 0x5F, 0xA3, 0x84, 0xE8, 0x20, 0xE1, 0xBB, 0x80, + 0xDB, 0x2D, 0x02, 0xA7, 0x35, 0x6A, 0x54, 0x98, + 0x90, 0x32, 0xCE, 0x99, 0xE7, 0x66, 0x0E, 0x5D, + 0x43, 0xBB, 0x4D, 0xF3, 0x4A, 0xB7, 0x9F, 0x3B, + 0x44, 0xFF, 0x0D, 0xB9, 0xAE, 0xEA, 0xAB, 0x95, + 0x5F, 0xA7, 0x39, 0x6D, 0xBC, 0x72, 0x59, 0x8B, + 0x75, 0xD3, 0x7E, 0xC6, 0x90, 0x7B, 0xE7, 0x3C, + 0x12, 0x38, 0xDD, 0x50, 0xD6, 0x74, 0x91, 0x02, + 0x66, 0x3D, 0xBA, 0x59, 0x1B, 0x93, 0xED, 0x87, + 0xAB, 0xD7, 0x2E, 0xEF, 0xFF, 0x80, 0x98, 0x7E, + 0x0F, 0x2A, 0x4E, 0x5F, 0xEB, 0x3A, 0x0E, 0xCC, + 0xBF, 0xDA, 0x67, 0xA0, 0x54, 0xC6, 0x56, 0x29, + 0x5D, 0x3C, 0x1A, 0x73, 0xA7, 0xE3, 0xC9, 0xD2, + 0x96, 0x2B, 0x25, 0x9F, 0xDD, 0x6E, 0x72, 0xE3, + 0x86, 0x01, 0xA5, 0x56, 0x66, 0x90, 0xAE, 0xC2 + }, + .len = 128 << 3 + }, + .validDataLenInBits = { + .len = 128 << 3 + }, + .validCipherLenInBits = { + .len = 128 << 3 + }, + .validAuthLenInBits = { + .len = 112 << 3 + }, + .digest = { + .data = { + 0x96, 0x2B, 0x25, 0x9F, 0xDD, 0x6E, 0x72, 0xE3, + 0x86, 0x01, 0xA5, 0x56, 0x66, 0x90, 0xAE, 0xC2 + }, + .len = 16, + .offset_bytes = 112 + } +}; + #endif /* TEST_CRYPTODEV_ZUC_TEST_VECTORS_H_ */