From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9850D45948; Mon, 9 Sep 2024 11:56:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2851E402BB; Mon, 9 Sep 2024 11:56:32 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 5168740299 for ; Mon, 9 Sep 2024 11:56:30 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 47D48FEC; Mon, 9 Sep 2024 02:56:58 -0700 (PDT) Received: from [192.168.1.69] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A87533F66E; Mon, 9 Sep 2024 02:56:27 -0700 (PDT) Message-ID: <4d143aab-c511-4abb-be3d-534ad0c957f3@foss.arm.com> Date: Mon, 9 Sep 2024 10:56:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/6] crypto/openssl: support EDDSA To: Gowrishankar Muthukrishnan , dev@dpdk.org, Kai Ji Cc: Anoob Joseph , bruce.richardson@intel.com, ciara.power@intel.com, jerinj@marvell.com, fanzhang.oss@gmail.com, arkadiuszx.kusztal@intel.com, david.marchand@redhat.com, hemant.agrawal@nxp.com, pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com, declan.doherty@intel.com, matan@nvidia.com, ruifeng.wang@arm.com, Akhil Goyal References: <0ae6a1afadac64050d80b0fd7712c4a6a8599e2c.1701273963.git.gmuthukrishn@marvell.com> <20240905133933.741-1-gmuthukrishn@marvell.com> <20240905133933.741-2-gmuthukrishn@marvell.com> Content-Language: en-GB From: Jack Bond-Preston In-Reply-To: <20240905133933.741-2-gmuthukrishn@marvell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Hi, On 05/09/2024 14:39, Gowrishankar Muthukrishnan wrote: > Support EDDSA crypto algorithm in OpenSSL PMD. > > Signed-off-by: Gowrishankar Muthukrishnan > --- > drivers/crypto/openssl/openssl_pmd_private.h | 13 ++ > drivers/crypto/openssl/rte_openssl_pmd.c | 223 +++++++++++++++++++ > drivers/crypto/openssl/rte_openssl_pmd_ops.c | 131 +++++++++++ > 3 files changed, 367 insertions(+) > + ctx = BN_CTX_new(); > + if (!ctx) > + goto err_ecfpm; > + > + > +err_ecfpm: > + BN_CTX_free(ctx); > + BN_free(n); > + return ret; > +} > + > + md_ctx = EVP_MD_CTX_new(); > + if (!md_ctx) > + goto err_eddsa; > + > + cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS; > +err_eddsa: > + OSSL_PARAM_BLD_free(iparam_bld); > + > + if (sctx) > + EVP_PKEY_CTX_free(sctx); > + > + if (cctx) > + EVP_PKEY_CTX_free(cctx); > + > + if (pkey) > + EVP_PKEY_free(pkey); > + > + return ret; This (allocating and freeing ctxs for every operation) has pretty bad performance, refer to https://patches.dpdk.org/project/dpdk/cover/20240703134552.1439633-1-jack.bond-preston@foss.arm.com/ for more information. I suppose for an initial implementation this could be ok - it's correct, just slow. Cheers, Jack