From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD1C0A0093; Thu, 23 Jun 2022 15:41:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6865D40146; Thu, 23 Jun 2022 15:41:43 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 0732540042 for ; Thu, 23 Jun 2022 15:41:41 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25N9xpWt024294; Thu, 23 Jun 2022 06:41:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=U2n0icX+JUkTfNw4y3qDmUDgV218bN9pYjIBfCwK9+8=; b=Len7CiYXjjAUJTVXsTMSC3ySs1M5/VLxDnvXCWnQuNN2wqFyBOJb/LINOW1ufXWlMzUw wAjt3MtOfN8qzvuh6kdJV0LrcyX+UQyaoOtMZnB6TrcuCMsETIQ2amYVDF765LsTbS39 svuW/qazPKuTfSsMtCAY/toygdPlkuoLs7Qa93X9W+RU/ds7/J5oEwF+u84Ixk3xJ2Ks 2ED615LiFzgYLhNKGMNbk6mTXz0MHFZCBEjaInYBpLNAP2xcBl1y9OSDjtDgh8Ju8HYN sFGSj2YqnyTwM4kR4GP4V2pNwRrTytpd9pixSy9QkmP7PqA+ZONrz7/fhDTOo3RXwHtk hA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3guye7y749-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 23 Jun 2022 06:41:41 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 23 Jun 2022 06:41:38 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 23 Jun 2022 06:41:38 -0700 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 7DCC83F7099; Thu, 23 Jun 2022 06:41:36 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal , Ciara Power , "Fan Zhang" CC: Anoob Joseph , Ankur Dwivedi , Subject: [PATCH v3] app/test: add additional stream cipher tests Date: Thu, 23 Jun 2022 19:11:35 +0530 Message-ID: <20220623134135.1786338-1-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620123009.1015079-1-ktejasree@marvell.com> References: <20220620123009.1015079-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: KhG85XQ8FzYJhN5GtCt98un6sbsBUCOl X-Proofpoint-ORIG-GUID: KhG85XQ8FzYJhN5GtCt98un6sbsBUCOl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-23_05,2022-06-23_01,2022-06-22_01 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 Adding zuc, snow3g and aes-ctr-cmac auth-cipher test vectors with same auth and cipher offsets and total digest data encrypted. Existing tests have different cipher and auth offsets and partial or no digest encrypted. Signed-off-by: Tejasree Kondoj --- v3: * Modified IV of test vectors as per specification v2: * Removed cn9k PMD checks app/test/test_cryptodev.c | 270 ++++++++++++++++++ app/test/test_cryptodev_mixed_test_vectors.h | 194 +++++++++++++ app/test/test_cryptodev_snow3g_test_vectors.h | 67 +++++ app/test/test_cryptodev_zuc_test_vectors.h | 77 +++++ 4 files changed, 608 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 1cac76a64a..08842e77e6 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -6968,6 +6968,34 @@ test_snow3g_auth_cipher_part_digest_enc_oop_sgl(void) OUT_OF_PLACE, 0); } +static int +test_snow3g_auth_cipher_total_digest_enc_1(void) +{ + return test_snow3g_auth_cipher( + &snow3g_auth_cipher_total_digest_encryption_1, IN_PLACE, 0); +} + +static int +test_snow3g_auth_cipher_total_digest_enc_1_oop(void) +{ + return test_snow3g_auth_cipher( + &snow3g_auth_cipher_total_digest_encryption_1, OUT_OF_PLACE, 0); +} + +static int +test_snow3g_auth_cipher_total_digest_enc_1_sgl(void) +{ + return test_snow3g_auth_cipher_sgl( + &snow3g_auth_cipher_total_digest_encryption_1, IN_PLACE, 0); +} + +static int +test_snow3g_auth_cipher_total_digest_enc_1_oop_sgl(void) +{ + return test_snow3g_auth_cipher_sgl( + &snow3g_auth_cipher_total_digest_encryption_1, OUT_OF_PLACE, 0); +} + static int test_snow3g_auth_cipher_verify_test_case_1(void) { @@ -7035,6 +7063,34 @@ test_snow3g_auth_cipher_verify_part_digest_enc_oop_sgl(void) OUT_OF_PLACE, 1); } +static int +test_snow3g_auth_cipher_verify_total_digest_enc_1(void) +{ + return test_snow3g_auth_cipher( + &snow3g_auth_cipher_total_digest_encryption_1, IN_PLACE, 1); +} + +static int +test_snow3g_auth_cipher_verify_total_digest_enc_1_oop(void) +{ + return test_snow3g_auth_cipher( + &snow3g_auth_cipher_total_digest_encryption_1, OUT_OF_PLACE, 1); +} + +static int +test_snow3g_auth_cipher_verify_total_digest_enc_1_sgl(void) +{ + return test_snow3g_auth_cipher_sgl( + &snow3g_auth_cipher_total_digest_encryption_1, IN_PLACE, 1); +} + +static int +test_snow3g_auth_cipher_verify_total_digest_enc_1_oop_sgl(void) +{ + return test_snow3g_auth_cipher_sgl( + &snow3g_auth_cipher_total_digest_encryption_1, OUT_OF_PLACE, 1); +} + static int test_snow3g_auth_cipher_with_digest_test_case_1(void) { @@ -7260,6 +7316,20 @@ test_zuc_auth_cipher_test_case_1_oop_sgl(void) &zuc_auth_cipher_test_case_1, OUT_OF_PLACE, 0); } +static int +test_zuc_auth_cipher_test_case_2(void) +{ + return test_zuc_auth_cipher( + &zuc_auth_cipher_test_case_2, IN_PLACE, 0); +} + +static int +test_zuc_auth_cipher_test_case_2_oop(void) +{ + return test_zuc_auth_cipher( + &zuc_auth_cipher_test_case_2, OUT_OF_PLACE, 0); +} + static int test_zuc_auth_cipher_verify_test_case_1(void) { @@ -7288,6 +7358,20 @@ test_zuc_auth_cipher_verify_test_case_1_oop_sgl(void) &zuc_auth_cipher_test_case_1, OUT_OF_PLACE, 1); } +static int +test_zuc_auth_cipher_verify_test_case_2(void) +{ + return test_zuc_auth_cipher( + &zuc_auth_cipher_test_case_2, IN_PLACE, 1); +} + +static int +test_zuc_auth_cipher_verify_test_case_2_oop(void) +{ + return test_zuc_auth_cipher( + &zuc_auth_cipher_test_case_2, OUT_OF_PLACE, 1); +} + static int test_zuc256_encryption_test_case_1(void) { @@ -7777,6 +7861,20 @@ test_aes_cmac_aes_ctr_digest_enc_test_case_1_oop_sgl(void) &auth_aes_cmac_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 0); } +static int +test_aes_cmac_aes_ctr_digest_enc_test_case_2(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_aes_ctr_test_case_2, IN_PLACE, 0); +} + +static int +test_aes_cmac_aes_ctr_digest_enc_test_case_2_oop(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_aes_ctr_test_case_2, OUT_OF_PLACE, 0); +} + static int test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1(void) { @@ -7784,6 +7882,13 @@ test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1(void) &auth_aes_cmac_cipher_aes_ctr_test_case_1, IN_PLACE, 1); } +static int +test_verify_aes_cmac_aes_ctr_digest_enc_test_case_2(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_aes_ctr_test_case_2, IN_PLACE, 1); +} + static int test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop(void) { @@ -7805,6 +7910,13 @@ test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop_sgl(void) &auth_aes_cmac_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1); } +static int +test_verify_aes_cmac_aes_ctr_digest_enc_test_case_2_oop(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_aes_ctr_test_case_2, OUT_OF_PLACE, 1); +} + /** MIXED AUTH + CIPHER */ static int @@ -7821,6 +7933,21 @@ test_verify_auth_zuc_cipher_snow_test_case_1(void) &auth_zuc_cipher_snow_test_case_1, OUT_OF_PLACE, 1); } +static int +test_auth_zuc_cipher_snow_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_snow_test_case_1, IN_PLACE, 0); +} + +static int +test_verify_auth_zuc_cipher_snow_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_snow_test_case_1, IN_PLACE, 1); +} + + static int test_auth_aes_cmac_cipher_snow_test_case_1(void) { @@ -7835,6 +7962,20 @@ test_verify_auth_aes_cmac_cipher_snow_test_case_1(void) &auth_aes_cmac_cipher_snow_test_case_1, OUT_OF_PLACE, 1); } +static int +test_auth_aes_cmac_cipher_snow_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_snow_test_case_1, IN_PLACE, 0); +} + +static int +test_verify_auth_aes_cmac_cipher_snow_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_snow_test_case_1, IN_PLACE, 1); +} + static int test_auth_zuc_cipher_aes_ctr_test_case_1(void) { @@ -7849,6 +7990,20 @@ test_verify_auth_zuc_cipher_aes_ctr_test_case_1(void) &auth_zuc_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1); } +static int +test_auth_zuc_cipher_aes_ctr_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_aes_ctr_test_case_1, IN_PLACE, 0); +} + +static int +test_verify_auth_zuc_cipher_aes_ctr_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_aes_ctr_test_case_1, IN_PLACE, 1); +} + static int test_auth_snow_cipher_aes_ctr_test_case_1(void) { @@ -7863,6 +8018,34 @@ test_verify_auth_snow_cipher_aes_ctr_test_case_1(void) &auth_snow_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1); } +static int +test_auth_snow_cipher_aes_ctr_test_case_1_inplace_sgl(void) +{ + return test_mixed_auth_cipher_sgl( + &auth_snow_cipher_aes_ctr_test_case_1, IN_PLACE, 0); +} + +static int +test_auth_snow_cipher_aes_ctr_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_aes_ctr_test_case_1, IN_PLACE, 0); +} + +static int +test_verify_auth_snow_cipher_aes_ctr_test_case_1_inplace_sgl(void) +{ + return test_mixed_auth_cipher_sgl( + &auth_snow_cipher_aes_ctr_test_case_1, IN_PLACE, 1); +} + +static int +test_verify_auth_snow_cipher_aes_ctr_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_aes_ctr_test_case_1, IN_PLACE, 1); +} + static int test_auth_snow_cipher_zuc_test_case_1(void) { @@ -7877,6 +8060,20 @@ test_verify_auth_snow_cipher_zuc_test_case_1(void) &auth_snow_cipher_zuc_test_case_1, OUT_OF_PLACE, 1); } +static int +test_auth_snow_cipher_zuc_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_zuc_test_case_1, IN_PLACE, 0); +} + +static int +test_verify_auth_snow_cipher_zuc_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_zuc_test_case_1, IN_PLACE, 1); +} + static int test_auth_aes_cmac_cipher_zuc_test_case_1(void) { @@ -7890,6 +8087,19 @@ test_verify_auth_aes_cmac_cipher_zuc_test_case_1(void) return test_mixed_auth_cipher( &auth_aes_cmac_cipher_zuc_test_case_1, OUT_OF_PLACE, 1); } +static int +test_auth_aes_cmac_cipher_zuc_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_zuc_test_case_1, IN_PLACE, 0); +} + +static int +test_verify_auth_aes_cmac_cipher_zuc_test_case_1_inplace(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_zuc_test_case_1, IN_PLACE, 1); +} static int test_auth_null_cipher_snow_test_case_1(void) @@ -15794,6 +16004,14 @@ static struct unit_test_suite cryptodev_snow3g_testsuite = { test_snow3g_auth_cipher_part_digest_enc_sgl), TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_auth_cipher_part_digest_enc_oop_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_auth_cipher_total_digest_enc_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_auth_cipher_total_digest_enc_1_oop), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_auth_cipher_total_digest_enc_1_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_auth_cipher_total_digest_enc_1_oop_sgl), /** SNOW 3G decrypt (UEA2), then verify auth */ TEST_CASE_ST(ut_setup, ut_teardown, @@ -15814,6 +16032,14 @@ static struct unit_test_suite cryptodev_snow3g_testsuite = { test_snow3g_auth_cipher_verify_part_digest_enc_sgl), TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_auth_cipher_verify_part_digest_enc_oop_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_auth_cipher_verify_total_digest_enc_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_auth_cipher_verify_total_digest_enc_1_oop), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_auth_cipher_verify_total_digest_enc_1_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_auth_cipher_verify_total_digest_enc_1_oop_sgl), /** SNOW 3G decrypt only (UEA2) */ TEST_CASE_ST(ut_setup, ut_teardown, @@ -15922,6 +16148,10 @@ static struct unit_test_suite cryptodev_zuc_testsuite = { test_zuc_auth_cipher_test_case_1_sgl), TEST_CASE_ST(ut_setup, ut_teardown, test_zuc_auth_cipher_test_case_1_oop_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_auth_cipher_test_case_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_auth_cipher_test_case_2_oop), /** ZUC decrypt (EEA3), then verify auth */ TEST_CASE_ST(ut_setup, ut_teardown, @@ -15932,6 +16162,10 @@ static struct unit_test_suite cryptodev_zuc_testsuite = { test_zuc_auth_cipher_verify_test_case_1_sgl), TEST_CASE_ST(ut_setup, ut_teardown, test_zuc_auth_cipher_verify_test_case_1_oop_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_auth_cipher_verify_test_case_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_auth_cipher_verify_test_case_2_oop), /** ZUC-256 encrypt only **/ TEST_CASE_ST(ut_setup, ut_teardown, @@ -16135,37 +16369,73 @@ static struct unit_test_suite cryptodev_mixed_cipher_hash_testsuite = { test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_sgl), TEST_CASE_ST(ut_setup, ut_teardown, test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_aes_cmac_aes_ctr_digest_enc_test_case_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_aes_cmac_aes_ctr_digest_enc_test_case_2_oop), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_aes_cmac_aes_ctr_digest_enc_test_case_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_aes_cmac_aes_ctr_digest_enc_test_case_2_oop), /** AUTH ZUC + CIPHER SNOW3G */ TEST_CASE_ST(ut_setup, ut_teardown, test_auth_zuc_cipher_snow_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, test_verify_auth_zuc_cipher_snow_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_zuc_cipher_snow_test_case_1_inplace), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_zuc_cipher_snow_test_case_1_inplace), /** AUTH AES CMAC + CIPHER SNOW3G */ TEST_CASE_ST(ut_setup, ut_teardown, test_auth_aes_cmac_cipher_snow_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, test_verify_auth_aes_cmac_cipher_snow_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_aes_cmac_cipher_snow_test_case_1_inplace), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_aes_cmac_cipher_snow_test_case_1_inplace), /** AUTH ZUC + CIPHER AES CTR */ TEST_CASE_ST(ut_setup, ut_teardown, test_auth_zuc_cipher_aes_ctr_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, test_verify_auth_zuc_cipher_aes_ctr_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_zuc_cipher_aes_ctr_test_case_1_inplace), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_zuc_cipher_aes_ctr_test_case_1_inplace), /** AUTH SNOW3G + CIPHER AES CTR */ TEST_CASE_ST(ut_setup, ut_teardown, test_auth_snow_cipher_aes_ctr_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, test_verify_auth_snow_cipher_aes_ctr_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_snow_cipher_aes_ctr_test_case_1_inplace), + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_snow_cipher_aes_ctr_test_case_1_inplace_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_snow_cipher_aes_ctr_test_case_1_inplace), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_snow_cipher_aes_ctr_test_case_1_inplace_sgl), /** AUTH SNOW3G + CIPHER ZUC */ TEST_CASE_ST(ut_setup, ut_teardown, test_auth_snow_cipher_zuc_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, test_verify_auth_snow_cipher_zuc_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_snow_cipher_zuc_test_case_1_inplace), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_snow_cipher_zuc_test_case_1_inplace), /** AUTH AES CMAC + CIPHER ZUC */ TEST_CASE_ST(ut_setup, ut_teardown, test_auth_aes_cmac_cipher_zuc_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, test_verify_auth_aes_cmac_cipher_zuc_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_aes_cmac_cipher_zuc_test_case_1_inplace), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_aes_cmac_cipher_zuc_test_case_1_inplace), /** AUTH NULL + CIPHER SNOW3G */ TEST_CASE_ST(ut_setup, ut_teardown, diff --git a/app/test/test_cryptodev_mixed_test_vectors.h b/app/test/test_cryptodev_mixed_test_vectors.h index f50dcb0457..2816ecc6a4 100644 --- a/app/test/test_cryptodev_mixed_test_vectors.h +++ b/app/test/test_cryptodev_mixed_test_vectors.h @@ -169,6 +169,200 @@ struct mixed_cipher_auth_test_data auth_aes_cmac_cipher_aes_ctr_test_case_1 = { } }; +struct mixed_cipher_auth_test_data auth_aes_cmac_cipher_aes_ctr_test_case_2 = { + .auth_algo = RTE_CRYPTO_AUTH_AES_CMAC, + .auth_key = { + .data = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + }, + .len = 16, + }, + .auth_iv = { + .data = { + }, + .len = 0, + }, + .auth = { + .len_bits = 512 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_AES_CTR, + .cipher_key = { + .data = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0xa9, 0x40, 0x59, 0xda, 0x50, 0x00, 0x00, 0x00, + 0x29, 0x40, 0x59, 0xda, 0x50, 0x00, 0x80, 0x00 + }, + .len = 16, + }, + .cipher = { + .len_bits = 516 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6C, + 0x6F, 0x75, 0x73, 0x79, 0x20, 0x65, 0x61, 0x72, + 0x74, 0x68, 0x21, 0x20, 0x48, 0x65, 0x20, 0x77, + 0x6F, 0x6E, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, + 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x70, 0x65, 0x6F, 0x70, 0x6C, 0x65, 0x20, + 0x77, 0x65, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x74, + 0x68, 0x61, 0x74, 0x20, 0x73, 0x61, 0x6D, 0x65, + 0x20, 0x6E, 0x69, 0x67, 0x68, 0x74, 0x20, 0x65, + 0x76, 0x65, 0x6E, 0x20, 0x69, 0x6E, 0x20, 0x68, + 0x69, 0x73, 0x20, 0x6F, 0x77, 0x6E, 0x20, 0x70, + 0x72, 0x6F, 0x73, 0x70, 0x65, 0x72, 0x6F, 0x75, + 0x73, 0x20, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x72, + 0x79, 0x2C, 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, + 0x61, 0x6E, 0x79, 0x20, 0x68, 0x6F, 0x6D, 0x65, + 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x73, + 0x68, 0x61, 0x6E, 0x74, 0x69, 0x65, 0x73, 0x2C, + 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x68, 0x75, 0x73, 0x62, 0x61, 0x6E, + 0x64, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, + 0x64, 0x72, 0x75, 0x6E, 0x6B, 0x20, 0x61, 0x6E, + 0x64, 0x20, 0x77, 0x69, 0x76, 0x65, 0x73, 0x20, + 0x73, 0x6F, 0x63, 0x6B, 0x65, 0x64, 0x2C, 0x20, + 0x61, 0x6E, 0x64, 0x20, 0x68, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, 0x68, 0x69, + 0x6C, 0x64, 0x72, 0x65, 0x6E, 0x20, 0x77, 0x65, + 0x72, 0x65, 0x20, 0x62, 0x75, 0x6C, 0x6C, 0x69, + 0x65, 0x64, 0x2C, 0x20, 0x61, 0x62, 0x75, 0x73, + 0x65, 0x64, 0x2C, 0x20, 0x6F, 0x72, 0x20, 0x61, + 0x62, 0x61, 0x6E, 0x64, 0x6F, 0x6E, 0x65, 0x64, + 0x2E, 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, + 0x6E, 0x79, 0x20, 0x66, 0x61, 0x6D, 0x69, 0x6C, + 0x69, 0x65, 0x73, 0x20, 0x68, 0x75, 0x6E, 0x67, + 0x65, 0x72, 0x65, 0x64, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x66, 0x6F, 0x6F, 0x64, 0x20, 0x74, 0x68, + 0x65, 0x79, 0x20, 0x63, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x6E, 0x6F, 0x74, 0x20, 0x61, 0x66, 0x66, + 0x6F, 0x72, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x62, + 0x75, 0x79, 0x3F, 0x20, 0x48, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x68, 0x65, 0x61, + 0x72, 0x74, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, + 0x20, 0x62, 0x72, 0x6F, 0x6B, 0x65, 0x6E, 0x3F, + 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, + 0x65, 0x73, 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x74, 0x61, 0x6B, 0x65, 0x20, 0x70, 0x6C, + 0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, + 0x20, 0x73, 0x61, 0x6D, 0x65, 0x20, 0x6E, 0x69, + 0x67, 0x68, 0x74, 0x2C, 0x20, 0x68, 0x6F, 0x77, + 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x70, 0x65, + 0x6F, 0x70, 0x6C, 0x65, 0x20, 0x77, 0x6F, 0x75, + 0x6C, 0x64, 0x20, 0x67, 0x6F, 0x20, 0x69, 0x6E, + 0x73, 0x61, 0x6E, 0x65, 0x3F, 0x20, 0x48, 0x6F, + 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, + 0x6F, 0x63, 0x6B, 0x72, 0x6F, 0x61, 0x63, 0x68, + 0x65, 0x73, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x6C, + 0x61, 0x6E, 0x64, 0x6C, 0x6F, 0x72, 0x64, 0x73, + 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, 0x20, 0x74, + 0x72, 0x69, 0x75, 0x6D, 0x70, 0x68, 0x3F, 0x20, + 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x77, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x73, + 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x6C, 0x6F, + 0x73, 0x65, 0x72, 0x73, 0x2C, 0x20, 0x73, 0x75 + }, + .len_bits = 512 << 3, + }, + .ciphertext = { + .data = { + 0xA5, 0xC3, 0xEC, 0xC5, 0x14, 0x36, 0xC8, 0x00, + 0x6E, 0xA6, 0xAD, 0xFB, 0x1C, 0x4F, 0x60, 0x6C, + 0x60, 0xC0, 0x9C, 0x00, 0xED, 0xC0, 0x2A, 0xD8, + 0x41, 0xD3, 0x44, 0x27, 0xE6, 0x1A, 0x6E, 0xB3, + 0x9C, 0x5E, 0x3C, 0x71, 0x19, 0x96, 0x13, 0xED, + 0x06, 0xCA, 0xFB, 0x74, 0x7C, 0x23, 0x3E, 0x54, + 0x49, 0xF1, 0x32, 0xA4, 0xCD, 0xF3, 0x92, 0x33, + 0x22, 0xDB, 0xE0, 0x0D, 0x3F, 0x31, 0xA3, 0x2B, + 0x85, 0x11, 0x41, 0x11, 0x02, 0xE0, 0x2B, 0x0E, + 0x35, 0xDF, 0xE4, 0x03, 0x6B, 0x48, 0x80, 0x4A, + 0xB8, 0x2D, 0xD4, 0xB3, 0x5B, 0xF1, 0xB4, 0xF9, + 0xC9, 0x83, 0x4E, 0x2A, 0x53, 0x92, 0xB2, 0xF6, + 0x0C, 0xBA, 0xC4, 0x94, 0x8E, 0x96, 0x60, 0x26, + 0x4F, 0xA1, 0x85, 0xC6, 0x31, 0x57, 0xAE, 0xC3, + 0x8C, 0x09, 0x1B, 0xDB, 0xC1, 0x0D, 0x0E, 0xCE, + 0xB9, 0xE9, 0x30, 0x5E, 0x51, 0x9C, 0xE4, 0xC5, + 0xDC, 0xC0, 0x4A, 0xD9, 0x1B, 0xBE, 0xCF, 0x0A, + 0x95, 0xA1, 0x78, 0xDD, 0xE0, 0x46, 0x90, 0xC8, + 0xFF, 0xAE, 0x38, 0x1E, 0xAF, 0x5C, 0x57, 0xED, + 0x20, 0x49, 0xED, 0x54, 0x57, 0xBA, 0x65, 0xAD, + 0xC1, 0x2B, 0xD3, 0xEF, 0x97, 0x1F, 0x27, 0xBE, + 0x8E, 0x98, 0x2C, 0x4B, 0xDF, 0x11, 0x77, 0xB9, + 0x7D, 0x89, 0x0D, 0x28, 0xE3, 0x8B, 0x09, 0xAF, + 0x85, 0xCE, 0x0F, 0x49, 0xD5, 0x8E, 0xF2, 0xF2, + 0xF9, 0x4C, 0xE0, 0xF0, 0x9B, 0xD0, 0x42, 0x07, + 0xBC, 0xD4, 0x8E, 0x78, 0xCD, 0x4D, 0x6D, 0x12, + 0xB2, 0x8D, 0x4C, 0xCB, 0x44, 0x2A, 0xA2, 0x4C, + 0xD7, 0x15, 0xFA, 0xB1, 0x05, 0xB9, 0xFF, 0x95, + 0x29, 0xF7, 0xA6, 0xFC, 0x25, 0x74, 0xF6, 0x9E, + 0x01, 0xFE, 0x4C, 0xFD, 0x50, 0xD8, 0xF6, 0x4C, + 0xDF, 0x75, 0xEF, 0xAF, 0x04, 0x84, 0x95, 0x15, + 0x33, 0x6D, 0x8E, 0x0A, 0x89, 0xE0, 0x20, 0x2E, + 0xC2, 0x0E, 0xE1, 0x91, 0xB9, 0x06, 0x34, 0x14, + 0xD4, 0x65, 0x68, 0x72, 0x5C, 0x60, 0x09, 0x2C, + 0x8A, 0x82, 0x4A, 0x04, 0x71, 0xB8, 0xDF, 0x45, + 0x3C, 0x21, 0x24, 0x06, 0x34, 0xD0, 0xE3, 0xA7, + 0x82, 0x25, 0xAB, 0x7B, 0xDD, 0x6D, 0xCC, 0xAE, + 0x01, 0xB1, 0xD6, 0x2A, 0xE2, 0x96, 0x6C, 0x65, + 0x94, 0xDB, 0xB5, 0x0F, 0xCD, 0xC9, 0xA6, 0x01, + 0x5C, 0x89, 0x59, 0x6C, 0x10, 0x4C, 0xA3, 0xBC, + 0x9A, 0x4F, 0x11, 0xEB, 0x54, 0xE0, 0x3B, 0x83, + 0x9C, 0x5E, 0x16, 0x0D, 0xD6, 0x2C, 0x4B, 0x6F, + 0xE6, 0xB9, 0xF6, 0x02, 0x6C, 0x34, 0x0C, 0x4D, + 0xEE, 0xF0, 0x42, 0xC3, 0x0C, 0xDE, 0x93, 0x8A, + 0xC1, 0xB5, 0xEF, 0xCF, 0x54, 0x9C, 0x3B, 0x4B, + 0x70, 0x6C, 0x06, 0x97, 0x3E, 0x26, 0x8C, 0x61, + 0x52, 0x47, 0xF6, 0x9C, 0x28, 0x5C, 0xD1, 0x4A, + 0x67, 0x4B, 0xCD, 0xD9, 0xA1, 0x8C, 0x29, 0x31, + 0x10, 0x71, 0x45, 0x68, 0x63, 0xCE, 0xC9, 0xBC, + 0x46, 0x6A, 0x81, 0x02, 0x4D, 0x66, 0xA4, 0x65, + 0xCC, 0x33, 0xEC, 0x99, 0x14, 0x4D, 0x28, 0xAB, + 0xF6, 0xCB, 0x46, 0x13, 0x0C, 0x13, 0x74, 0x22, + 0x4A, 0x7B, 0x53, 0x2F, 0x11, 0x54, 0xAF, 0xD9, + 0x2D, 0x66, 0x98, 0x7E, 0x20, 0x57, 0x01, 0x4C, + 0xF7, 0x0C, 0xCB, 0x70, 0xFF, 0x3D, 0xC4, 0x5F, + 0x3A, 0xAE, 0xD9, 0xC6, 0x93, 0xFC, 0x2C, 0x23, + 0x4C, 0x43, 0x92, 0x9B, 0x92, 0x3E, 0x35, 0xB7, + 0x1E, 0x96, 0xED, 0xCC, 0x60, 0xDE, 0x2E, 0x19, + 0xB8, 0x24, 0x55, 0x1E, 0x52, 0xB9, 0x52, 0x3C, + 0xC0, 0x06, 0x74, 0xC0, 0xEE, 0xD1, 0xA1, 0x80, + 0x98, 0xE8, 0xDF, 0x0D, 0x8A, 0x44, 0xC2, 0x36, + 0x16, 0xCC, 0x03, 0x68, 0xD9, 0xC2, 0xCF, 0xE2, + 0x78, 0xBD, 0x1A, 0x31, 0x19, 0x5D, 0xE0, 0x6E, + 0x09, 0x6E, 0xD5, 0x17, 0xB8, 0xA8, 0xF4, 0xBE, + 0x2C, 0xD6, 0xD1, 0x04 + }, + .len_bits = 516 << 3, + }, + .digest_enc = { + .data = { + 0x2C, 0xD6, 0xD1, 0x04 + }, + .len = 4, + .offset = 512, + }, + .validDataLen = { + .len_bits = 516 << 3, + }, + .validCipherLen = { + .len_bits = 516 << 3, + }, + .validAuthLen = { + .len_bits = 512 << 3, + } +}; + struct mixed_cipher_auth_test_data auth_zuc_cipher_snow_test_case_1 = { .auth_algo = RTE_CRYPTO_AUTH_ZUC_EIA3, .auth_key = { diff --git a/app/test/test_cryptodev_snow3g_test_vectors.h b/app/test/test_cryptodev_snow3g_test_vectors.h index bbe05662be..2bc4ecca14 100644 --- a/app/test/test_cryptodev_snow3g_test_vectors.h +++ b/app/test/test_cryptodev_snow3g_test_vectors.h @@ -736,4 +736,71 @@ struct snow3g_test_data snow3g_auth_cipher_partial_digest_encryption = { }, }; +struct snow3g_test_data snow3g_auth_cipher_total_digest_encryption_1 = { + .key = { + .data = { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 + + }, + .len = 16 + }, + .cipher_iv = { + .data = { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 + }, + .len = 16 + }, + .auth_iv = { + .data = { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + }, + .len = 16 + }, + .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, + }, + .len = 32 << 3 + }, + .ciphertext = { + .data = { + 0x5A, 0x5A, 0xE4, 0xAD, 0x29, 0xA2, 0x6A, 0xA6, + 0x20, 0x1D, 0xCD, 0x08, 0x50, 0xD6, 0xE6, 0x47, + 0xBC, 0x88, 0x08, 0x01, 0x17, 0xFA, 0x47, 0x5B, + 0x90, 0x40, 0xBA, 0x0C, 0x67, 0xCB, 0xFE, 0x87, + }, + .len = 32 << 3 + }, + .cipher = { + .len_bits = 30 << 3, + .offset_bits = 2 << 3 + }, + .auth = { + .len_bits = 26 << 3, + .offset_bits = 2 << 3 + }, + .digest = { + .data = { + 0x67, 0xCB, 0xFE, 0x87 + }, + .len = 4, + .offset_bytes = 28 + }, + .validDataLenInBits = { + .len = 32 << 3 + }, + .validCipherLenInBits = { + .len = 30 << 3 + }, + .validAuthLenInBits = { + .len = 26 << 3 + }, +}; + #endif /* TEST_CRYPTODEV_SNOW3G_TEST_VECTORS_H_ */ diff --git a/app/test/test_cryptodev_zuc_test_vectors.h b/app/test/test_cryptodev_zuc_test_vectors.h index 5d1d264579..87851e2ec6 100644 --- a/app/test/test_cryptodev_zuc_test_vectors.h +++ b/app/test/test_cryptodev_zuc_test_vectors.h @@ -1239,6 +1239,83 @@ struct wireless_test_data zuc_auth_cipher_test_case_1 = { } }; +struct wireless_test_data zuc_auth_cipher_test_case_2 = { + .key = { + .data = { + 0xE5, 0xBD, 0x3E, 0xA0, 0xEB, 0x55, 0xAD, 0xE8, + 0x66, 0xC6, 0xAC, 0x58, 0xBD, 0x54, 0x30, 0x2A + }, + .len = 16 + }, + .cipher_iv = { + .data = { + 0x00, 0x05, 0x68, 0x23, 0xC4, 0x00, 0x00, 0x00, + 0x00, 0x05, 0x68, 0x23, 0xC4, 0x00, 0x00, 0x00 + }, + .len = 16 + }, + .auth_iv = { + .data = { + 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00, + 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00 + }, + .len = 16 + }, + .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 = { + 0x13, 0x1D, 0x43, 0xE0, 0xDE, 0xA1, 0xBE, 0x5C, + 0x5A, 0x1B, 0xFD, 0x97, 0x1D, 0x85, 0x2C, 0xBF, + 0x71, 0x2D, 0x7B, 0x4F, 0x57, 0x96, 0x1F, 0xEA, + 0x32, 0x08, 0xAF, 0xA8, 0xBC, 0xA4, 0x33, 0xF4, + 0x56, 0xAD, 0x09, 0xC7, 0x41, 0x7E, 0x58, 0xBC, + 0x69, 0xCF, 0x88, 0x66, 0xD1, 0x35, 0x3F, 0x74, + 0x86, 0x5E, 0x80, 0x78, 0x1D, 0x20, 0x2D, 0xFB, + 0x3E, 0xCF, 0xF7, 0xFC, 0xBC, 0x3B, 0x19, 0x0F, + 0xE8, 0x2A, 0x20, 0x4E, 0xD0, 0xE3, 0x50, 0xFC, + 0x0F, 0x6F, 0x26, 0x13, 0xB2, 0xF2, 0xBC, 0xA6, + 0xDF, 0x5A, 0x47, 0x3A, 0x57, 0xA4, 0xA0, 0x0D, + 0x98, 0x5E, 0xBA, 0xD8, 0x80, 0xD6, 0xF2, 0x38, + 0xC0, 0xB4, 0x77, 0x6B + }, + .len = 800 + }, + .validDataLenInBits = { + .len = 800 + }, + .validCipherLenInBits = { + .len = 800 + }, + .validAuthLenInBits = { + .len = 96 << 3 + }, + .validCipherOffsetInBits = { + .len = 0 + }, + .digest = { + .data = { 0xC0, 0xB4, 0x77, 0x6B }, + .len = 4, + .offset_bytes = 96 + } +}; + /** ZUC-256 vectors **/ static struct wireless_test_data zuc256_test_case_cipher_1 = { .key = { -- 2.25.1