From patchwork Thu Dec 7 13:02:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 134919 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 AF73C43699; Thu, 7 Dec 2023 14:03:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16ACD42F1B; Thu, 7 Dec 2023 14:02:46 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 27E5A42F1B for ; Thu, 7 Dec 2023 14:02:44 +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 3B79PGlc032068; Thu, 7 Dec 2023 05:02:43 -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=MuoFfaWUzEPf0c0RRBjgXbivR8JffuTQaWxE+kkLyFM=; b=hjWFK6Jq26s8VKK0+KlV7Qi1AEq0wgqPkHTMC03vQSqFOPyS8pmsuMsxDrfqCTDcVnoe afV8vsJCYQYpO7k5coaRWonqDl4jFdfkSVL1SKHZtYM45K8wVH9j0e7ULsk4BV5MA+zo gUj3z2yMJMAEO7R5KKc8uSVcNOkhZSdx5hVL0j3R6T9JReec3HK6d750Brv9RiUUI7BL jEB9mUCGhIkqYQc+ZsLu/Jcsn5Oawxbx85+HXVUfAI9pGNBu5DnpudHQ8NUxh895NjOI E3Epe7Sr1ohoUsXocBhcZ8x50V3JrHhScUxTZryBtBwSZA9RZrspjooNA18fsZNyZBOC 2A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uubdd8n5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Dec 2023 05:02:43 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 7 Dec 2023 05:02:41 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 7 Dec 2023 05:02:41 -0800 Received: from BG-LT92004.corp.innovium.com (unknown [10.28.163.189]) by maili.marvell.com (Postfix) with ESMTP id AF9F83F70AD; Thu, 7 Dec 2023 05:02:38 -0800 (PST) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Tejasree Kondoj , Harry van Haaren , Hemant Agrawal , Konstantin Ananyev , , "Vidya Sagar Velumuri" Subject: [PATCH 07/14] test/crypto: add AES-GCM 128 TLS 1.2 vector Date: Thu, 7 Dec 2023 18:32:09 +0530 Message-ID: <20231207130216.140-8-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231207130216.140-1-anoobj@marvell.com> References: <20231207130216.140-1-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: XkRlQ8p98ZdA4BHdlNN_nbTyKm8eHo-c X-Proofpoint-GUID: XkRlQ8p98ZdA4BHdlNN_nbTyKm8eHo-c X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-07_10,2023-12-07_01,2023-05-22_02 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 From: Tejasree Kondoj Add AES-GCM-128 test vector generated with kTLS. Signed-off-by: Tejasree Kondoj Signed-off-by: Vidya Sagar Velumuri --- 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