From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 24990A0514; Wed, 15 Jan 2020 13:57:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 378A61C0D4; Wed, 15 Jan 2020 13:57:15 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id BBC311C0DB for ; Wed, 15 Jan 2020 13:57:13 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00FCtLfJ028608; Wed, 15 Jan 2020 04:57:13 -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=pfpt0818; bh=MJcD4wv9MI46QySdoCep3O+L7/XN2DCmnAA5t/MdK40=; b=smxJ3bQDoxuAu1btso3+I3mFPDAqudHZC0mTWQF+ix4FrIE9JABcsYIHxcEcpUCuFMrW X64Pc5t787q9M/enofzLjCIeGOh4JehxKH6/1g7cEaZ0h2Qj/ATtlejhLosSa2ZQNyvG 8uVrn51zGu47UWPf2gA0EwvzVV5tCZaopgiqXyFERLZW9dhFM3+0TBd4W5Vw8Pz5459Q KnwygDeXXSMaUlN150jimMnRUBxGq5ELpLptzEx1aFzh+B9/LZaW/YI7+36akdC/NGmS 2dO0YlEKDn+PWB99iH8HxzJonxfJznrFHo8zwWw6wdzH5qwxw3FhdJdO06224Z8A1nVm xQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2xhrhe26tq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 15 Jan 2020 04:57:13 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 15 Jan 2020 04:57:10 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 15 Jan 2020 04:57:10 -0800 Received: from ajoseph83.caveonetworks.com (unknown [10.29.45.60]) by maili.marvell.com (Postfix) with ESMTP id 26BF63F703F; Wed, 15 Jan 2020 04:57:06 -0800 (PST) From: Anoob Joseph To: Akhil Goyal , Declan Doherty , Pablo de Lara CC: Sunila Sahu , Fiona Trahe , "Arek Kusztal" , Jerin Jacob , Narayana Prasad , Shally Verma , Ankur Dwivedi , , Anoob Joseph , Balakrishna Bhamidipati Date: Wed, 15 Jan 2020 18:26:33 +0530 Message-ID: <1579092994-15978-4-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579092994-15978-1-git-send-email-anoobj@marvell.com> References: <1575560280-3261-1-git-send-email-anoobj@marvell.com> <1579092994-15978-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-15_02:2020-01-15, 2020-01-14 signatures=0 Subject: [dpdk-dev] [PATCH v2 3/4] crypto/octeontx2: add ECPM 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" From: Sunila Sahu Add support asymmetric operation EC Point MUltiplication, in crypto_octeontx2 PMD. Signed-off-by: Anoob Joseph Signed-off-by: Balakrishna Bhamidipati Signed-off-by: Sunila Sahu --- doc/guides/cryptodevs/features/octeontx2.ini | 1 + .../crypto/octeontx2/otx2_cryptodev_capabilities.c | 10 ++++++++++ drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/doc/guides/cryptodevs/features/octeontx2.ini b/doc/guides/cryptodevs/features/octeontx2.ini index dd6369b..4693458 100644 --- a/doc/guides/cryptodevs/features/octeontx2.ini +++ b/doc/guides/cryptodevs/features/octeontx2.ini @@ -73,3 +73,4 @@ Modular Exponentiation = Y Modular Inversion = Diffie-hellman = ECDSA = Y +ECPM = Y diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c index f2079e2..83f885c 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c @@ -639,6 +639,16 @@ rte_cryptodev_capabilities otx2_cpt_capabilities[] = { }, } }, + { /* ECPM */ + .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC, + {.asym = { + .xform_capa = { + .xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM, + .op_types = 0 + } + }, + } + }, /* End of asymmetric capabilities */ RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() }; diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c index 17c755d..ec0e58d 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c @@ -447,6 +447,12 @@ otx2_cpt_enqueue_asym(struct otx2_cpt_qp *qp, if (unlikely(ret)) goto req_fail; break; + case RTE_CRYPTO_ASYM_XFORM_ECPM: + ret = cpt_ecpm_prep(&asym_op->ecpm, ¶ms, + sess->ec_ctx.curveid); + if (unlikely(ret)) + goto req_fail; + break; default: op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS; ret = -EINVAL; @@ -665,6 +671,19 @@ otx2_cpt_asym_dequeue_ecdsa_op(struct rte_crypto_ecdsa_op_param *ecdsa, ecdsa->s.length = prime_len; } +static __rte_always_inline void +otx2_cpt_asym_dequeue_ecpm_op(struct rte_crypto_ecpm_op_param *ecpm, + struct cpt_request_info *req, + struct cpt_asym_ec_ctx *ec) +{ + int prime_len = ec_grp[ec->curveid].prime.length; + + memcpy(ecpm->r.x.data, req->rptr, prime_len); + memcpy(ecpm->r.y.data, req->rptr + ROUNDUP8(prime_len), prime_len); + ecpm->r.x.length = prime_len; + ecpm->r.y.length = prime_len; +} + static void otx2_cpt_asym_post_process(struct rte_crypto_op *cop, struct cpt_request_info *req) @@ -687,6 +706,9 @@ otx2_cpt_asym_post_process(struct rte_crypto_op *cop, case RTE_CRYPTO_ASYM_XFORM_ECDSA: otx2_cpt_asym_dequeue_ecdsa_op(&op->ecdsa, req, &sess->ec_ctx); break; + case RTE_CRYPTO_ASYM_XFORM_ECPM: + otx2_cpt_asym_dequeue_ecpm_op(&op->ecpm, req, &sess->ec_ctx); + break; default: CPT_LOG_DP_DEBUG("Invalid crypto xform type"); cop->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS; -- 2.7.4