From patchwork Wed Jan 4 14:38:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Fialko X-Patchwork-Id: 121578 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 1DD35A00C2; Wed, 4 Jan 2023 15:38:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8BD9F42D22; Wed, 4 Jan 2023 15:38:35 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 100EC42D21 for ; Wed, 4 Jan 2023 15:38:33 +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 3043cric004846; Wed, 4 Jan 2023 06:38:33 -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=k4D7wrxPZBngw2ZSCLyw4bzLyVeb4VvXg75aqYlRo2P/9JHH6LyZ5gsqdhCoIDD7BAqx 27bskqrecGi+/iyOru1JpisiX1KKmD3KUSxLU5mivht0dDiZZ9xloGliRDPk7W+6NGn6 IcMAnyci4mCf5j0k5ZVYsp0qxrrIwc2ggIJwv+0PYdlDdtGttCbDfIvhMxsc0eAyVr9g PCVM5/ScpphZpp94TRG65X6AJMoXky6syY9axDah8F8oxzqV+6TglhH/J9r/ghZ9wOxh LnVbZDkF+cBrHrlbn/ISko6B9YYtJh/trsqBLq7tlSLl9tCZ3xrbibf39VcrDD65sUVW Ig== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3mtnftkxa0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 04 Jan 2023 06:38:33 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 4 Jan 2023 06:38:31 -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; Wed, 4 Jan 2023 06:38:31 -0800 Received: from cavium-DT10.. (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 932C13F7054; Wed, 4 Jan 2023 06:38:28 -0800 (PST) From: Volodymyr Fialko To: , Akhil Goyal , Fan Zhang , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin CC: , , Volodymyr Fialko Subject: [PATCH 2/3] app/test: add SHAKE test cases Date: Wed, 4 Jan 2023 15:38:14 +0100 Message-ID: <20230104143815.603524-3-vfialko@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230104143815.603524-1-vfialko@marvell.com> References: <20230104143815.603524-1-vfialko@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: BScP75_pzS46OErmSRA9PkRiTYEkXbqW X-Proofpoint-ORIG-GUID: BScP75_pzS46OErmSRA9PkRiTYEkXbqW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-04_07,2023-01-04_02,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 --- 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,