From: Anoob Joseph <anoobj@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>, Jerin Jacob <jerinj@marvell.com>
Cc: Tejasree Kondoj <ktejasree@marvell.com>,
Harry van Haaren <harry.van.haaren@intel.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
<dev@dpdk.org>, "Vidya Sagar Velumuri" <vvelumuri@marvell.com>
Subject: [PATCH 07/14] test/crypto: add AES-GCM 128 TLS 1.2 vector
Date: Thu, 7 Dec 2023 18:32:09 +0530 [thread overview]
Message-ID: <20231207130216.140-8-anoobj@marvell.com> (raw)
In-Reply-To: <20231207130216.140-1-anoobj@marvell.com>
From: Tejasree Kondoj <ktejasree@marvell.com>
Add AES-GCM-128 test vector generated with kTLS.
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
---
app/test/test_cryptodev.c | 8 +--
app/test/test_cryptodev_security_tls_record.h | 2 +-
...yptodev_security_tls_record_test_vectors.h | 67 ++++++++++++++++++-
3 files changed, 71 insertions(+), 6 deletions(-)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index cd83370790..e7e4b93c20 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -16814,13 +16814,13 @@ static struct unit_test_suite tls12_record_proto_testsuite = {
.setup = tls_record_proto_testsuite_setup,
.unit_test_cases = {
TEST_CASE_NAMED_WITH_DATA(
- "Known vector TBD",
+ "Write record known vector AES-GCM-128 (vector 1)",
ut_setup_security, ut_teardown,
- test_tls_record_proto_known_vec, &tls_test_data1),
+ test_tls_record_proto_known_vec, &tls_test_data_aes_128_gcm_v1),
TEST_CASE_NAMED_WITH_DATA(
- "Known vector TBD",
+ "Read record known vector AES-GCM-128 (vector 1)",
ut_setup_security, ut_teardown,
- test_tls_record_proto_known_vec_read, &tls_test_data1),
+ test_tls_record_proto_known_vec_read, &tls_test_data_aes_128_gcm_v1),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
diff --git a/app/test/test_cryptodev_security_tls_record.h b/app/test/test_cryptodev_security_tls_record.h
index 9a0cf70218..b9cadd5cd4 100644
--- a/app/test/test_cryptodev_security_tls_record.h
+++ b/app/test/test_cryptodev_security_tls_record.h
@@ -55,7 +55,7 @@ struct tls_record_test_flags {
bool display_alg;
};
-extern struct tls_record_test_data tls_test_data1;
+extern struct tls_record_test_data tls_test_data_aes_128_gcm_v1;
int test_tls_record_status_check(struct rte_crypto_op *op);
diff --git a/app/test/test_cryptodev_security_tls_record_test_vectors.h b/app/test/test_cryptodev_security_tls_record_test_vectors.h
index 5aa0d27fda..52e97e8557 100644
--- a/app/test/test_cryptodev_security_tls_record_test_vectors.h
+++ b/app/test/test_cryptodev_security_tls_record_test_vectors.h
@@ -11,6 +11,71 @@
#include "test_cryptodev.h"
#include "test_cryptodev_security_tls_record.h"
-struct tls_record_test_data tls_test_data1;
+/* TLS 1.2 AES-GCM 128 vector generated with kTLS. */
+struct tls_record_test_data tls_test_data_aes_128_gcm_v1 = {
+ .key = {
+ .data = {
+ 0x77, 0xc4, 0x9b, 0x0c, 0x2b, 0xe2, 0xd2, 0x4e,
+ 0xf5, 0x36, 0xb4, 0xea, 0x16, 0xb0, 0xed, 0x1f
+ },
+ },
+ .input_text = {
+ .data = {
+ 0x61, 0x62, 0x63, 0x64, 0x31, 0x32, 0x33, 0x34,
+ 0x61, 0x62, 0x63, 0x64, 0x31, 0x32, 0x33, 0x34,
+ 0xa
+ },
+ .len = 17,
+ },
+ .output_text = {
+ .data = {
+ 0x17, 0x03, 0x03, 0x00, 0x29,
+ 0x3a, 0xcd, 0x41, 0x5d, 0x42, 0xac, 0xce, 0x36,
+ 0xad, 0xd1, 0x83, 0xa0, 0x16, 0x84, 0xce, 0x84,
+ 0xfc, 0xc2, 0xa7, 0x6b, 0xa1, 0x89, 0x5d, 0xf2,
+ 0xeb,
+ 0x9b, 0x90, 0x01, 0x56, 0xf8, 0x9d, 0xac, 0x0c,
+ 0xa8, 0x95, 0xba, 0xcc, 0x1f, 0xf3, 0x36, 0x2b
+ },
+ .len = 46,
+ },
+ .imp_nonce = {
+ .data = {
+ 0xda, 0xf8, 0x8f, 0x12
+ },
+ .len = 4,
+ },
+
+ .iv = {
+ .data = {
+ 0x3a, 0xcd, 0x41, 0x5d, 0x42, 0xac, 0xce, 0x36
+ },
+ },
+
+ .xform = {
+ .aead = {
+ .next = NULL,
+ .type = RTE_CRYPTO_SYM_XFORM_AEAD,
+ .aead = {
+ .op = RTE_CRYPTO_AEAD_OP_ENCRYPT,
+ .algo = RTE_CRYPTO_AEAD_AES_GCM,
+ .key.length = 16,
+ .iv.length = 12,
+ .iv.offset = IV_OFFSET,
+ .digest_length = 16,
+ .aad_length = 13,
+ },
+ },
+ },
+
+ .tls_record_xform = {
+ .ver = RTE_SECURITY_VERSION_TLS_1_2,
+ .type = RTE_SECURITY_TLS_SESS_TYPE_WRITE,
+ .tls_1_2.seq_no = 0x1,
+ },
+
+ .aead = true,
+ .app_type = 0x17,
+};
#endif
--
2.25.1
next prev parent reply other threads:[~2023-12-07 13:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 13:02 [PATCH 00/14] Add TLS record test suite Anoob Joseph
2023-12-07 13:02 ` [PATCH 01/14] test/crypto: move security caps checks to separate file Anoob Joseph
2023-12-07 13:02 ` [PATCH 02/14] test/crypto: move algorithm list to common Anoob Joseph
2023-12-07 13:02 ` [PATCH 03/14] test/crypto: move algorithm display routines " Anoob Joseph
2023-12-07 13:02 ` [PATCH 04/14] test/security: add sha1-hmac to auth list Anoob Joseph
2023-12-07 13:02 ` [PATCH 05/14] test/crypto: move algorithm framework to common Anoob Joseph
2023-12-07 13:02 ` [PATCH 06/14] test/crypto: add TLS record tests Anoob Joseph
2023-12-07 13:02 ` Anoob Joseph [this message]
2023-12-07 13:02 ` [PATCH 08/14] test/crypto: add TLS1.2 vectors Anoob Joseph
2023-12-07 13:02 ` [PATCH 09/14] test/crypto: add TLS1.2/DTLS1.2 AES-128/256-GCM vectors Anoob Joseph
2023-12-07 13:02 ` [PATCH 10/14] test/crypto: add combined mode cases Anoob Joseph
2023-12-07 13:02 ` [PATCH 11/14] test/crypto: add verification of TLS headers Anoob Joseph
2023-12-07 13:02 ` [PATCH 12/14] test/security: add more algos to combined tests Anoob Joseph
2023-12-07 13:02 ` [PATCH 13/14] test/security: add TLS 1.2 and DTLS 1.2 vectors Anoob Joseph
2023-12-07 13:02 ` [PATCH 14/14] test/crypto: add multi segmented cases Anoob Joseph
2024-01-16 9:02 ` [PATCH 00/14] Add TLS record test suite Akhil Goyal
2024-01-19 8:55 ` 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=20231207130216.140-8-anoobj@marvell.com \
--to=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=harry.van.haaren@intel.com \
--cc=hemant.agrawal@nxp.com \
--cc=jerinj@marvell.com \
--cc=konstantin.v.ananyev@yandex.ru \
--cc=ktejasree@marvell.com \
--cc=vvelumuri@marvell.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).