From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30052.outbound.protection.outlook.com [40.107.3.52]) by dpdk.org (Postfix) with ESMTP id A4D8A5F62 for ; Tue, 30 Apr 2019 09:20:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6TLj3fiVty1s3no/W+LVzCYDyrYPGuCA9h3AwsppvOE=; b=dGVhHn/aKQBoNgbYz96DFRuE7hFj10AeOVIoSlPwHoW2rQedpg0p7CHX/pOUsxDeM4NiVoVmBxLTGw1BOB4pb733QXAI8pNDVv3GCmAX83jaD1kUHLA7qUEOHHMwpuEFS2D4mXV/t6IGBAAffoggkH7jCqvpOvZhXpw50hXKJ/E= Received: from VI1PR04MB4893.eurprd04.prod.outlook.com (20.177.49.154) by VI1PR04MB6302.eurprd04.prod.outlook.com (20.179.28.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.14; Tue, 30 Apr 2019 07:20:17 +0000 Received: from VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::98b0:84a6:1c08:57c7]) by VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::98b0:84a6:1c08:57c7%3]) with mapi id 15.20.1835.018; Tue, 30 Apr 2019 07:20:17 +0000 From: Akhil Goyal To: Fiona Trahe , "dev@dpdk.org" CC: "thomas@monjalon.net" , "arkadiuszx.kusztal@intel.com" , "bernard.iremonger@intel.com" , "anoobj@marvell.com" Thread-Topic: [PATCH] test/crypto: added NULL algo tests to loop test mechanism Thread-Index: AQHU/GbB2aJRqrSDu06NkgIMMBDmiKZUUK3w Date: Tue, 30 Apr 2019 07:20:16 +0000 Message-ID: References: <1556307118-16624-1-git-send-email-fiona.trahe@intel.com> In-Reply-To: <1556307118-16624-1-git-send-email-fiona.trahe@intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-originating-ip: [92.120.1.65] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2acfd331-176c-49cf-8b10-08d6cd3c4ba9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:VI1PR04MB6302; x-ms-traffictypediagnostic: VI1PR04MB6302: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(346002)(136003)(39860400002)(13464003)(199004)(189003)(53936002)(6506007)(446003)(305945005)(68736007)(7736002)(53546011)(99286004)(76176011)(2501003)(102836004)(11346002)(110136005)(186003)(33656002)(2906002)(55016002)(316002)(26005)(3846002)(6116002)(54906003)(6306002)(478600001)(966005)(53946003)(14454004)(9686003)(6436002)(7696005)(4326008)(8936002)(25786009)(6246003)(66066001)(8676002)(66946007)(52536014)(81166006)(81156014)(44832011)(229853002)(97736004)(30864003)(71190400001)(256004)(74316002)(71200400001)(73956011)(76116006)(86362001)(486006)(14444005)(66556008)(66476007)(476003)(64756008)(5660300002)(66446008)(473944003)(414714003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB6302; H:VI1PR04MB4893.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: rkcsIkZGc62BRf6rfJMbnbrp8azKffRQJVPQbmFSqnfLT4v7KuhZG+rg6d7GCnmvpKCTcQ0i/UVniFKZrpl3t/UYroGa1opM1mdf9rjbVXNtOBhlX0Pw3ZcqMh3PJ8m6zDIEXCEPH3BpXQNoLGEQjSd/e9laFHaQBH9SUFjSVNUD+DM+l0WTtGSek+1CUx1+qAo6JAYMJOaBlqche36r1vbNzH7X1+8AHj+Moms5eAKqSTY+aGLlRMkkpWwRCT9PyF2B+REUwHQngh7B9mglWSGSCC2trAh2jHL7qvEL1Y4ZOl8ql3ZopYDL75Z0SGSk+RrJThKNJWwY2d46SjAi6Rtnnoum/jhEEx2mAgzW/j9JJhWrN7bP04WXWveuVUxAMdb/+Ukaj4PKknABoICRfY+VxOvJ7EnlrFrGbAiIWTE= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2acfd331-176c-49cf-8b10-08d6cd3c4ba9 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 07:20:16.9477 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6302 Subject: Re: [dpdk-dev] [PATCH] test/crypto: added NULL algo tests to loop test mechanism 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: , X-List-Received-Date: Tue, 30 Apr 2019 07:20:18 -0000 Hi Fiona, I believe this patch is for 19.08, we normally do not accept such changes i= n RC4. Also the patch=20 http://patches.dpdk.org/patch/53117/ looks to be meaningful if this patch is accepted. Do you want we to apply the fix in driver in this release and add the test = cases in the next release, or should I defer both in next release. Thanks, Akhil > -----Original Message----- > From: Fiona Trahe > Sent: Saturday, April 27, 2019 1:02 AM > To: dev@dpdk.org > Cc: thomas@monjalon.net; Akhil Goyal ; > arkadiuszx.kusztal@intel.com; bernard.iremonger@intel.com; > anoobj@marvell.com; Fiona Trahe > Subject: [PATCH] test/crypto: added NULL algo tests to loop test mechanis= m >=20 > Added NULL algo tests into loop test mechanism used > by block cipher tests as easier to extend there. > Included chain, cipher-only and auth-only use-cases. > Extended to cover out-of-place use-cases and use-cases > where data length is not an 8-byte multiple. >=20 > Signed-off-by: Fiona Trahe > --- > app/test/test_cryptodev.c | 82 ++++++-- > app/test/test_cryptodev_aes_test_vectors.h | 277 > +++++++++++++++++++++++++++- > app/test/test_cryptodev_blockcipher.c | 9 +- > app/test/test_cryptodev_blockcipher.h | 1 + > app/test/test_cryptodev_hash_test_vectors.h | 56 +++++- > 5 files changed, 406 insertions(+), 19 deletions(-) >=20 > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c > index 9f31aaa7e..2b76f3ffc 100644 > --- a/app/test/test_cryptodev.c > +++ b/app/test/test_cryptodev.c > @@ -1673,6 +1673,64 @@ test_authonly_qat_all(void) >=20 > return TEST_SUCCESS; > } > + > +static int > +test_AES_chain_null_all(void) > +{ > + struct crypto_testsuite_params *ts_params =3D &testsuite_params; > + int status; > + > + status =3D test_blockcipher_all_tests(ts_params->mbuf_pool, > + ts_params->op_mpool, > + ts_params->session_mpool, ts_params->session_priv_mpool, > + ts_params->valid_devs[0], > + rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)), > + BLKCIPHER_AES_CHAIN_TYPE); > + > + TEST_ASSERT_EQUAL(status, 0, "Test failed"); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_AES_cipheronly_null_all(void) > +{ > + struct crypto_testsuite_params *ts_params =3D &testsuite_params; > + int status; > + > + status =3D test_blockcipher_all_tests(ts_params->mbuf_pool, > + ts_params->op_mpool, > + ts_params->session_mpool, ts_params->session_priv_mpool, > + ts_params->valid_devs[0], > + rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)), > + BLKCIPHER_AES_CIPHERONLY_TYPE); > + > + TEST_ASSERT_EQUAL(status, 0, "Test failed"); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_authonly_null_all(void) > +{ > + struct crypto_testsuite_params *ts_params =3D &testsuite_params; > + int status; > + > + status =3D test_blockcipher_all_tests(ts_params->mbuf_pool, > + ts_params->op_mpool, > + ts_params->session_mpool, ts_params->session_priv_mpool, > + ts_params->valid_devs[0], > + rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)), > + BLKCIPHER_AUTHONLY_TYPE); > + > + TEST_ASSERT_EQUAL(status, 0, "Test failed"); > + > + return TEST_SUCCESS; > +} > + > static int > test_AES_chain_mb_all(void) > { > @@ -9257,15 +9315,9 @@ static struct unit_test_suite cryptodev_qat_testsu= ite > =3D { > TEST_CASE_ST(ut_setup, ut_teardown, > test_MD5_HMAC_verify_case_2), >=20 > - /** NULL tests */ > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_auth_only_operation), > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_cipher_only_operation), > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_cipher_auth_operation), > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_auth_cipher_operation), > + /** NULL algo tests done in chain_all, > + * cipheronly and authonly suites > + */ >=20 > /** KASUMI tests */ > TEST_CASE_ST(ut_setup, ut_teardown, > @@ -10304,17 +10356,15 @@ static struct unit_test_suite > cryptodev_null_testsuite =3D { > .teardown =3D testsuite_teardown, > .unit_test_cases =3D { > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_auth_only_operation), > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_cipher_only_operation), > + test_null_invalid_operation), > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_cipher_auth_operation), > + test_null_burst_operation), > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_auth_cipher_operation), > + test_AES_chain_null_all), > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_invalid_operation), > + test_AES_cipheronly_null_all), > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_burst_operation), > + test_authonly_null_all), >=20 > TEST_CASES_END() /**< NULL terminate unit test array */ > } > diff --git a/app/test/test_cryptodev_aes_test_vectors.h > b/app/test/test_cryptodev_aes_test_vectors.h > index e5b9da4fa..ee4fdc9a7 100644 > --- a/app/test/test_cryptodev_aes_test_vectors.h > +++ b/app/test/test_cryptodev_aes_test_vectors.h > @@ -221,6 +221,141 @@ static const uint8_t ciphertext512_aes128cbc[] =3D = { > 0xBB, 0xFF, 0xAE, 0xB5, 0x99, 0x6E, 0xCB, 0x0C > }; >=20 > +/* NULL cipher NULL auth 8-byte multiple test vector */ > +static const struct blockcipher_test_data null_test_data_chain_x8_multip= le =3D { > + .crypto_algo =3D RTE_CRYPTO_CIPHER_NULL, > + .cipher_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, > + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C > + }, > + .len =3D 16 > + }, > + .iv =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, > + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF > + }, > + .len =3D 16 > + }, > + .plaintext =3D { > + .data =3D plaintext_aes_common, > + .len =3D 512 > + }, > + .ciphertext =3D { > + .data =3D plaintext_aes_common, > + .len =3D 512 > + }, > + .auth_algo =3D RTE_CRYPTO_AUTH_NULL, > + .auth_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA, > + 0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD, > + 0xDE, 0xF4, 0xDE, 0xAD > + }, > + .len =3D 20 > + }, > + .digest =3D { > + .data =3D { > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00 > + }, > + .len =3D 20, > + .truncated_len =3D 12 > + } > +}; > + > +/* NULL cipher NULL auth 4-byte multiple test vector */ > +static const struct blockcipher_test_data null_test_data_chain_x4_multip= le =3D { > + .crypto_algo =3D RTE_CRYPTO_CIPHER_NULL, > + .cipher_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, > + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C > + }, > + .len =3D 16 > + }, > + .iv =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, > + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF > + }, > + .len =3D 16 > + }, > + .plaintext =3D { > + .data =3D plaintext_aes128ctr, > + .len =3D 20 > + }, > + .ciphertext =3D { > + .data =3D plaintext_aes128ctr, > + .len =3D 20 > + }, > + .auth_algo =3D RTE_CRYPTO_AUTH_NULL, > + .auth_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA, > + 0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD, > + 0xDE, 0xF4, 0xDE, 0xAD > + }, > + .len =3D 20 > + }, > + .digest =3D { > + .data =3D { > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00 > + }, > + .len =3D 20, > + .truncated_len =3D 12 > + } > +}; > + > +/* NULL cipher NULL auth 1-byte multiple test vector */ > +static const struct blockcipher_test_data null_test_data_chain_x1_multip= le =3D { > + .crypto_algo =3D RTE_CRYPTO_CIPHER_NULL, > + .cipher_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, > + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C > + }, > + .len =3D 16 > + }, > + .iv =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, > + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF > + }, > + .len =3D 16 > + }, > + .plaintext =3D { > + .data =3D plaintext_aes128ctr, > + .len =3D 21 > + }, > + .ciphertext =3D { > + .data =3D plaintext_aes128ctr, > + .len =3D 21 > + }, > + .auth_algo =3D RTE_CRYPTO_AUTH_NULL, > + .auth_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA, > + 0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD, > + 0xDE, 0xF4, 0xDE, 0xAD > + }, > + .len =3D 20 > + }, > + .digest =3D { > + .data =3D { > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00 > + }, > + .len =3D 20, > + .truncated_len =3D 12 > + } > +}; > + > /* AES128-CTR-SHA1 test vector */ > static const struct blockcipher_test_data aes_test_data_1 =3D { > .crypto_algo =3D RTE_CRYPTO_CIPHER_AES_CTR, > @@ -1822,6 +1957,90 @@ static const struct blockcipher_test_case > aes_chain_test_cases[] =3D { > BLOCKCIPHER_TEST_TARGET_PMD_CCP | > BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX > }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x8byte", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x8byte", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x8byte - > OOP", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x8byte - OOP", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x4byte", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x4byte", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x4byte - > OOP", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x4byte - OOP", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x1byte", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x1byte", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x1byte - > OOP", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x1byte - OOP", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > }; >=20 > static const struct blockcipher_test_case aes_cipheronly_test_cases[] = =3D { > @@ -2125,7 +2344,63 @@ static const struct blockcipher_test_case > aes_cipheronly_test_cases[] =3D { > .test_data =3D &aes_test_data_xts_key_64_pt_48, > .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > - } > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x8 - encryption", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENCRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x8 - decryption", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x4 - encryption", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENCRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x4 - decryption", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x4 - encryption - OOP", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENCRYPT, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x4 - decryption - OOP", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x1 - encryption", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENCRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x1 - decryption", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > }; >=20 > static const struct blockcipher_test_case aes_docsis_test_cases[] =3D { > diff --git a/app/test/test_cryptodev_blockcipher.c > b/app/test/test_cryptodev_blockcipher.c > index cdbdcce1e..b8dcc3962 100644 > --- a/app/test/test_cryptodev_blockcipher.c > +++ b/app/test/test_cryptodev_blockcipher.c > @@ -77,6 +77,8 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > RTE_STR(CRYPTODEV_NAME_VIRTIO_PMD)); > int octeontx_pmd =3D rte_cryptodev_driver_id_get( > RTE_STR(CRYPTODEV_NAME_OCTEONTX_SYM_PMD)); > + int null_pmd =3D rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)); >=20 > int nb_segs =3D 1; > uint32_t nb_iterates =3D 0; > @@ -122,7 +124,8 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > driver_id =3D=3D mrvl_pmd || > driver_id =3D=3D ccp_pmd || > driver_id =3D=3D virtio_pmd || > - driver_id =3D=3D octeontx_pmd) { /* Fall through */ > + driver_id =3D=3D octeontx_pmd || > + driver_id =3D=3D null_pmd) { /* Fall through */ > digest_len =3D tdata->digest.len; > } else if (driver_id =3D=3D aesni_mb_pmd || > driver_id =3D=3D scheduler_pmd) { > @@ -712,6 +715,8 @@ test_blockcipher_all_tests(struct rte_mempool > *mbuf_pool, > RTE_STR(CRYPTODEV_NAME_VIRTIO_PMD)); > int octeontx_pmd =3D rte_cryptodev_driver_id_get( > RTE_STR(CRYPTODEV_NAME_OCTEONTX_SYM_PMD)); > + int null_pmd =3D rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)); >=20 > switch (test_type) { > case BLKCIPHER_AES_CHAIN_TYPE: > @@ -782,6 +787,8 @@ test_blockcipher_all_tests(struct rte_mempool > *mbuf_pool, > target_pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO; > else if (driver_id =3D=3D octeontx_pmd) > target_pmd_mask =3D > BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX; > + else if (driver_id =3D=3D null_pmd) > + target_pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL; > else > TEST_ASSERT(0, "Unrecognized cryptodev type"); >=20 > diff --git a/app/test/test_cryptodev_blockcipher.h > b/app/test/test_cryptodev_blockcipher.h > index 060d10498..3d4b97533 100644 > --- a/app/test/test_cryptodev_blockcipher.h > +++ b/app/test/test_cryptodev_blockcipher.h > @@ -31,6 +31,7 @@ > #define BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO 0x0200 /* VIRTIO flag > */ > #define BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR 0x0400 /* CAAM_JR > flag */ > #define BLOCKCIPHER_TEST_TARGET_PMD_CCP 0x0800 /* CCP > flag */ > +#define BLOCKCIPHER_TEST_TARGET_PMD_NULL 0x1000 /* NULL flag > */ >=20 > #define BLOCKCIPHER_TEST_OP_CIPHER > (BLOCKCIPHER_TEST_OP_ENCRYPT | \ > BLOCKCIPHER_TEST_OP_DECRYPT) > diff --git a/app/test/test_cryptodev_hash_test_vectors.h > b/app/test/test_cryptodev_hash_test_vectors.h > index d3a26609c..6f201c08a 100644 > --- a/app/test/test_cryptodev_hash_test_vectors.h > +++ b/app/test/test_cryptodev_hash_test_vectors.h > @@ -358,6 +358,31 @@ cmac_test_vector =3D { > }; >=20 > static const struct blockcipher_test_data > +null_auth_test_vector =3D { > + .auth_algo =3D RTE_CRYPTO_AUTH_NULL, > + .ciphertext =3D { /* arbitrary data - shouldn't be used */ > + .data =3D plaintext_hash, > + .len =3D 512 > + }, > + .auth_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, > + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C > + }, > + .len =3D 16 > + }, > + .digest =3D { > + .data =3D { > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00 > + }, > + .len =3D 20, > + .truncated_len =3D 12 > + } > +}; > + > +static const struct blockcipher_test_data > cmac_test_vector_12 =3D { > .auth_algo =3D RTE_CRYPTO_AUTH_AES_CMAC, > .ciphertext =3D { > @@ -741,7 +766,36 @@ static const struct blockcipher_test_case > hash_test_cases[] =3D { > .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY, > .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_MB | > BLOCKCIPHER_TEST_TARGET_PMD_QAT > - } > + }, > + { > + .test_descr =3D "NULL algo - auth generate", > + .test_data =3D &null_auth_test_vector, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL algo - auth verify", > + .test_data =3D &null_auth_test_vector, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL algo - auth generate - OOP", > + .test_data =3D &null_auth_test_vector, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL algo - auth verify - OOP", > + .test_data =3D &null_auth_test_vector, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + > }; >=20 > #endif /* TEST_CRYPTODEV_HASH_TEST_VECTORS_H_ */ > -- > 2.13.6 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6F75EA0679 for ; Tue, 30 Apr 2019 09:20:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 460B05F62; Tue, 30 Apr 2019 09:20:20 +0200 (CEST) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30052.outbound.protection.outlook.com [40.107.3.52]) by dpdk.org (Postfix) with ESMTP id A4D8A5F62 for ; Tue, 30 Apr 2019 09:20:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6TLj3fiVty1s3no/W+LVzCYDyrYPGuCA9h3AwsppvOE=; b=dGVhHn/aKQBoNgbYz96DFRuE7hFj10AeOVIoSlPwHoW2rQedpg0p7CHX/pOUsxDeM4NiVoVmBxLTGw1BOB4pb733QXAI8pNDVv3GCmAX83jaD1kUHLA7qUEOHHMwpuEFS2D4mXV/t6IGBAAffoggkH7jCqvpOvZhXpw50hXKJ/E= Received: from VI1PR04MB4893.eurprd04.prod.outlook.com (20.177.49.154) by VI1PR04MB6302.eurprd04.prod.outlook.com (20.179.28.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.14; Tue, 30 Apr 2019 07:20:17 +0000 Received: from VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::98b0:84a6:1c08:57c7]) by VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::98b0:84a6:1c08:57c7%3]) with mapi id 15.20.1835.018; Tue, 30 Apr 2019 07:20:17 +0000 From: Akhil Goyal To: Fiona Trahe , "dev@dpdk.org" CC: "thomas@monjalon.net" , "arkadiuszx.kusztal@intel.com" , "bernard.iremonger@intel.com" , "anoobj@marvell.com" Thread-Topic: [PATCH] test/crypto: added NULL algo tests to loop test mechanism Thread-Index: AQHU/GbB2aJRqrSDu06NkgIMMBDmiKZUUK3w Date: Tue, 30 Apr 2019 07:20:16 +0000 Message-ID: References: <1556307118-16624-1-git-send-email-fiona.trahe@intel.com> In-Reply-To: <1556307118-16624-1-git-send-email-fiona.trahe@intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-originating-ip: [92.120.1.65] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2acfd331-176c-49cf-8b10-08d6cd3c4ba9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:VI1PR04MB6302; x-ms-traffictypediagnostic: VI1PR04MB6302: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(346002)(136003)(39860400002)(13464003)(199004)(189003)(53936002)(6506007)(446003)(305945005)(68736007)(7736002)(53546011)(99286004)(76176011)(2501003)(102836004)(11346002)(110136005)(186003)(33656002)(2906002)(55016002)(316002)(26005)(3846002)(6116002)(54906003)(6306002)(478600001)(966005)(53946003)(14454004)(9686003)(6436002)(7696005)(4326008)(8936002)(25786009)(6246003)(66066001)(8676002)(66946007)(52536014)(81166006)(81156014)(44832011)(229853002)(97736004)(30864003)(71190400001)(256004)(74316002)(71200400001)(73956011)(76116006)(86362001)(486006)(14444005)(66556008)(66476007)(476003)(64756008)(5660300002)(66446008)(473944003)(414714003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB6302; H:VI1PR04MB4893.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: rkcsIkZGc62BRf6rfJMbnbrp8azKffRQJVPQbmFSqnfLT4v7KuhZG+rg6d7GCnmvpKCTcQ0i/UVniFKZrpl3t/UYroGa1opM1mdf9rjbVXNtOBhlX0Pw3ZcqMh3PJ8m6zDIEXCEPH3BpXQNoLGEQjSd/e9laFHaQBH9SUFjSVNUD+DM+l0WTtGSek+1CUx1+qAo6JAYMJOaBlqche36r1vbNzH7X1+8AHj+Moms5eAKqSTY+aGLlRMkkpWwRCT9PyF2B+REUwHQngh7B9mglWSGSCC2trAh2jHL7qvEL1Y4ZOl8ql3ZopYDL75Z0SGSk+RrJThKNJWwY2d46SjAi6Rtnnoum/jhEEx2mAgzW/j9JJhWrN7bP04WXWveuVUxAMdb/+Ukaj4PKknABoICRfY+VxOvJ7EnlrFrGbAiIWTE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2acfd331-176c-49cf-8b10-08d6cd3c4ba9 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 07:20:16.9477 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6302 Subject: Re: [dpdk-dev] [PATCH] test/crypto: added NULL algo tests to loop test mechanism 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" Message-ID: <20190430072016.CEsNmSr-9GYXmpK80JqwPKXtOqBebw8lrFNrsSk8hDA@z> Hi Fiona, I believe this patch is for 19.08, we normally do not accept such changes i= n RC4. Also the patch=20 http://patches.dpdk.org/patch/53117/ looks to be meaningful if this patch is accepted. Do you want we to apply the fix in driver in this release and add the test = cases in the next release, or should I defer both in next release. Thanks, Akhil > -----Original Message----- > From: Fiona Trahe > Sent: Saturday, April 27, 2019 1:02 AM > To: dev@dpdk.org > Cc: thomas@monjalon.net; Akhil Goyal ; > arkadiuszx.kusztal@intel.com; bernard.iremonger@intel.com; > anoobj@marvell.com; Fiona Trahe > Subject: [PATCH] test/crypto: added NULL algo tests to loop test mechanis= m >=20 > Added NULL algo tests into loop test mechanism used > by block cipher tests as easier to extend there. > Included chain, cipher-only and auth-only use-cases. > Extended to cover out-of-place use-cases and use-cases > where data length is not an 8-byte multiple. >=20 > Signed-off-by: Fiona Trahe > --- > app/test/test_cryptodev.c | 82 ++++++-- > app/test/test_cryptodev_aes_test_vectors.h | 277 > +++++++++++++++++++++++++++- > app/test/test_cryptodev_blockcipher.c | 9 +- > app/test/test_cryptodev_blockcipher.h | 1 + > app/test/test_cryptodev_hash_test_vectors.h | 56 +++++- > 5 files changed, 406 insertions(+), 19 deletions(-) >=20 > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c > index 9f31aaa7e..2b76f3ffc 100644 > --- a/app/test/test_cryptodev.c > +++ b/app/test/test_cryptodev.c > @@ -1673,6 +1673,64 @@ test_authonly_qat_all(void) >=20 > return TEST_SUCCESS; > } > + > +static int > +test_AES_chain_null_all(void) > +{ > + struct crypto_testsuite_params *ts_params =3D &testsuite_params; > + int status; > + > + status =3D test_blockcipher_all_tests(ts_params->mbuf_pool, > + ts_params->op_mpool, > + ts_params->session_mpool, ts_params->session_priv_mpool, > + ts_params->valid_devs[0], > + rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)), > + BLKCIPHER_AES_CHAIN_TYPE); > + > + TEST_ASSERT_EQUAL(status, 0, "Test failed"); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_AES_cipheronly_null_all(void) > +{ > + struct crypto_testsuite_params *ts_params =3D &testsuite_params; > + int status; > + > + status =3D test_blockcipher_all_tests(ts_params->mbuf_pool, > + ts_params->op_mpool, > + ts_params->session_mpool, ts_params->session_priv_mpool, > + ts_params->valid_devs[0], > + rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)), > + BLKCIPHER_AES_CIPHERONLY_TYPE); > + > + TEST_ASSERT_EQUAL(status, 0, "Test failed"); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_authonly_null_all(void) > +{ > + struct crypto_testsuite_params *ts_params =3D &testsuite_params; > + int status; > + > + status =3D test_blockcipher_all_tests(ts_params->mbuf_pool, > + ts_params->op_mpool, > + ts_params->session_mpool, ts_params->session_priv_mpool, > + ts_params->valid_devs[0], > + rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)), > + BLKCIPHER_AUTHONLY_TYPE); > + > + TEST_ASSERT_EQUAL(status, 0, "Test failed"); > + > + return TEST_SUCCESS; > +} > + > static int > test_AES_chain_mb_all(void) > { > @@ -9257,15 +9315,9 @@ static struct unit_test_suite cryptodev_qat_testsu= ite > =3D { > TEST_CASE_ST(ut_setup, ut_teardown, > test_MD5_HMAC_verify_case_2), >=20 > - /** NULL tests */ > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_auth_only_operation), > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_cipher_only_operation), > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_cipher_auth_operation), > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_auth_cipher_operation), > + /** NULL algo tests done in chain_all, > + * cipheronly and authonly suites > + */ >=20 > /** KASUMI tests */ > TEST_CASE_ST(ut_setup, ut_teardown, > @@ -10304,17 +10356,15 @@ static struct unit_test_suite > cryptodev_null_testsuite =3D { > .teardown =3D testsuite_teardown, > .unit_test_cases =3D { > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_auth_only_operation), > - TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_cipher_only_operation), > + test_null_invalid_operation), > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_cipher_auth_operation), > + test_null_burst_operation), > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_auth_cipher_operation), > + test_AES_chain_null_all), > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_invalid_operation), > + test_AES_cipheronly_null_all), > TEST_CASE_ST(ut_setup, ut_teardown, > - test_null_burst_operation), > + test_authonly_null_all), >=20 > TEST_CASES_END() /**< NULL terminate unit test array */ > } > diff --git a/app/test/test_cryptodev_aes_test_vectors.h > b/app/test/test_cryptodev_aes_test_vectors.h > index e5b9da4fa..ee4fdc9a7 100644 > --- a/app/test/test_cryptodev_aes_test_vectors.h > +++ b/app/test/test_cryptodev_aes_test_vectors.h > @@ -221,6 +221,141 @@ static const uint8_t ciphertext512_aes128cbc[] =3D = { > 0xBB, 0xFF, 0xAE, 0xB5, 0x99, 0x6E, 0xCB, 0x0C > }; >=20 > +/* NULL cipher NULL auth 8-byte multiple test vector */ > +static const struct blockcipher_test_data null_test_data_chain_x8_multip= le =3D { > + .crypto_algo =3D RTE_CRYPTO_CIPHER_NULL, > + .cipher_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, > + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C > + }, > + .len =3D 16 > + }, > + .iv =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, > + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF > + }, > + .len =3D 16 > + }, > + .plaintext =3D { > + .data =3D plaintext_aes_common, > + .len =3D 512 > + }, > + .ciphertext =3D { > + .data =3D plaintext_aes_common, > + .len =3D 512 > + }, > + .auth_algo =3D RTE_CRYPTO_AUTH_NULL, > + .auth_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA, > + 0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD, > + 0xDE, 0xF4, 0xDE, 0xAD > + }, > + .len =3D 20 > + }, > + .digest =3D { > + .data =3D { > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00 > + }, > + .len =3D 20, > + .truncated_len =3D 12 > + } > +}; > + > +/* NULL cipher NULL auth 4-byte multiple test vector */ > +static const struct blockcipher_test_data null_test_data_chain_x4_multip= le =3D { > + .crypto_algo =3D RTE_CRYPTO_CIPHER_NULL, > + .cipher_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, > + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C > + }, > + .len =3D 16 > + }, > + .iv =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, > + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF > + }, > + .len =3D 16 > + }, > + .plaintext =3D { > + .data =3D plaintext_aes128ctr, > + .len =3D 20 > + }, > + .ciphertext =3D { > + .data =3D plaintext_aes128ctr, > + .len =3D 20 > + }, > + .auth_algo =3D RTE_CRYPTO_AUTH_NULL, > + .auth_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA, > + 0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD, > + 0xDE, 0xF4, 0xDE, 0xAD > + }, > + .len =3D 20 > + }, > + .digest =3D { > + .data =3D { > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00 > + }, > + .len =3D 20, > + .truncated_len =3D 12 > + } > +}; > + > +/* NULL cipher NULL auth 1-byte multiple test vector */ > +static const struct blockcipher_test_data null_test_data_chain_x1_multip= le =3D { > + .crypto_algo =3D RTE_CRYPTO_CIPHER_NULL, > + .cipher_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, > + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C > + }, > + .len =3D 16 > + }, > + .iv =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, > + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF > + }, > + .len =3D 16 > + }, > + .plaintext =3D { > + .data =3D plaintext_aes128ctr, > + .len =3D 21 > + }, > + .ciphertext =3D { > + .data =3D plaintext_aes128ctr, > + .len =3D 21 > + }, > + .auth_algo =3D RTE_CRYPTO_AUTH_NULL, > + .auth_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA, > + 0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD, > + 0xDE, 0xF4, 0xDE, 0xAD > + }, > + .len =3D 20 > + }, > + .digest =3D { > + .data =3D { > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00 > + }, > + .len =3D 20, > + .truncated_len =3D 12 > + } > +}; > + > /* AES128-CTR-SHA1 test vector */ > static const struct blockcipher_test_data aes_test_data_1 =3D { > .crypto_algo =3D RTE_CRYPTO_CIPHER_AES_CTR, > @@ -1822,6 +1957,90 @@ static const struct blockcipher_test_case > aes_chain_test_cases[] =3D { > BLOCKCIPHER_TEST_TARGET_PMD_CCP | > BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX > }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x8byte", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x8byte", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x8byte - > OOP", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x8byte - OOP", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x4byte", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x4byte", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x4byte - > OOP", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x4byte - OOP", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x1byte", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x1byte", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-CIPHER-NULL-AUTH encrypt & gen x1byte - > OOP", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL-AUTH-NULL-CIPHER verify & decrypt > x1byte - OOP", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > }; >=20 > static const struct blockcipher_test_case aes_cipheronly_test_cases[] = =3D { > @@ -2125,7 +2344,63 @@ static const struct blockcipher_test_case > aes_cipheronly_test_cases[] =3D { > .test_data =3D &aes_test_data_xts_key_64_pt_48, > .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > - } > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x8 - encryption", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENCRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x8 - decryption", > + .test_data =3D &null_test_data_chain_x8_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x4 - encryption", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENCRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x4 - decryption", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x4 - encryption - OOP", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENCRYPT, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x4 - decryption - OOP", > + .test_data =3D &null_test_data_chain_x4_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x1 - encryption", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_ENCRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "cipher-only - NULL algo - x1 - decryption", > + .test_data =3D &null_test_data_chain_x1_multiple, > + .op_mask =3D BLOCKCIPHER_TEST_OP_DECRYPT, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > }; >=20 > static const struct blockcipher_test_case aes_docsis_test_cases[] =3D { > diff --git a/app/test/test_cryptodev_blockcipher.c > b/app/test/test_cryptodev_blockcipher.c > index cdbdcce1e..b8dcc3962 100644 > --- a/app/test/test_cryptodev_blockcipher.c > +++ b/app/test/test_cryptodev_blockcipher.c > @@ -77,6 +77,8 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > RTE_STR(CRYPTODEV_NAME_VIRTIO_PMD)); > int octeontx_pmd =3D rte_cryptodev_driver_id_get( > RTE_STR(CRYPTODEV_NAME_OCTEONTX_SYM_PMD)); > + int null_pmd =3D rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)); >=20 > int nb_segs =3D 1; > uint32_t nb_iterates =3D 0; > @@ -122,7 +124,8 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > driver_id =3D=3D mrvl_pmd || > driver_id =3D=3D ccp_pmd || > driver_id =3D=3D virtio_pmd || > - driver_id =3D=3D octeontx_pmd) { /* Fall through */ > + driver_id =3D=3D octeontx_pmd || > + driver_id =3D=3D null_pmd) { /* Fall through */ > digest_len =3D tdata->digest.len; > } else if (driver_id =3D=3D aesni_mb_pmd || > driver_id =3D=3D scheduler_pmd) { > @@ -712,6 +715,8 @@ test_blockcipher_all_tests(struct rte_mempool > *mbuf_pool, > RTE_STR(CRYPTODEV_NAME_VIRTIO_PMD)); > int octeontx_pmd =3D rte_cryptodev_driver_id_get( > RTE_STR(CRYPTODEV_NAME_OCTEONTX_SYM_PMD)); > + int null_pmd =3D rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)); >=20 > switch (test_type) { > case BLKCIPHER_AES_CHAIN_TYPE: > @@ -782,6 +787,8 @@ test_blockcipher_all_tests(struct rte_mempool > *mbuf_pool, > target_pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO; > else if (driver_id =3D=3D octeontx_pmd) > target_pmd_mask =3D > BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX; > + else if (driver_id =3D=3D null_pmd) > + target_pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL; > else > TEST_ASSERT(0, "Unrecognized cryptodev type"); >=20 > diff --git a/app/test/test_cryptodev_blockcipher.h > b/app/test/test_cryptodev_blockcipher.h > index 060d10498..3d4b97533 100644 > --- a/app/test/test_cryptodev_blockcipher.h > +++ b/app/test/test_cryptodev_blockcipher.h > @@ -31,6 +31,7 @@ > #define BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO 0x0200 /* VIRTIO flag > */ > #define BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR 0x0400 /* CAAM_JR > flag */ > #define BLOCKCIPHER_TEST_TARGET_PMD_CCP 0x0800 /* CCP > flag */ > +#define BLOCKCIPHER_TEST_TARGET_PMD_NULL 0x1000 /* NULL flag > */ >=20 > #define BLOCKCIPHER_TEST_OP_CIPHER > (BLOCKCIPHER_TEST_OP_ENCRYPT | \ > BLOCKCIPHER_TEST_OP_DECRYPT) > diff --git a/app/test/test_cryptodev_hash_test_vectors.h > b/app/test/test_cryptodev_hash_test_vectors.h > index d3a26609c..6f201c08a 100644 > --- a/app/test/test_cryptodev_hash_test_vectors.h > +++ b/app/test/test_cryptodev_hash_test_vectors.h > @@ -358,6 +358,31 @@ cmac_test_vector =3D { > }; >=20 > static const struct blockcipher_test_data > +null_auth_test_vector =3D { > + .auth_algo =3D RTE_CRYPTO_AUTH_NULL, > + .ciphertext =3D { /* arbitrary data - shouldn't be used */ > + .data =3D plaintext_hash, > + .len =3D 512 > + }, > + .auth_key =3D { /* arbitrary data - shouldn't be used */ > + .data =3D { > + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, > + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C > + }, > + .len =3D 16 > + }, > + .digest =3D { > + .data =3D { > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00 > + }, > + .len =3D 20, > + .truncated_len =3D 12 > + } > +}; > + > +static const struct blockcipher_test_data > cmac_test_vector_12 =3D { > .auth_algo =3D RTE_CRYPTO_AUTH_AES_CMAC, > .ciphertext =3D { > @@ -741,7 +766,36 @@ static const struct blockcipher_test_case > hash_test_cases[] =3D { > .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY, > .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_MB | > BLOCKCIPHER_TEST_TARGET_PMD_QAT > - } > + }, > + { > + .test_descr =3D "NULL algo - auth generate", > + .test_data =3D &null_auth_test_vector, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL algo - auth verify", > + .test_data =3D &null_auth_test_vector, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_NULL | > + BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL algo - auth generate - OOP", > + .test_data =3D &null_auth_test_vector, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_GEN, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + { > + .test_descr =3D "NULL algo - auth verify - OOP", > + .test_data =3D &null_auth_test_vector, > + .op_mask =3D BLOCKCIPHER_TEST_OP_AUTH_VERIFY, > + .feature_mask =3D BLOCKCIPHER_TEST_FEATURE_OOP, > + .pmd_mask =3D BLOCKCIPHER_TEST_TARGET_PMD_QAT > + }, > + > }; >=20 > #endif /* TEST_CRYPTODEV_HASH_TEST_VECTORS_H_ */ > -- > 2.13.6