[PATCH v2 2/6] crypto/openssl: support EDDSA

Jack Bond-Preston jack.bond-preston at foss.arm.com
Mon Sep 9 11:56:26 CEST 2024


Hi,

On 05/09/2024 14:39, Gowrishankar Muthukrishnan wrote:
> Support EDDSA crypto algorithm in OpenSSL PMD.
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
> ---
>   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(+)
<snip>
> +	ctx = BN_CTX_new();
> +	if (!ctx)
> +		goto err_ecfpm;
> +
<snip>
> +
> +err_ecfpm:
> +	BN_CTX_free(ctx);
> +	BN_free(n);
> +	return ret;
> +}
<snip>
> +
> +			md_ctx = EVP_MD_CTX_new();
> +			if (!md_ctx)
> +				goto err_eddsa;
> +
<snip>
> +	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;
<etc..>

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



More information about the dev mailing list