From patchwork Thu Jan 12 10:47:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Fialko X-Patchwork-Id: 121892 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C6B0B423B5; Thu, 12 Jan 2023 11:47:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDBCF42D2D; Thu, 12 Jan 2023 11:47:53 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 7529040156 for ; Thu, 12 Jan 2023 11:47:51 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30C9dqq4021107; Thu, 12 Jan 2023 02:47:50 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Y0gMLznTIOdp5V+TqKzry9jwRw3+iNzZEz5g0YbaflA=; b=eRcuTrlayEUR7oUaizpHpOjC6ue7pfkIxOceC2IK2JOvfSzbOaEFeNm5Bo3KJUzoMinD 8O15TSJWxj6z5TV7nzSIGkDScEuwC2Mi19+1Ec0p6FsQ1sY0rJpBcJIVjz4ZIgcq/RRx 4jS2rFnPNsJzRQkd4I7lUBqJ3SrF0Oavf5hLzeKmCWsC7kU8LTDgzgeBo1gwxNXVsQWN bkiCnfFCW8J+PNG96K2OcRldotUSL8v85ltgacH7iuDIsGBrizkQCb5l9OEO0o/A8n9n 48S3WKcU+houuHwNj+zT6sCixvkW+6YnvsbxCMHr4AbsOAcaDvu+7VzhvOhYHsqPLD6w TQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3n1k56ykam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 12 Jan 2023 02:47:50 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 12 Jan 2023 02:47:48 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Thu, 12 Jan 2023 02:47:48 -0800 Received: from cavium-DT10.. (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id CAA0C3F706D; Thu, 12 Jan 2023 02:47:44 -0800 (PST) From: Volodymyr Fialko To: , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin , Akhil Goyal , Fan Zhang CC: , , Volodymyr Fialko Subject: [PATCH v2 2/3] app/test: add SHAKE test cases Date: Thu, 12 Jan 2023 11:47:32 +0100 Message-ID: <20230112104733.1835722-3-vfialko@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112104733.1835722-1-vfialko@marvell.com> References: <20230104143815.603524-1-vfialko@marvell.com> <20230112104733.1835722-1-vfialko@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: gf4DbG7BpJTdTqwfjrmkXeLUQ9tbYiqa X-Proofpoint-GUID: gf4DbG7BpJTdTqwfjrmkXeLUQ9tbYiqa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_06,2023-01-12_01,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add test cases for SHAKE hash algorithm for Digest and Digest-Verify. Signed-off-by: Volodymyr Fialko Acked-by: Akhil Goyal --- app/test/test_cryptodev_hash_test_vectors.h | 66 +++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/app/test/test_cryptodev_hash_test_vectors.h b/app/test/test_cryptodev_hash_test_vectors.h index 4b57286fa5..fa9986a4da 100644 --- a/app/test/test_cryptodev_hash_test_vectors.h +++ b/app/test/test_cryptodev_hash_test_vectors.h @@ -538,6 +538,52 @@ hmac_sha3_512_test_vector = { } }; +static const struct blockcipher_test_data +shake_128_test_vector = { + .auth_algo = RTE_CRYPTO_AUTH_SHAKE_128, + .ciphertext = { + .data = plaintext_hash, + .len = 512 + }, + .digest = { + .data = { + 0x69, 0xBD, 0xD5, 0x14, 0x85, 0xE0, 0x44, 0xA4, + 0x25, 0xE6, 0x9F, 0x81, 0xC8, 0x18, 0x58, 0x3E, + 0xFE, 0xC9, 0x0B, 0xAD, 0x27, 0x98, 0x14, 0x3F, + 0xB9, 0x7D, 0x68, 0x4D, 0x60, 0x77, 0x82, 0x64, + 0x6D, 0x64, 0x66, 0x67, 0xFA, 0xBC, 0x4F, 0xAC, + 0x9C, 0x75, 0x8D, 0x63, 0xBA, 0xBD, 0x2B, 0x03, + 0x0F, 0x2F, 0x46, 0x15, 0x88, 0xF0, 0x8C, 0x09, + 0xAC, 0x87, 0x84, 0x5B, 0xCA, 0x65, 0xA1, 0x14 + }, + .len = 64, + .truncated_len = 64 + } +}; + +static const struct blockcipher_test_data +shake_256_test_vector = { + .auth_algo = RTE_CRYPTO_AUTH_SHAKE_256, + .ciphertext = { + .data = plaintext_hash, + .len = 512 + }, + .digest = { + .data = { + 0x9E, 0xA2, 0x1B, 0x84, 0x15, 0x0E, 0xF0, 0x46, + 0xD9, 0xA9, 0x11, 0x02, 0x11, 0x67, 0x9A, 0xDC, + 0x62, 0x95, 0x8C, 0xD6, 0xEF, 0x89, 0x35, 0x8C, + 0xBF, 0x41, 0x5F, 0x23, 0x16, 0xBD, 0x0C, 0xDE, + 0xEC, 0x1D, 0x47, 0x90, 0xA4, 0xD9, 0x18, 0x63, + 0xE1, 0x60, 0xF8, 0xAF, 0x0F, 0x57, 0xBA, 0xCA, + 0x5D, 0x97, 0x58, 0xF5, 0xFF, 0xE4, 0x85, 0x40, + 0xCA, 0x7D, 0xB8, 0x35, 0x3B, 0x89, 0xCA, 0x34 + }, + .len = 64, + .truncated_len = 64 + } +}; + static const struct blockcipher_test_data cmac_test_vector = { .auth_algo = RTE_CRYPTO_AUTH_AES_CMAC, @@ -853,6 +899,26 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &hmac_sha3_512_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY, }, + { + .test_descr = "SHAKE_128 Digest", + .test_data = &shake_128_test_vector, + .op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN, + }, + { + .test_descr = "SHAKE_128 Digest Verify", + .test_data = &shake_128_test_vector, + .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY, + }, + { + .test_descr = "SHAKE_256 Digest", + .test_data = &shake_256_test_vector, + .op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN, + }, + { + .test_descr = "SHAKE_256 Digest Verify", + .test_data = &shake_256_test_vector, + .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY, + }, { .test_descr = "CMAC Digest 12B", .test_data = &cmac_test_vector_12,