From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C3A6FA04F1; Fri, 13 Dec 2019 16:23:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2AD231C010; Fri, 13 Dec 2019 16:23:10 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D49C41C011 for ; Fri, 13 Dec 2019 16:23:07 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2019 07:23:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,309,1571727600"; d="scan'208";a="246161159" Received: from adamdybx-mobl.ger.corp.intel.com (HELO addy-VirtualBox.isw.intel.com) ([10.103.104.99]) by fmsmga002.fm.intel.com with ESMTP; 13 Dec 2019 07:23:02 -0800 From: Adam Dybkowski To: dev@dpdk.org, fiona.trahe@intel.com, akhil.goyal@nxp.com Cc: ravi1.kumar@amd.com, ruifeng.wang@arm.com, anoobj@marvell.com, roy.fan.zhang@intel.com, declan.doherty@intel.com, pablo.de.lara.guarch@intel.com, rnagadheeraj@marvell.com, adwivedi@marvell.com, g.singh@nxp.com, jianjay.zhou@huawei.com, lironh@marvell.com, Adam Dybkowski Date: Fri, 13 Dec 2019 16:22:44 +0100 Message-Id: <20191213152245.13477-5-adamx.dybkowski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191213152245.13477-1-adamx.dybkowski@intel.com> References: <20191212140942.8210-1-adamx.dybkowski@intel.com> <20191213152245.13477-1-adamx.dybkowski@intel.com> Subject: [dpdk-dev] [PATCH v3 4/4] test/crypto: refactor unit tests into one combined array X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch refactors most of unit tests to be contained in one combined array, and run depending on the PMD capabilities instead of providing multiple array with tests for individual PMDs. Only a subset of unit tests was merged into one array - it combines all tests originally meant to be run on these PMDs: null, aesni_mb, aesni_gcm, openssl, qat, sw_snow3g, sw_kasumi, sw_zuc. Signed-off-by: Adam Dybkowski --- app/test/test_cryptodev.c | 1121 +++++--------------- app/test/test_cryptodev_blockcipher.c | 2 +- app/test/test_cryptodev_des_test_vectors.h | 6 +- 3 files changed, 239 insertions(+), 890 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 290df0b69..aa57a4efe 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -6041,11 +6041,9 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, uint64_t feat_flags = dev_info.feature_flags; - if (op_mode == OUT_OF_PLACE) { - if (!(feat_flags & RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED)) { - printf("Device doesn't support digest encrypted.\n"); - return -ENOTSUP; - } + if (!(feat_flags & RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED)) { + printf("Device doesn't support digest encrypted.\n"); + return -ENOTSUP; } /* Create the session */ @@ -11550,8 +11548,8 @@ static struct unit_test_suite cryptodev_scheduler_testsuite = { #endif /* RTE_LIBRTE_PMD_CRYPTO_SCHEDULER */ -static struct unit_test_suite cryptodev_qat_testsuite = { - .suite_name = "Crypto QAT Unit Test Suite", +static struct unit_test_suite cryptodev_testsuite = { + .suite_name = "Crypto Unit Test Suite", .setup = testsuite_setup, .teardown = testsuite_teardown, .unit_test_cases = { @@ -11561,8 +11559,15 @@ static struct unit_test_suite cryptodev_qat_testsuite = { test_device_configure_invalid_queue_pair_ids), TEST_CASE_ST(ut_setup, ut_teardown, test_queue_pair_descriptor_setup), + TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session), + TEST_CASE_ST(ut_setup, ut_teardown, + test_multi_session_random_usage), + + TEST_CASE_ST(ut_setup, ut_teardown, + test_null_invalid_operation), + TEST_CASE_ST(ut_setup, ut_teardown, test_null_burst_operation), TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all), TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all), @@ -11590,9 +11595,43 @@ static struct unit_test_suite cryptodev_qat_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_AES_CCM_authenticated_decryption_test_case_128_3), + /** AES CCM Authenticated Encryption 192 bits key */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_encryption_test_case_192_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_encryption_test_case_192_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_encryption_test_case_192_3), + + /** AES CCM Authenticated Decryption 192 bits key*/ + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_decryption_test_case_192_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_decryption_test_case_192_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_decryption_test_case_192_3), + + /** AES CCM Authenticated Encryption 256 bits key */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_encryption_test_case_256_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_encryption_test_case_256_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_encryption_test_case_256_3), + + /** AES CCM Authenticated Decryption 256 bits key*/ + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_decryption_test_case_256_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_decryption_test_case_256_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_CCM_authenticated_decryption_test_case_256_3), + /** AES GCM Authenticated Encryption */ TEST_CASE_ST(ut_setup, ut_teardown, test_AES_GCM_auth_encrypt_SGL_in_place_1500B), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg), TEST_CASE_ST(ut_setup, ut_teardown, test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_400B), TEST_CASE_ST(ut_setup, ut_teardown, @@ -11696,6 +11735,30 @@ static struct unit_test_suite cryptodev_qat_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_AES_GCM_auth_decryption_test_case_256_7), + /** AES GCM Authenticated Encryption big aad size */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_auth_encryption_test_case_aad_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_auth_encryption_test_case_aad_2), + + /** AES GCM Authenticated Decryption big aad size */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_auth_decryption_test_case_aad_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_auth_decryption_test_case_aad_2), + + /** Out of place tests */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_authenticated_encryption_oop_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_authenticated_decryption_oop_test_case_1), + + /** Session-less tests */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_authenticated_encryption_sessionless_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_authenticated_decryption_sessionless_test_case_1), + /** AES GMAC Authentication */ TEST_CASE_ST(ut_setup, ut_teardown, test_AES_GMAC_authentication_test_case_1), @@ -11709,6 +11772,10 @@ static struct unit_test_suite cryptodev_qat_testsuite = { test_AES_GMAC_authentication_test_case_3), TEST_CASE_ST(ut_setup, ut_teardown, test_AES_GMAC_authentication_verify_test_case_3), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GMAC_authentication_test_case_4), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GMAC_authentication_verify_test_case_4), /** SNOW 3G encrypt only (UEA2) */ TEST_CASE_ST(ut_setup, ut_teardown, @@ -11724,6 +11791,10 @@ static struct unit_test_suite cryptodev_qat_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_encryption_test_case_1_oop), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_encryption_test_case_1_oop_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_encryption_test_case_1_offset_oop), TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_decryption_test_case_1_oop), @@ -11786,12 +11857,26 @@ static struct unit_test_suite cryptodev_qat_testsuite = { test_snow3g_hash_generate_test_case_2), TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_hash_generate_test_case_3), + /* Tests with buffers which length is not byte-aligned */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_hash_generate_test_case_4), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_hash_generate_test_case_5), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_hash_generate_test_case_6), TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_hash_verify_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_hash_verify_test_case_2), TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_hash_verify_test_case_3), + /* Tests with buffers which length is not byte-aligned */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_hash_verify_test_case_4), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_hash_verify_test_case_5), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_hash_verify_test_case_6), TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_cipher_auth_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, @@ -11808,8 +11893,20 @@ static struct unit_test_suite cryptodev_qat_testsuite = { test_zuc_encryption_test_case_4), TEST_CASE_ST(ut_setup, ut_teardown, test_zuc_encryption_test_case_5), + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_encryption_test_case_6_sgl), /** ZUC authenticate (EIA3) */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_hash_generate_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_hash_generate_test_case_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_hash_generate_test_case_3), + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_hash_generate_test_case_4), + TEST_CASE_ST(ut_setup, ut_teardown, + test_zuc_hash_generate_test_case_5), TEST_CASE_ST(ut_setup, ut_teardown, test_zuc_hash_generate_test_case_6), TEST_CASE_ST(ut_setup, ut_teardown, @@ -11853,11 +11950,7 @@ static struct unit_test_suite cryptodev_qat_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_MD5_HMAC_verify_case_2), - /** NULL algo tests done in chain_all, - * cipheronly and authonly suites - */ - - /** KASUMI tests */ + /** KASUMI hash only (UIA1) */ TEST_CASE_ST(ut_setup, ut_teardown, test_kasumi_hash_generate_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, @@ -11882,10 +11975,38 @@ static struct unit_test_suite cryptodev_qat_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_kasumi_hash_verify_test_case_5), + /** KASUMI encrypt only (UEA1) */ TEST_CASE_ST(ut_setup, ut_teardown, test_kasumi_encryption_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_encryption_test_case_1_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_encryption_test_case_1_oop), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_encryption_test_case_1_oop_sgl), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_encryption_test_case_2), TEST_CASE_ST(ut_setup, ut_teardown, test_kasumi_encryption_test_case_3), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_encryption_test_case_4), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_encryption_test_case_5), + + /** KASUMI decrypt only (UEA1) */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_decryption_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_decryption_test_case_2), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_decryption_test_case_3), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_decryption_test_case_4), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_decryption_test_case_5), + TEST_CASE_ST(ut_setup, ut_teardown, + test_kasumi_decryption_test_case_1_oop), + TEST_CASE_ST(ut_setup, ut_teardown, test_kasumi_cipher_auth_test_case_1), @@ -11913,6 +12034,12 @@ static struct unit_test_suite cryptodev_qat_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_kasumi_auth_cipher_verify_test_case_2_oop_sgl), + /** ESN Testcase */ + TEST_CASE_ST(ut_setup, ut_teardown, + auth_encrypt_AES128CBC_HMAC_SHA1_esn_check), + TEST_CASE_ST(ut_setup, ut_teardown, + auth_decrypt_AES128CBC_HMAC_SHA1_esn_check), + /** Negative tests */ TEST_CASE_ST(ut_setup, ut_teardown, authentication_verify_HMAC_SHA1_fail_data_corrupt), @@ -12047,12 +12174,73 @@ static struct unit_test_suite cryptodev_virtio_testsuite = { } }; -static struct unit_test_suite cryptodev_aesni_mb_testsuite = { - .suite_name = "Crypto Device AESNI MB Unit Test Suite", +static struct unit_test_suite cryptodev_caam_jr_testsuite = { + .suite_name = "Crypto CAAM JR Unit Test Suite", + .setup = testsuite_setup, + .teardown = testsuite_teardown, + .unit_test_cases = { + TEST_CASE_ST(ut_setup, ut_teardown, + test_device_configure_invalid_dev_id), + TEST_CASE_ST(ut_setup, ut_teardown, + test_multi_session), + + TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all), + TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all), + TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all), + TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all), + TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all), + + TEST_CASES_END() /**< NULL terminate unit test array */ + } +}; + +static struct unit_test_suite cryptodev_dpaa_sec_testsuite = { + .suite_name = "Crypto DPAA_SEC Unit Test Suite", .setup = testsuite_setup, .teardown = testsuite_teardown, .unit_test_cases = { -#if IMB_VERSION_NUM >= IMB_VERSION(0, 51, 0) + TEST_CASE_ST(ut_setup, ut_teardown, + test_device_configure_invalid_dev_id), + TEST_CASE_ST(ut_setup, ut_teardown, + test_multi_session), + + TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all), + TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all), + TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all), + TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all), + TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all), + +#ifdef RTE_LIBRTE_SECURITY + TEST_CASE_ST(ut_setup, ut_teardown, + test_PDCP_PROTO_cplane_encap_all), + + TEST_CASE_ST(ut_setup, ut_teardown, + test_PDCP_PROTO_cplane_decap_all), + + TEST_CASE_ST(ut_setup, ut_teardown, + test_PDCP_PROTO_uplane_encap_all), + + TEST_CASE_ST(ut_setup, ut_teardown, + test_PDCP_PROTO_uplane_decap_all), + + TEST_CASE_ST(ut_setup, ut_teardown, + test_PDCP_PROTO_SGL_in_place_32B), + TEST_CASE_ST(ut_setup, ut_teardown, + test_PDCP_PROTO_SGL_oop_32B_128B), + TEST_CASE_ST(ut_setup, ut_teardown, + test_PDCP_PROTO_SGL_oop_32B_40B), + TEST_CASE_ST(ut_setup, ut_teardown, + test_PDCP_PROTO_SGL_oop_128B_32B), +#endif + /** AES GCM Authenticated Encryption */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_auth_encrypt_SGL_in_place_1500B), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_400B), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg), TEST_CASE_ST(ut_setup, ut_teardown, test_AES_GCM_authenticated_encryption_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, @@ -12067,6 +12255,8 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite = { test_AES_GCM_authenticated_encryption_test_case_6), TEST_CASE_ST(ut_setup, ut_teardown, test_AES_GCM_authenticated_encryption_test_case_7), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_authenticated_encryption_test_case_8), /** AES GCM Authenticated Decryption */ TEST_CASE_ST(ut_setup, ut_teardown, @@ -12083,6 +12273,8 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite = { test_AES_GCM_authenticated_decryption_test_case_6), TEST_CASE_ST(ut_setup, ut_teardown, test_AES_GCM_authenticated_decryption_test_case_7), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_GCM_authenticated_decryption_test_case_8), /** AES GCM Authenticated Encryption 192 bits key */ TEST_CASE_ST(ut_setup, ut_teardown, @@ -12148,867 +12340,43 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_AES_GCM_auth_decryption_test_case_256_7), - /** AES GCM Authenticated Encryption big aad size */ + /** Out of place tests */ TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_aad_1), + test_AES_GCM_authenticated_encryption_oop_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_aad_2), + test_AES_GCM_authenticated_decryption_oop_test_case_1), - /** AES GCM Authenticated Decryption big aad size */ + /** SNOW 3G encrypt only (UEA2) */ TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_aad_1), + test_snow3g_encryption_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_aad_2), - - /** Session-less tests */ + test_snow3g_encryption_test_case_2), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_sessionless_test_case_1), + test_snow3g_encryption_test_case_3), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_sessionless_test_case_1), + test_snow3g_encryption_test_case_4), + TEST_CASE_ST(ut_setup, ut_teardown, + test_snow3g_encryption_test_case_5), - /** AES GMAC Authentication */ TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_1), + test_snow3g_encryption_test_case_1_oop), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_1), + test_snow3g_encryption_test_case_1_oop_sgl), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_2), + test_snow3g_decryption_test_case_1_oop), + + /** SNOW 3G decrypt only (UEA2) */ TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_2), + test_snow3g_decryption_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_3), + test_snow3g_decryption_test_case_2), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_3), -#endif /* IMB_VERSION_NUM >= IMB_VERSION(0, 51, 0) */ - - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_docsis_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_DES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_DES_docsis_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all), + test_snow3g_decryption_test_case_3), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_128_1), + test_snow3g_decryption_test_case_4), TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_128_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_128_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_128_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_128_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_128_3), - - TEST_CASES_END() /**< NULL terminate unit test array */ - } -}; - -static struct unit_test_suite cryptodev_openssl_testsuite = { - .suite_name = "Crypto Device OPENSSL Unit Test Suite", - .setup = testsuite_setup, - .teardown = testsuite_teardown, - .unit_test_cases = { - TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session), - TEST_CASE_ST(ut_setup, ut_teardown, - test_multi_session_random_usage), - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_DES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_DES_docsis_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all), - - /** AES GCM Authenticated Encryption */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_7), - - /** AES GCM Authenticated Decryption */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_7), - - - /** AES GCM Authenticated Encryption 192 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_7), - - /** AES GCM Authenticated Decryption 192 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_7), - - /** AES GCM Authenticated Encryption 256 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_7), - - /** AES GCM Authenticated Decryption 256 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_7), - - /** AES GMAC Authentication */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_4), - - /** AES CCM Authenticated Encryption 128 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_128_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_128_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_128_3), - - /** AES CCM Authenticated Decryption 128 bits key*/ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_128_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_128_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_128_3), - - /** AES CCM Authenticated Encryption 192 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_192_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_192_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_192_3), - - /** AES CCM Authenticated Decryption 192 bits key*/ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_192_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_192_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_192_3), - - /** AES CCM Authenticated Encryption 256 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_256_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_256_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_encryption_test_case_256_3), - - /** AES CCM Authenticated Decryption 256 bits key*/ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_256_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_256_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_CCM_authenticated_decryption_test_case_256_3), - - /** Scatter-Gather */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg), - - /** Negative tests */ - TEST_CASE_ST(ut_setup, ut_teardown, - authentication_verify_HMAC_SHA1_fail_data_corrupt), - TEST_CASE_ST(ut_setup, ut_teardown, - authentication_verify_HMAC_SHA1_fail_tag_corrupt), - TEST_CASE_ST(ut_setup, ut_teardown, - authentication_verify_AES128_GMAC_fail_data_corrupt), - TEST_CASE_ST(ut_setup, ut_teardown, - authentication_verify_AES128_GMAC_fail_tag_corrupt), - TEST_CASE_ST(ut_setup, ut_teardown, - auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt), - TEST_CASE_ST(ut_setup, ut_teardown, - auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt), - - /* ESN Testcase */ - TEST_CASE_ST(ut_setup, ut_teardown, - auth_encrypt_AES128CBC_HMAC_SHA1_esn_check), - - TEST_CASE_ST(ut_setup, ut_teardown, - auth_decrypt_AES128CBC_HMAC_SHA1_esn_check), - - TEST_CASES_END() /**< NULL terminate unit test array */ - } -}; - -static struct unit_test_suite cryptodev_aesni_gcm_testsuite = { - .suite_name = "Crypto Device AESNI GCM Unit Test Suite", - .setup = testsuite_setup, - .teardown = testsuite_teardown, - .unit_test_cases = { - /** AES GCM Authenticated Encryption */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_7), - - /** AES GCM Authenticated Decryption */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_7), - - /** AES GCM Authenticated Encryption 192 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_7), - - /** AES GCM Authenticated Decryption 192 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_7), - - /** AES GCM Authenticated Encryption 256 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_7), - - /** AES GCM Authenticated Decryption 256 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_7), - - /** AES GCM Authenticated Encryption big aad size */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_aad_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_aad_2), - - /** AES GCM Authenticated Decryption big aad size */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_aad_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_aad_2), - - /** AES GMAC Authentication */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GMAC_authentication_verify_test_case_4), - - /** Negative tests */ - TEST_CASE_ST(ut_setup, ut_teardown, - authentication_verify_AES128_GMAC_fail_data_corrupt), - TEST_CASE_ST(ut_setup, ut_teardown, - authentication_verify_AES128_GMAC_fail_tag_corrupt), - - /** Out of place tests */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_oop_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_oop_test_case_1), - - /** Session-less tests */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_sessionless_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_sessionless_test_case_1), - - /** Scatter-Gather */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encrypt_SGL_in_place_1500B), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg), - - TEST_CASES_END() /**< NULL terminate unit test array */ - } -}; - -static struct unit_test_suite cryptodev_sw_kasumi_testsuite = { - .suite_name = "Crypto Device SW KASUMI Unit Test Suite", - .setup = testsuite_setup, - .teardown = testsuite_teardown, - .unit_test_cases = { - /** KASUMI encrypt only (UEA1) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_encryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_encryption_test_case_1_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_encryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_encryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_encryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_encryption_test_case_5), - /** KASUMI decrypt only (UEA1) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_decryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_decryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_decryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_decryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_decryption_test_case_5), - - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_encryption_test_case_1_oop), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_encryption_test_case_1_oop_sgl), - - - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_decryption_test_case_1_oop), - - /** KASUMI hash only (UIA1) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_generate_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_generate_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_generate_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_generate_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_generate_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_generate_test_case_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_verify_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_verify_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_verify_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_verify_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_hash_verify_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_cipher_auth_test_case_1), - - /** KASUMI generate auth, then encrypt (F8) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_test_case_2_oop), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_test_case_2_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_test_case_2_oop_sgl), - - /** KASUMI decrypt (F8), then verify auth */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_verify_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_verify_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_verify_test_case_2_oop), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_verify_test_case_2_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - test_kasumi_auth_cipher_verify_test_case_2_oop_sgl), - TEST_CASES_END() /**< NULL terminate unit test array */ - } -}; -static struct unit_test_suite cryptodev_sw_snow3g_testsuite = { - .suite_name = "Crypto Device SW SNOW 3G Unit Test Suite", - .setup = testsuite_setup, - .teardown = testsuite_teardown, - .unit_test_cases = { - /** SNOW 3G encrypt only (UEA2) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_with_digest_test_case_1), - - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_1_oop), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_1_oop_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_1_oop), - - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_1_offset_oop), - - /** SNOW 3G decrypt only (UEA2) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_with_digest_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_generate_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_generate_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_generate_test_case_3), - /* Tests with buffers which length is not byte-aligned */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_generate_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_generate_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_generate_test_case_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_verify_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_verify_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_verify_test_case_3), - /* Tests with buffers which length is not byte-aligned */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_verify_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_verify_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_hash_verify_test_case_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_cipher_auth_test_case_1), - - /** SNOW 3G generate auth, then encrypt (UEA2) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_test_case_2_oop), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_part_digest_enc), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_part_digest_enc_oop), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_test_case_3_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_test_case_3_oop_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_part_digest_enc_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_part_digest_enc_oop_sgl), - - /** SNOW 3G decrypt (UEA2), then verify auth */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_verify_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_verify_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_verify_test_case_2_oop), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_verify_part_digest_enc), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_verify_part_digest_enc_oop), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_verify_test_case_3_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_auth_cipher_verify_test_case_3_oop_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - 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_CASES_END() /**< NULL terminate unit test array */ - } -}; - -static struct unit_test_suite cryptodev_sw_zuc_testsuite = { - .suite_name = "Crypto Device SW ZUC Unit Test Suite", - .setup = testsuite_setup, - .teardown = testsuite_teardown, - .unit_test_cases = { - /** ZUC encrypt only (EEA3) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_encryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_encryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_encryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_encryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_encryption_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_hash_generate_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_hash_generate_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_hash_generate_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_hash_generate_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_hash_generate_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_zuc_encryption_test_case_6_sgl), - TEST_CASES_END() /**< NULL terminate unit test array */ - } -}; - -static struct unit_test_suite cryptodev_caam_jr_testsuite = { - .suite_name = "Crypto CAAM JR Unit Test Suite", - .setup = testsuite_setup, - .teardown = testsuite_teardown, - .unit_test_cases = { - TEST_CASE_ST(ut_setup, ut_teardown, - test_device_configure_invalid_dev_id), - TEST_CASE_ST(ut_setup, ut_teardown, - test_multi_session), - - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all), - - TEST_CASES_END() /**< NULL terminate unit test array */ - } -}; - -static struct unit_test_suite cryptodev_dpaa_sec_testsuite = { - .suite_name = "Crypto DPAA_SEC Unit Test Suite", - .setup = testsuite_setup, - .teardown = testsuite_teardown, - .unit_test_cases = { - TEST_CASE_ST(ut_setup, ut_teardown, - test_device_configure_invalid_dev_id), - TEST_CASE_ST(ut_setup, ut_teardown, - test_multi_session), - - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all), - -#ifdef RTE_LIBRTE_SECURITY - TEST_CASE_ST(ut_setup, ut_teardown, - test_PDCP_PROTO_cplane_encap_all), - - TEST_CASE_ST(ut_setup, ut_teardown, - test_PDCP_PROTO_cplane_decap_all), - - TEST_CASE_ST(ut_setup, ut_teardown, - test_PDCP_PROTO_uplane_encap_all), - - TEST_CASE_ST(ut_setup, ut_teardown, - test_PDCP_PROTO_uplane_decap_all), - - TEST_CASE_ST(ut_setup, ut_teardown, - test_PDCP_PROTO_SGL_in_place_32B), - TEST_CASE_ST(ut_setup, ut_teardown, - test_PDCP_PROTO_SGL_oop_32B_128B), - TEST_CASE_ST(ut_setup, ut_teardown, - test_PDCP_PROTO_SGL_oop_32B_40B), - TEST_CASE_ST(ut_setup, ut_teardown, - test_PDCP_PROTO_SGL_oop_128B_32B), -#endif - /** AES GCM Authenticated Encryption */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encrypt_SGL_in_place_1500B), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_400B), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_7), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_test_case_8), - - /** AES GCM Authenticated Decryption */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_7), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_test_case_8), - - /** AES GCM Authenticated Encryption 192 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_192_7), - - /** AES GCM Authenticated Decryption 192 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_192_7), - - /** AES GCM Authenticated Encryption 256 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_encryption_test_case_256_7), - - /** AES GCM Authenticated Decryption 256 bits key */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_5), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_6), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_auth_decryption_test_case_256_7), - - /** Out of place tests */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_encryption_oop_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_AES_GCM_authenticated_decryption_oop_test_case_1), - - /** SNOW 3G encrypt only (UEA2) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_5), - - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_1_oop), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_encryption_test_case_1_oop_sgl), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_1_oop), - - /** SNOW 3G decrypt only (UEA2) */ - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_1), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_2), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_3), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_4), - TEST_CASE_ST(ut_setup, ut_teardown, - test_snow3g_decryption_test_case_5), - + test_snow3g_decryption_test_case_5), + TEST_CASE_ST(ut_setup, ut_teardown, test_snow3g_hash_generate_test_case_1), TEST_CASE_ST(ut_setup, ut_teardown, @@ -13356,23 +12724,6 @@ static struct unit_test_suite cryptodev_dpaa2_sec_testsuite = { } }; -static struct unit_test_suite cryptodev_null_testsuite = { - .suite_name = "Crypto Device NULL Unit Test Suite", - .setup = testsuite_setup, - .teardown = testsuite_teardown, - .unit_test_cases = { - TEST_CASE_ST(ut_setup, ut_teardown, - test_null_invalid_operation), - TEST_CASE_ST(ut_setup, ut_teardown, - test_null_burst_operation), - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all), - TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all), - - TEST_CASES_END() /**< NULL terminate unit test array */ - } -}; - static struct unit_test_suite cryptodev_armv8_testsuite = { .suite_name = "Crypto Device ARMv8 Unit Test Suite", .setup = testsuite_setup, @@ -13888,7 +13239,7 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/) return TEST_SKIPPED; } - return unit_test_suite_runner(&cryptodev_qat_testsuite); + return unit_test_suite_runner(&cryptodev_testsuite); } static int @@ -13920,7 +13271,7 @@ test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/) return TEST_SKIPPED; } - return unit_test_suite_runner(&cryptodev_aesni_mb_testsuite); + return unit_test_suite_runner(&cryptodev_testsuite); } static int @@ -13936,7 +13287,7 @@ test_cryptodev_openssl(void) return TEST_SKIPPED; } - return unit_test_suite_runner(&cryptodev_openssl_testsuite); + return unit_test_suite_runner(&cryptodev_testsuite); } static int @@ -13952,7 +13303,7 @@ test_cryptodev_aesni_gcm(void) return TEST_SKIPPED; } - return unit_test_suite_runner(&cryptodev_aesni_gcm_testsuite); + return unit_test_suite_runner(&cryptodev_testsuite); } static int @@ -13968,7 +13319,7 @@ test_cryptodev_null(void) return TEST_SKIPPED; } - return unit_test_suite_runner(&cryptodev_null_testsuite); + return unit_test_suite_runner(&cryptodev_testsuite); } static int @@ -13984,7 +13335,7 @@ test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/) return TEST_SKIPPED; } - return unit_test_suite_runner(&cryptodev_sw_snow3g_testsuite); + return unit_test_suite_runner(&cryptodev_testsuite); } static int @@ -14000,7 +13351,7 @@ test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/) return TEST_SKIPPED; } - return unit_test_suite_runner(&cryptodev_sw_kasumi_testsuite); + return unit_test_suite_runner(&cryptodev_testsuite); } static int @@ -14016,7 +13367,7 @@ test_cryptodev_sw_zuc(void /*argv __rte_unused, int argc __rte_unused*/) return TEST_SKIPPED; } - return unit_test_suite_runner(&cryptodev_sw_zuc_testsuite); + return unit_test_suite_runner(&cryptodev_testsuite); } static int diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c index 5bfe2d009..2ff7fc91b 100644 --- a/app/test/test_cryptodev_blockcipher.c +++ b/app/test/test_cryptodev_blockcipher.c @@ -804,7 +804,7 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool, else if (driver_id == nitrox_pmd) target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_NITROX; else - TEST_ASSERT(0, "Unrecognized cryptodev type"); + return -ENOTSUP; /* Unrecognized cryptodev type */ for (i = 0; i < n_test_cases; i++) { const struct blockcipher_test_case *tc = &tcs[i]; diff --git a/app/test/test_cryptodev_des_test_vectors.h b/app/test/test_cryptodev_des_test_vectors.h index 9d2d0e77f..0a362d980 100644 --- a/app/test/test_cryptodev_des_test_vectors.h +++ b/app/test/test_cryptodev_des_test_vectors.h @@ -1208,8 +1208,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | - BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | - BLOCKCIPHER_TEST_TARGET_PMD_MB + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR }, { .test_descr = "3DES-128-CBC HMAC-SHA1 Decryption Digest" @@ -1221,8 +1220,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | - BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | - BLOCKCIPHER_TEST_TARGET_PMD_MB + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR }, { .test_descr = "3DES-128-CBC HMAC-SHA1 Encryption Digest" -- 2.17.1