From patchwork Thu Aug 18 07:41:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 115231 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0B469A034C; Thu, 18 Aug 2022 10:50:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4718441147; Thu, 18 Aug 2022 10:50:20 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 960A240E2D for ; Thu, 18 Aug 2022 10:50:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660812618; x=1692348618; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=NPNyvb/2ohcDOaS3fUoxe6Y53sBHK/J7DSNkOLBOjmM=; b=ddevQgFLTw1qv7omMqGh+k8L7nH8oOiVWLFanB6K5liPolgWFObMRj4x YMBN4eql2bOJXkC4x+iroWFVp3lZ2JEqBtW8h3G6p0qEKQGdnyq6knegG jLMg4fK7/SxUUUN0gwrDiD7UTxUlnFhs7HrogjQiflJ/HdSTFFh647fJx Dlf2AB+YFGBXPT4Uy8Eb3V8wbR+ibJH7o8X4z0XTyOBFT6H0tiKIQBQXJ 4mVh4AgMV1nsaN3+uU1Bn2mVUKcPFu5khA/GEvkIxiTNFgU4ly4xDPdnV WW1XrHzxM7ZPcEx6s2h+MIVIfNgftpmh2qj0bznaLwVeSFBDrHWSLPRXS Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10442"; a="378999129" X-IronPort-AV: E=Sophos;i="5.93,246,1654585200"; d="scan'208";a="378999129" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2022 01:50:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,246,1654585200"; d="scan'208";a="750029644" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by fmsmga001.fm.intel.com with ESMTP; 18 Aug 2022 01:50:17 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, Arek Kusztal Subject: [PATCH 1/2] cryptodev: add option to use ec base point in ecpm Date: Thu, 18 Aug 2022 08:41:29 +0100 Message-Id: <20220818074130.37894-2-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220818074130.37894-1-arkadiuszx.kusztal@intel.com> References: <20220818074130.37894-1-arkadiuszx.kusztal@intel.com> 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 Add option to use elliptic curve generator point instead of setting it manually. It corresponds to the public point generation in EC Diffie-Hellman key exchange. Signed-off-by: Arek Kusztal Acked-by: Kai Ji --- lib/cryptodev/rte_crypto_asym.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index 8ae43d5f3d..62987f860e 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -593,7 +593,11 @@ struct rte_crypto_ecdsa_op_param { */ struct rte_crypto_ecpm_op_param { struct rte_crypto_ec_point p; - /**< x and y coordinates of input point */ + /**< + * x and y coordinates of input point, + * in case both x.data and y.data are set to NULL + * selected ellitpic curve generator point is used + */ struct rte_crypto_ec_point r; /**< x and y coordinates of resultant point */ From patchwork Thu Aug 18 07:41:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 115232 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B1A8A034C; Thu, 18 Aug 2022 10:50:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22D7841611; Thu, 18 Aug 2022 10:50:22 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 35C0C41109 for ; Thu, 18 Aug 2022 10:50:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660812620; x=1692348620; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=9KFVCzLDeQUwvLaeM2jjLjOL8F3bzdizSVXjse0PwGY=; b=Nwub89y8prC9/cI8OHpjsB3/7oFgpQyYYVW9uJ8aPbzctC86LzhcWV4M hfF0ahRKEi8iq6qsnnI3KxHAhrQNvK6w9sZNpNEiGnYQ4CnE9bOKQGDNA Oh6BOmZybY1qrgCUeKWfjr6c17qaMG4unc0mfsbrxQUKGTMHK0iqsfCVR ER1ZBTZch03xA3kxe2j4Ex3Sz/libVOP+PSZ1tG7eGdJarihRzQd3o0+9 lLHVvnyLZPdgJhvc7czuGPVkOwz6wgqiSM2C7Yj6pd3iaK5akh0rRfVYN APjoMY6btciDY4H3RHsh2Nv15URdSTId4HrBySwyTmpe5uZ7fbvkYTtKL w==; X-IronPort-AV: E=McAfee;i="6500,9779,10442"; a="378999133" X-IronPort-AV: E=Sophos;i="5.93,246,1654585200"; d="scan'208";a="378999133" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2022 01:50:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,246,1654585200"; d="scan'208";a="750029648" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by fmsmga001.fm.intel.com with ESMTP; 18 Aug 2022 01:50:19 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, Arek Kusztal Subject: [PATCH 2/2] cryptodev: add ec point verification Date: Thu, 18 Aug 2022 08:41:30 +0100 Message-Id: <20220818074130.37894-3-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220818074130.37894-1-arkadiuszx.kusztal@intel.com> References: <20220818074130.37894-1-arkadiuszx.kusztal@intel.com> 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 This addition complements point verification in ECDH operation. This will allow to use point verification in other situations than pure ECDH. Signed-off-by: Arek Kusztal Acked-by: Kai Ji --- doc/guides/cryptodevs/features/default.ini | 1 + lib/cryptodev/rte_crypto_asym.h | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini index 7371ca6644..7922160532 100644 --- a/doc/guides/cryptodevs/features/default.ini +++ b/doc/guides/cryptodevs/features/default.ini @@ -119,6 +119,7 @@ Diffie-hellman = ECDSA = ECPM = ECDH = +EC Point Verify = ; ; Supported Operating systems of a default crypto driver. diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index 62987f860e..7d94ba705e 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -116,6 +116,8 @@ enum rte_crypto_asym_xform_type { /**< Elliptic Curve Diffie Hellman */ RTE_CRYPTO_ASYM_XFORM_ECPM, /**< Elliptic Curve Point Multiplication */ + RTE_CRYPTO_ASYM_XFORM_EC_POINT_VERIFY, + /**< Elliptic Curve Point Verification */ RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END /**< End of list */ }; @@ -607,6 +609,14 @@ struct rte_crypto_ecpm_op_param { }; /** + * Structure for EC point verification operation + */ +struct rte_crypto_ec_point_verify_op { + struct rte_crypto_ec_point p; + /**< x and y coordinates of point to be verified */ +}; + +/** * Asymmetric crypto transform data * * Structure describing asym xforms. @@ -666,6 +676,7 @@ struct rte_crypto_asym_op { struct rte_crypto_dsa_op_param dsa; struct rte_crypto_ecdsa_op_param ecdsa; struct rte_crypto_ecpm_op_param ecpm; + struct rte_crypto_ec_point_verify_op ecp_verify; }; uint16_t flags; /**<