From patchwork Fri Mar 3 09:38:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124776 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 1EACD41DC6; Fri, 3 Mar 2023 10:38:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC2684161A; Fri, 3 Mar 2023 10:38:29 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id C5F2A400D6 for ; Fri, 3 Mar 2023 10:38: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=1677836308; x=1709372308; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zQa1jv5my/ztyC20B8U60w0Os8R8CYhhy1h1J02PuKw=; b=mmNBhpeKLAvyg+zciIIOkgly2CS5ZduH8K7P660SUNs+ZAsjVwCh94dO +nHq6bDe++wdlbD4VRuqtoY5GISqFmcEmkxxbAEduu2b3Fxn5vOcCklB9 LlGz/W4Zwf49oUd4NdbTug3RdWRgqOWT+WTesESGLH+o3Ci0dhfjiqbPz Ku006j7/19iv15wLt17i7hGOSdT33f5AZzev8DAMmFHmY9x4saTGgqD2i Txzhf7G0SYNDSi89FZ64SmoAthKVuXz0I/rc4EkBD1oDwtDWBWLaW+bOM SkuQPqPJxVeO03mVJU/04ea8OL4SNADlCjWMu/xrEpNDmNP7UNzR7L0ms w==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="362600839" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="362600839" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 01:38:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="739444726" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="739444726" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.80]) by fmsmga008.fm.intel.com with ESMTP; 03 Mar 2023 01:38: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 , Brian Dooley Subject: [PATCH v2 1/5] test/crypto: improve readability of ZUC256 tests Date: Fri, 3 Mar 2023 09:38:17 +0000 Message-Id: <20230303093821.2367309-2-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303093821.2367309-1-ciara.power@intel.com> References: <20230301163916.2248543-1-ciara.power@intel.com> <20230303093821.2367309-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 Acked-by: Brian Dooley --- 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 Fri Mar 3 09:38:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124777 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 3FA5041DC6; Fri, 3 Mar 2023 10:38:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CFF24282D; Fri, 3 Mar 2023 10:38:32 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 18FCB427EE; Fri, 3 Mar 2023 10:38:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677836310; x=1709372310; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Vs7nivvI13qbDYhQGrkLD4pE+5Dor6/5WomCVeiy+VU=; b=JZbLiyU653BNTWZDuRgQA5n0wVQ/TRwSXRsQadryzpjcaJ9rLfE7GnGc 9aIjZ3MhlBAyw9zsJxsJ4l0Xb+PODi0yIDWwq9Tv+Ut3N7ERv5eI4RpA3 CHLN1dkcXZuUH2TbhCc9BLM1Tk0JpBu3vubd2v337wSXosP2yvEMXZqNo BOAGCcW4u8JT5iBaYuAELb+cW7V+vABnjMvtZOY4sXb8qtT+5qLtw0Aro xgZCz7rIjqBCMZcaxUyolpw22uWQHRfZBTeqhms/4W8DT1dn9Akjv7CPW bxzkAgDtFejiFKLuajteg+SWb5Gevhc1AiVK5P5RijN+BczxvAxzkDn42 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="362600843" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="362600843" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 01:38:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="739444742" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="739444742" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.80]) by fmsmga008.fm.intel.com with ESMTP; 03 Mar 2023 01:38: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 , vvelumuri@marvell.com, stable@dpdk.org, Brian Dooley Subject: [PATCH v2 2/5] test/crypto: fix ZUC digest length in comparison Date: Fri, 3 Mar 2023 09:38:18 +0000 Message-Id: <20230303093821.2367309-3-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303093821.2367309-1-ciara.power@intel.com> References: <20230301163916.2248543-1-ciara.power@intel.com> <20230303093821.2367309-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 Acked-by: Brian Dooley --- 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 Fri Mar 3 09:38:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124778 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 7366541DC6; Fri, 3 Mar 2023 10:38:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6151342BDA; Fri, 3 Mar 2023 10:38:33 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 3342E42B71 for ; Fri, 3 Mar 2023 10:38: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=1677836312; x=1709372312; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7IIezAoGbgECEYKu7RS5jA3fPZqROcJgijdzxyb5J2g=; b=jUQ+AUxiN5E+f2cbN6tK753ocMzEo7WjHa8hpUFLKQo9XTwSk+OAaKn2 T8OrYmuKiGhZlLPXc8fuX+B4AKZE1oROanXwKeTOvrxV0sya8qMRCf5V6 ruLe9rF/ZgmtBMasLDEVUaqRchDTJlpBe5GIR6M+OEMbMFzlfrMQFYTOn UcDW4LRC5mXbEz76tpjMjB+ZWOQF+J2YsF6NJIB4nTTpcrYXdDf3AubUB Ac48cjHE/sBdOqsWdZXlqnkIrZxGLc4DLpmljORCSHpVIqroHGZrK0d4d NJMpJBzL140aJWdhwiJ1Xqvymb/kGXWHShBXTZlTHxfdbeZ4fHFUOm5+u A==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="362600849" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="362600849" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 01:38:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="739444754" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="739444754" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.80]) by fmsmga008.fm.intel.com with ESMTP; 03 Mar 2023 01:38: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 , Brian Dooley Subject: [PATCH v2 3/5] test/crypto: fix auth op parameter for ZUC256 tests Date: Fri, 3 Mar 2023 09:38:19 +0000 Message-Id: <20230303093821.2367309-4-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303093821.2367309-1-ciara.power@intel.com> References: <20230301163916.2248543-1-ciara.power@intel.com> <20230303093821.2367309-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 Acked-by: Brian Dooley --- 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 Fri Mar 3 09:38:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124779 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 9C8F541DC6; Fri, 3 Mar 2023 10:38:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83BA34114B; Fri, 3 Mar 2023 10:38:36 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 8106D42C54; Fri, 3 Mar 2023 10:38:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677836314; x=1709372314; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AYIiJgWXgcvfqaiLnB7N1+1+/EynE/Xta+qPUbMnYcU=; b=WF5HOPdg/+2k8lMY2j8HvV3sOFAh+UzOH4hN44HgotUvZ1Ka2nbhSqGj 5DakQ6Uuboz24LPsuyO6ZDJNnPm50Zwq6j5bCSaAWuGg1kPqCc00pUakM VQAnrgAwfo8UmxAferis4eNN4iKbsj/KYs0nBfGd+Twj3uJXS0WwSJXI/ zxAfta5rZVCe+c7kz+pLtp07EdxqUJifjcZ5gnB9NQFnbhDaLFP3505Wn 8IYbE8uGnl+amu/wS4KO041DvEAZ80LFzvXzJucOSQ2NvRMGHCVoU68Nc RIlGfBmNMdg2F4D6R+95ztZuQ58GHZSDl2XfqWgjytWmm7LiU3ubznfpz w==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="362600856" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="362600856" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 01:38:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="739444772" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="739444772" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.80]) by fmsmga008.fm.intel.com with ESMTP; 03 Mar 2023 01:38:32 -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, Brian Dooley Subject: [PATCH v2 4/5] test/crypto: fix capability check for ZUC cipher auth Date: Fri, 3 Mar 2023 09:38:20 +0000 Message-Id: <20230303093821.2367309-5-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303093821.2367309-1-ciara.power@intel.com> References: <20230301163916.2248543-1-ciara.power@intel.com> <20230303093821.2367309-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 Acked-by: Brian Dooley --- 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 Fri Mar 3 09:38:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 124780 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 E9F2041DC6; Fri, 3 Mar 2023 10:38:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBCA442C54; Fri, 3 Mar 2023 10:38:39 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 8F08842BC9 for ; Fri, 3 Mar 2023 10:38:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677836317; x=1709372317; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fzlS7S/e5YAdREHrPdCLGMvK9DDzC2dDxmFxcz2N+50=; b=PFkl0gkpgEIgyiqN6O1RA54jmC+Q/C3JgOgSN6hefWniU+YSAYtQ38Wp QlSbYmCwzuSL4u+Wu+vChJrJvrfhgb8zaYA640QWFBxZ0wdUqg7xhkaKf 60yLL+k0qqXhrTzyQK4/PjD1cvtaKljzd6MsxOieK4mmVV24NmtgMkeVq v6LOEVvbfEElmNFuWCcTrSqasR4ttKPDjlyml+XLn0pAPPPL5GoDkPzfW 8mkTgoxFkSXXW0LXhNlcCl6OHIGHbDkANoYPHL9sykXJAZ/bGml7oxUqT 9v8bF2mSuEmYpblLoE0l8xb+pBLH896dxwwjWu4FJsKT/KKIAdXdSoGG+ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="362600869" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="362600869" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 01:38:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="739444787" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="739444787" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.80]) by fmsmga008.fm.intel.com with ESMTP; 03 Mar 2023 01:38:34 -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 , Brian Dooley Subject: [PATCH v2 5/5] test/crypto: add chained ZUC256 testcases Date: Fri, 3 Mar 2023 09:38:21 +0000 Message-Id: <20230303093821.2367309-6-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303093821.2367309-1-ciara.power@intel.com> References: <20230301163916.2248543-1-ciara.power@intel.com> <20230303093821.2367309-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 Acked-by: Brian Dooley --- 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(+) 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..cb1b51e1fd 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 = 128 << 3 + }, + .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 = 128 << 3 + }, + .validDataLenInBits = { + .len = 128 << 3 + }, + .validCipherLenInBits = { + .len = 128 << 3 + }, + .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 = 128 << 3 + } +}; + +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 = 241 << 3 + }, + .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 = 241 << 3 + }, + .validDataLenInBits = { + .len = 241 << 3 + }, + .validCipherLenInBits = { + .len = 241 << 3 + }, + .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 = 241 << 3 + } +}; + +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 = 128 << 3 + }, + .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 = 128 << 3 + }, + .validDataLenInBits = { + .len = 128 << 3 + }, + .validCipherLenInBits = { + .len = 128 << 3 + }, + .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 = 128 << 3 + } +}; + +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 = 128 << 3 + }, + .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 = 128 << 3 + }, + .validDataLenInBits = { + .len = 128 << 3 + }, + .validCipherLenInBits = { + .len = 128 << 3 + }, + .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 = 128 << 3 + } +}; + +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_ */