From: Volodymyr Fialko <vfialko@marvell.com>
To: <dev@dpdk.org>, Akhil Goyal <gakhil@marvell.com>,
Fan Zhang <fanzhang.oss@gmail.com>,
Yipeng Wang <yipeng1.wang@intel.com>,
Sameh Gobriel <sameh.gobriel@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>,
Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Cc: <jerinj@marvell.com>, <anoobj@marvell.com>,
Volodymyr Fialko <vfialko@marvell.com>
Subject: [PATCH 2/3] app/test: add SHAKE test cases
Date: Wed, 4 Jan 2023 15:38:14 +0100 [thread overview]
Message-ID: <20230104143815.603524-3-vfialko@marvell.com> (raw)
In-Reply-To: <20230104143815.603524-1-vfialko@marvell.com>
Add test cases for SHAKE hash algorithm for Digest and Digest-Verify.
Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
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,
--
2.34.1
next prev parent reply other threads:[~2023-01-04 14:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 14:38 [PATCH 0/3] Add support for SHAKE Volodymyr Fialko
2023-01-04 14:38 ` [PATCH 1/3] cryptodev: add SHAKE algorithm Volodymyr Fialko
2023-01-04 14:38 ` Volodymyr Fialko [this message]
2023-01-04 14:38 ` [PATCH 3/3] crypto/cnxk: add support for SHAKE hash Volodymyr Fialko
2023-01-12 10:47 ` [PATCH v2 0/3] Add support for SHAKE Volodymyr Fialko
2023-01-12 10:47 ` [PATCH v2 1/3] cryptodev: add SHAKE algorithm Volodymyr Fialko
2023-01-30 19:24 ` Akhil Goyal
2023-01-12 10:47 ` [PATCH v2 2/3] app/test: add SHAKE test cases Volodymyr Fialko
2023-01-30 19:25 ` Akhil Goyal
2023-01-12 10:47 ` [PATCH v2 3/3] crypto/cnxk: add support for SHAKE hash Volodymyr Fialko
2023-01-31 8:10 ` [EXT] [PATCH v2 0/3] Add support for SHAKE Akhil Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230104143815.603524-3-vfialko@marvell.com \
--to=vfialko@marvell.com \
--cc=anoobj@marvell.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=fanzhang.oss@gmail.com \
--cc=gakhil@marvell.com \
--cc=jerinj@marvell.com \
--cc=sameh.gobriel@intel.com \
--cc=vladimir.medvedkin@intel.com \
--cc=yipeng1.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).