From patchwork Thu Dec 7 13:02:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 134914 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 5F09843699; Thu, 7 Dec 2023 14:02:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BFBE42EFE; Thu, 7 Dec 2023 14:02:31 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 259634025C for ; Thu, 7 Dec 2023 14:02:29 +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 3B79PGbG032087; Thu, 7 Dec 2023 05:02:28 -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=w/NDtx3MDufcIisaLMsx2CzuEC5Wnj/Dsg/Ac9xcZmo=; b=NaVk05rJTQDBitsYdMsfDZY7AC0uPcxh5fmKxj/nDpxLbkZciSet37KbkefB+8Dlb6S4 F5CoGaJm5mCJWZJJd43bjr6eTV/l6PRTmQpb3ZOmDxSS3ayC+arc8Ki7CjxX5GcjalnJ /JQRtycdrvFFPCn6tgkJe9P1RmtUeJAWEcI+5Kn2m9Bx/xJBcKtrW0u86XHL7JgUGQoK Fmeu/p5WPyL8mAcfGLrqI1IoxKrcpqgj+aKdSdfTdsjE+nz1k2KhXbDgtt9EPK582jMq Eo+tpZ/NFWF26yUI1p/cv1Kok6IoeJGcq+WRVSjoqrmi3A9c9L8b2qbfrSF7EGtpE42V VQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uubdd8n4f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Dec 2023 05:02:28 -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:26 -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:26 -0800 Received: from BG-LT92004.corp.innovium.com (unknown [10.28.163.189]) by maili.marvell.com (Postfix) with ESMTP id BBB5A3F7093; Thu, 7 Dec 2023 05:02:23 -0800 (PST) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Vidya Sagar Velumuri , Harry van Haaren , Hemant Agrawal , Konstantin Ananyev , Subject: [PATCH 02/14] test/crypto: move algorithm list to common Date: Thu, 7 Dec 2023 18:32:04 +0530 Message-ID: <20231207130216.140-3-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: 1zNRd5zLbEkzFKlEzKRvbhOaK4XyFUcE X-Proofpoint-GUID: 1zNRd5zLbEkzFKlEzKRvbhOaK4XyFUcE 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: Vidya Sagar Velumuri The algorithm list and associated structs are used for IPsec combined mode tests. The same list can be employed for other security protocol testing as well. Move the same to test_security_proto.h for the same. Signed-off-by: Anoob Joseph Signed-off-by: Vidya Sagar Velumuri --- app/test/test_cryptodev_security_ipsec.h | 126 +---------------------- app/test/test_security_proto.h | 124 ++++++++++++++++++++++ 2 files changed, 126 insertions(+), 124 deletions(-) diff --git a/app/test/test_cryptodev_security_ipsec.h b/app/test/test_cryptodev_security_ipsec.h index dc1b4c4a80..77cb5fa7f9 100644 --- a/app/test/test_cryptodev_security_ipsec.h +++ b/app/test/test_cryptodev_security_ipsec.h @@ -8,6 +8,8 @@ #include #include +#include "test_security_proto.h" + #define IPSEC_TEST_PACKETS_MAX 32 #define IPSEC_TEXT_MAX_LEN 16384u @@ -115,130 +117,6 @@ struct ipsec_test_flags { bool rx_inject; }; -struct crypto_param { - enum rte_crypto_sym_xform_type type; - union { - enum rte_crypto_cipher_algorithm cipher; - enum rte_crypto_auth_algorithm auth; - enum rte_crypto_aead_algorithm aead; - } alg; - uint16_t key_length; - uint16_t iv_length; - uint16_t digest_length; -}; - -static const struct crypto_param aead_list[] = { - { - .type = RTE_CRYPTO_SYM_XFORM_AEAD, - .alg.aead = RTE_CRYPTO_AEAD_AES_GCM, - .key_length = 16, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_AEAD, - .alg.aead = RTE_CRYPTO_AEAD_AES_GCM, - .key_length = 24, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_AEAD, - .alg.aead = RTE_CRYPTO_AEAD_AES_GCM, - .key_length = 32, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_AEAD, - .alg.aead = RTE_CRYPTO_AEAD_AES_CCM, - .key_length = 32 - }, -}; - -static const struct crypto_param cipher_list[] = { - { - .type = RTE_CRYPTO_SYM_XFORM_CIPHER, - .alg.cipher = RTE_CRYPTO_CIPHER_NULL, - .key_length = 0, - .iv_length = 0, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_CIPHER, - .alg.cipher = RTE_CRYPTO_CIPHER_DES_CBC, - .key_length = 8, - .iv_length = 8, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_CIPHER, - .alg.cipher = RTE_CRYPTO_CIPHER_3DES_CBC, - .key_length = 24, - .iv_length = 8, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_CIPHER, - .alg.cipher = RTE_CRYPTO_CIPHER_AES_CBC, - .key_length = 16, - .iv_length = 16, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_CIPHER, - .alg.cipher = RTE_CRYPTO_CIPHER_AES_CTR, - .key_length = 16, - .iv_length = 16, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_CIPHER, - .alg.cipher = RTE_CRYPTO_CIPHER_AES_CTR, - .key_length = 24, - .iv_length = 16, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_CIPHER, - .alg.cipher = RTE_CRYPTO_CIPHER_AES_CTR, - .key_length = 32, - .iv_length = 16, - }, -}; - -static const struct crypto_param auth_list[] = { - { - .type = RTE_CRYPTO_SYM_XFORM_AUTH, - .alg.auth = RTE_CRYPTO_AUTH_NULL, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_AUTH, - .alg.auth = RTE_CRYPTO_AUTH_MD5_HMAC, - .key_length = 16, - .digest_length = 12, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_AUTH, - .alg.auth = RTE_CRYPTO_AUTH_SHA256_HMAC, - .key_length = 32, - .digest_length = 16, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_AUTH, - .alg.auth = RTE_CRYPTO_AUTH_SHA384_HMAC, - .key_length = 48, - .digest_length = 24, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_AUTH, - .alg.auth = RTE_CRYPTO_AUTH_SHA512_HMAC, - .key_length = 64, - .digest_length = 32, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_AUTH, - .alg.auth = RTE_CRYPTO_AUTH_AES_XCBC_MAC, - .key_length = 16, - .digest_length = 12, - }, - { - .type = RTE_CRYPTO_SYM_XFORM_AUTH, - .alg.auth = RTE_CRYPTO_AUTH_AES_GMAC, - .key_length = 16, - .digest_length = 16, - .iv_length = 12, - }, -}; - struct crypto_param_comb { const struct crypto_param *param1; const struct crypto_param *param2; diff --git a/app/test/test_security_proto.h b/app/test/test_security_proto.h index b91181384b..e8d6193530 100644 --- a/app/test/test_security_proto.h +++ b/app/test/test_security_proto.h @@ -8,6 +8,130 @@ #include #include +struct crypto_param { + enum rte_crypto_sym_xform_type type; + union { + enum rte_crypto_cipher_algorithm cipher; + enum rte_crypto_auth_algorithm auth; + enum rte_crypto_aead_algorithm aead; + } alg; + uint16_t key_length; + uint16_t iv_length; + uint16_t digest_length; +}; + +static const struct crypto_param aead_list[] = { + { + .type = RTE_CRYPTO_SYM_XFORM_AEAD, + .alg.aead = RTE_CRYPTO_AEAD_AES_GCM, + .key_length = 16, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_AEAD, + .alg.aead = RTE_CRYPTO_AEAD_AES_GCM, + .key_length = 24, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_AEAD, + .alg.aead = RTE_CRYPTO_AEAD_AES_GCM, + .key_length = 32, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_AEAD, + .alg.aead = RTE_CRYPTO_AEAD_AES_CCM, + .key_length = 32 + }, +}; + +static const struct crypto_param cipher_list[] = { + { + .type = RTE_CRYPTO_SYM_XFORM_CIPHER, + .alg.cipher = RTE_CRYPTO_CIPHER_NULL, + .key_length = 0, + .iv_length = 0, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_CIPHER, + .alg.cipher = RTE_CRYPTO_CIPHER_DES_CBC, + .key_length = 8, + .iv_length = 8, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_CIPHER, + .alg.cipher = RTE_CRYPTO_CIPHER_3DES_CBC, + .key_length = 24, + .iv_length = 8, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_CIPHER, + .alg.cipher = RTE_CRYPTO_CIPHER_AES_CBC, + .key_length = 16, + .iv_length = 16, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_CIPHER, + .alg.cipher = RTE_CRYPTO_CIPHER_AES_CTR, + .key_length = 16, + .iv_length = 16, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_CIPHER, + .alg.cipher = RTE_CRYPTO_CIPHER_AES_CTR, + .key_length = 24, + .iv_length = 16, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_CIPHER, + .alg.cipher = RTE_CRYPTO_CIPHER_AES_CTR, + .key_length = 32, + .iv_length = 16, + }, +}; + +static const struct crypto_param auth_list[] = { + { + .type = RTE_CRYPTO_SYM_XFORM_AUTH, + .alg.auth = RTE_CRYPTO_AUTH_NULL, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_AUTH, + .alg.auth = RTE_CRYPTO_AUTH_MD5_HMAC, + .key_length = 16, + .digest_length = 12, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_AUTH, + .alg.auth = RTE_CRYPTO_AUTH_SHA256_HMAC, + .key_length = 32, + .digest_length = 16, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_AUTH, + .alg.auth = RTE_CRYPTO_AUTH_SHA384_HMAC, + .key_length = 48, + .digest_length = 24, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_AUTH, + .alg.auth = RTE_CRYPTO_AUTH_SHA512_HMAC, + .key_length = 64, + .digest_length = 32, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_AUTH, + .alg.auth = RTE_CRYPTO_AUTH_AES_XCBC_MAC, + .key_length = 16, + .digest_length = 12, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_AUTH, + .alg.auth = RTE_CRYPTO_AUTH_AES_GMAC, + .key_length = 16, + .digest_length = 16, + .iv_length = 12, + }, +}; + int test_sec_crypto_caps_aead_verify(const struct rte_security_capability *sec_cap, struct rte_crypto_sym_xform *aead);