From patchwork Fri Mar 13 11:43:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nagadheeraj Rottela X-Patchwork-Id: 66650 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A74E0A0567; Fri, 13 Mar 2020 12:43:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 422052BE3; Fri, 13 Mar 2020 12:43:49 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 2A1723B5 for ; Fri, 13 Mar 2020 12:43:46 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02DBYrPY006576; Fri, 13 Mar 2020 04:43:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=8nHlKCTBFSREdbKgEO0Bi9mpWYimuZ2Nr5NKtZSqE48=; b=KeOTHKipop53iL7c/j0s7F1IxkJiUY38o7nO9GhPLBILv5nYBek03fvxhz1PEC7aE4j5 ZFnZIorn1fQUoSCsV1Nt++WOGDiDg7MDbxM+BU/bdxN4B8BR+A/KF14JyTpf5BGJ36vu 61tOoXFJr5awRkor55sgfTyMkdB3kD1/SM32XwRjiaPoVsz6pR7ainZxtbai8vXnfyaM ib9Z8R31CTII+SBKyK99nIyqfgstcJAL5zeSmGQWZNkWPS7VhUYGQnCV5haJRtaOeG5O kwqu0P4K071RPIyP+KOlh0AxXv/81dxJAv28WCxO/l45lcoMwRWN25F5hn+77Huac3hz 7w== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2yqt7t3mhk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 13 Mar 2020 04:43:46 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 13 Mar 2020 04:43:44 -0700 Received: from hyd1399.marvell.com (10.93.176.43) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 13 Mar 2020 04:43:42 -0700 From: Nagadheeraj Rottela To: CC: , , Nagadheeraj Rottela Date: Fri, 13 Mar 2020 17:13:37 +0530 Message-ID: <20200313114337.28811-1-rnagadheeraj@marvell.com> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-03-13_04:2020-03-12, 2020-03-13 signatures=0 Subject: [dpdk-dev] [PATCH] crypto/nitrox: add 3DES-CBC support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds 3DES CBC mode cipher algorithm. Signed-off-by: Nagadheeraj Rottela --- app/test/test_cryptodev.c | 1 + app/test/test_cryptodev_des_test_vectors.h | 6 ++++-- doc/guides/cryptodevs/features/nitrox.ini | 1 + doc/guides/cryptodevs/nitrox.rst | 2 ++ drivers/crypto/nitrox/nitrox_sym.c | 4 ++++ drivers/crypto/nitrox/nitrox_sym_capabilities.c | 21 ++++++++++++++++++++- 6 files changed, 32 insertions(+), 3 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 7b1ef5c86..e8dd8f754 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -13117,6 +13117,7 @@ static struct unit_test_suite cryptodev_nitrox_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_device_configure_invalid_queue_pair_ids), TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all), + TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all), TEST_CASES_END() /**< NULL terminate unit test array */ } diff --git a/app/test/test_cryptodev_des_test_vectors.h b/app/test/test_cryptodev_des_test_vectors.h index 0a362d980..d8a62d2b5 100644 --- a/app/test/test_cryptodev_des_test_vectors.h +++ b/app/test/test_cryptodev_des_test_vectors.h @@ -1115,7 +1115,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX | - BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2 + BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2 | + BLOCKCIPHER_TEST_TARGET_PMD_NITROX }, { .test_descr = "3DES-192-CBC HMAC-SHA1 Decryption Digest Verify", @@ -1129,7 +1130,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX | - BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2 + BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2 | + BLOCKCIPHER_TEST_TARGET_PMD_NITROX }, { .test_descr = "3DES-192-CBC SHA1 Encryption Digest", diff --git a/doc/guides/cryptodevs/features/nitrox.ini b/doc/guides/cryptodevs/features/nitrox.ini index ddc3c05f4..183494731 100644 --- a/doc/guides/cryptodevs/features/nitrox.ini +++ b/doc/guides/cryptodevs/features/nitrox.ini @@ -20,6 +20,7 @@ OOP LB In LB Out = Y AES CBC (128) = Y AES CBC (192) = Y AES CBC (256) = Y +3DES CBC = Y ; ; Supported authentication algorithms of the 'nitrox' crypto driver. diff --git a/doc/guides/cryptodevs/nitrox.rst b/doc/guides/cryptodevs/nitrox.rst index f8a527c05..85f5212b6 100644 --- a/doc/guides/cryptodevs/nitrox.rst +++ b/doc/guides/cryptodevs/nitrox.rst @@ -18,6 +18,7 @@ Nitrox crypto PMD has support for: Cipher algorithms: * ``RTE_CRYPTO_CIPHER_AES_CBC`` +* ``RTE_CRYPTO_CIPHER_3DES_CBC`` Hash algorithms: @@ -29,6 +30,7 @@ Limitations ----------- * AES_CBC Cipher Only combination is not supported. +* 3DES Cipher Only combination is not supported. * Session-less APIs are not supported. Installation diff --git a/drivers/crypto/nitrox/nitrox_sym.c b/drivers/crypto/nitrox/nitrox_sym.c index 56410c44d..c7aa3fd1b 100644 --- a/drivers/crypto/nitrox/nitrox_sym.c +++ b/drivers/crypto/nitrox/nitrox_sym.c @@ -314,6 +314,10 @@ get_flexi_cipher_type(enum rte_crypto_cipher_algorithm algo, bool *is_aes) type = CIPHER_AES_CBC; *is_aes = true; break; + case RTE_CRYPTO_CIPHER_3DES_CBC: + type = CIPHER_3DES_CBC; + *is_aes = false; + break; default: type = CIPHER_INVALID; NITROX_LOG(ERR, "Algorithm not supported %d\n", algo); diff --git a/drivers/crypto/nitrox/nitrox_sym_capabilities.c b/drivers/crypto/nitrox/nitrox_sym_capabilities.c index 47ceead73..dc4df9185 100644 --- a/drivers/crypto/nitrox/nitrox_sym_capabilities.c +++ b/drivers/crypto/nitrox/nitrox_sym_capabilities.c @@ -88,7 +88,26 @@ static const struct rte_cryptodev_capabilities nitrox_capabilities[] = { }, } }, } }, - + { /* 3DES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_3DES_CBC, + .block_size = 8, + .key_size = { + .min = 24, + .max = 24, + .increment = 0 + }, + .iv_size = { + .min = 8, + .max = 8, + .increment = 0 + } + }, } + }, } + }, RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() };