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 EDED442859; Tue, 28 Mar 2023 12:21:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C1DB40EDF; Tue, 28 Mar 2023 12:21:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 132C440156 for ; Tue, 28 Mar 2023 12:21:24 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32SA4t2s008648 for ; Tue, 28 Mar 2023 03:21:24 -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-transfer-encoding : content-type; s=pfpt0220; bh=KnnnBVEkWoJtddvLIQ+2SzzR9BQACHnLgKpKrzw8WG8=; b=RvB9aWEvL5beIkYDxFvJkc2qAqpDGMLt3osbMFm3xuvpSNLQHMbiAYeY6eEx3P13xmr0 Vr2SSNtPCKanGUU7z1xhhqyBWZdqXhMJYmFuZEi1QlM9y3alWnENNkcdB8es8zeyy44Y dbGLZ6iFixnrtlbQB2Vh1hPHwOCM1wvTOpZKfGr+GbZr6zTOARl+NQwT09T5ksUX1t6U R+qaB8ztj6PkNq4W+Pl3Ua+pskvm0zHvVCuARBU8Nh3RcTjW2L/fMzPNF0JMVyRK6qFE 5wLhODhiNOZfXv5IryA6aGveSPRpIDR+ubHcfCHzCiQKRSRfIs8cdE/cVyZLLMQXIXh6 YA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3pkjcqjjm4-11 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 28 Mar 2023 03:21:24 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 28 Mar 2023 03:20:57 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 28 Mar 2023 03:20:57 -0700 Received: from syaligar_asim.marvell.com (unknown [10.29.45.70]) by maili.marvell.com (Postfix) with ESMTP id 879943F70A4; Tue, 28 Mar 2023 03:20:55 -0700 (PDT) From: Sachin Yaligar To: CC: , , , , , Sachin Yaligar Subject: [PATCH v1 1/1] cryptodev: support EDDSA Date: Tue, 28 Mar 2023 10:20:52 +0000 Message-ID: <20230328102052.30465-1-syaligar@marvell.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: OnzsXaZ8-wkq7BHVXjlUL8jlhjgV9JyG X-Proofpoint-ORIG-GUID: OnzsXaZ8-wkq7BHVXjlUL8jlhjgV9JyG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-28_01,2023-02-09_01 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 Asymmetric crypto library is extended to add EDDSA. Edwards curve operation params are introduced. Signed-off-by: Sachin Yaligar Change-Id: I939d7646f95723113fa9f3bdbc01c0aeb4620e74 --- .mailmap | 1 + doc/guides/cryptodevs/features/default.ini | 1 + doc/guides/prog_guide/cryptodev_lib.rst | 2 +- lib/cryptodev/rte_crypto_asym.h | 39 +++++++++++++++++++++- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index cac02a6f48..6d92b56560 100644 --- a/.mailmap +++ b/.mailmap @@ -1169,6 +1169,7 @@ Rushil Gupta Ryan E Hall Sabyasachi Sengupta Sachin Saxena +Sachin Yaligar Sagar Abhang Sagi Grimberg Saikrishna Edupuganti diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini index 523da0cfa8..247a56be6e 100644 --- a/doc/guides/cryptodevs/features/default.ini +++ b/doc/guides/cryptodevs/features/default.ini @@ -125,6 +125,7 @@ Diffie-hellman = ECDSA = ECPM = ECDH = +EDDSA = ; ; Supported Operating systems of a default crypto driver. diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst index 2b513bbf82..358dbbc768 100644 --- a/doc/guides/prog_guide/cryptodev_lib.rst +++ b/doc/guides/prog_guide/cryptodev_lib.rst @@ -927,7 +927,7 @@ Asymmetric Cryptography The cryptodev library currently provides support for the following asymmetric Crypto operations; RSA, Modular exponentiation and inversion, Diffie-Hellman and Elliptic Curve Diffie-Hellman public and/or private key generation and shared -secret compute, DSA Signature generation and verification. +secret compute, DSA and Edward's curve DSA Signature generation and verification. Session and Session Management ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index 989f38323f..fc7172b070 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -69,7 +69,9 @@ enum rte_crypto_curve_id { RTE_CRYPTO_EC_GROUP_SECP224R1 = 21, RTE_CRYPTO_EC_GROUP_SECP256R1 = 23, RTE_CRYPTO_EC_GROUP_SECP384R1 = 24, - RTE_CRYPTO_EC_GROUP_SECP521R1 = 25 + RTE_CRYPTO_EC_GROUP_SECP521R1 = 25, + RTE_CRYPTO_EC_GROUP_ED25519 = 29, + RTE_CRYPTO_EC_GROUP_ED448 = 30 }; /** @@ -113,6 +115,10 @@ enum rte_crypto_asym_xform_type { /**< Elliptic Curve Digital Signature Algorithm * Perform Signature Generation and Verification. */ + RTE_CRYPTO_ASYM_XFORM_EDDSA, + /**< Edwards Curve Digital Signature Algorithm + * Perform Signature Generation and Verification. + */ RTE_CRYPTO_ASYM_XFORM_ECDH, /**< Elliptic Curve Diffie Hellman */ RTE_CRYPTO_ASYM_XFORM_ECPM, @@ -591,6 +597,36 @@ struct rte_crypto_ecdsa_op_param { */ }; +/** + * EDDSA operation params + */ +struct rte_crypto_eddsa_op_param { + enum rte_crypto_asym_op_type op_type; + /**< Signature generation or verification */ + + rte_crypto_uint pkey; + /**< Private key of the signer for signature generation */ + + struct rte_crypto_ec_point q; + /**< Public key of the signer derived from private key + * h = hash(pkey), q = (h[0-31] * B) + */ + + rte_crypto_param message; + /**< Input message digest to be signed or verified */ + + rte_crypto_uint r; + /**< r component of edward curve signature + * output : for signature generation + * input : for signature verification + */ + rte_crypto_uint s; + /**< s component of edward curve signature + * output : for signature generation + * input : for signature verification + */ +}; + /** * Structure for EC point multiplication operation param */ @@ -664,6 +700,7 @@ struct rte_crypto_asym_op { struct rte_crypto_ecdh_op_param ecdh; struct rte_crypto_dsa_op_param dsa; struct rte_crypto_ecdsa_op_param ecdsa; + struct rte_crypto_eddsa_op_param eddsa; struct rte_crypto_ecpm_op_param ecpm; }; uint16_t flags; -- 2.40.0