DPDK patches and discussions
 help / color / mirror / Atom feed
From: Arek Kusztal <arkadiuszx.kusztal@intel.com>
To: dev@dpdk.org
Cc: gakhil@marvell.com, roy.fan.zhang@intel.com,
	Arek Kusztal <arkadiuszx.kusztal@intel.com>
Subject: [PATCH v4 1/3] cryptodev: move dh type from xform to dh op
Date: Wed, 27 Apr 2022 08:43:58 +0100	[thread overview]
Message-ID: <20220427074400.2091-2-arkadiuszx.kusztal@intel.com> (raw)
In-Reply-To: <20220427074400.2091-1-arkadiuszx.kusztal@intel.com>

Operation type (PUBLIC_KEY_GENERATION, SHARED_SECRET) should
be free to choose for any operation. One xform/session should
be enough to perform both DH operations, if op_type would be xform
member, session would have to be to be created twice for the same
group. Similar problem would be observed in sessionless case.
Additionally, it will help extend DH to support Elliptic Curves.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 lib/cryptodev/rte_crypto_asym.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
index cd24d4b07b..4697a7bc59 100644
--- a/lib/cryptodev/rte_crypto_asym.h
+++ b/lib/cryptodev/rte_crypto_asym.h
@@ -256,8 +256,6 @@ struct rte_crypto_modinv_xform {
  *
  */
 struct rte_crypto_dh_xform {
-	enum rte_crypto_asym_op_type type;
-	/**< Setup xform for key generate or shared secret compute */
 	rte_crypto_uint p;
 	/**< Prime modulus data */
 	rte_crypto_uint g;
@@ -391,27 +389,29 @@ struct rte_crypto_rsa_op_param {
  * @note:
  */
 struct rte_crypto_dh_op_param {
+	enum rte_crypto_asym_op_type op_type;
+	/**< Diffie-Hellman operation type */
 	rte_crypto_uint pub_key;
 	/**<
-	 * Output generated public key when xform type is
+	 * Output generated public key when op_type is
 	 * DH PUB_KEY_GENERATION.
-	 * Input peer public key when xform type is DH
+	 * Input peer public key when op_type is DH
 	 * SHARED_SECRET_COMPUTATION
 	 *
 	 */
 
 	rte_crypto_uint priv_key;
 	/**<
-	 * Output generated private key if xform type is
+	 * Output generated private key if op_type is
 	 * DH PRIVATE_KEY_GENERATION
-	 * Input when xform type is DH SHARED_SECRET_COMPUTATION.
+	 * Input when op_type is DH SHARED_SECRET_COMPUTATION.
 	 *
 	 */
 
 	rte_crypto_uint shared_secret;
 	/**<
 	 * Output with calculated shared secret
-	 * when dh xform set up with op type = SHARED_SECRET_COMPUTATION.
+	 * when dh op_type = SHARED_SECRET_COMPUTATION.
 	 *
 	 */
 };
-- 
2.13.6


  reply	other threads:[~2022-04-27  7:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  7:43 [PATCH v4 0/3] " Arek Kusztal
2022-04-27  7:43 ` Arek Kusztal [this message]
2022-04-27  8:11   ` [PATCH v4 1/3] " Zhang, Roy Fan
2022-05-10  9:26   ` Ji, Kai
2022-04-27  7:43 ` [PATCH v4 2/3] crypto/openssl: " Arek Kusztal
2022-04-27  8:11   ` Zhang, Roy Fan
2022-04-27  7:44 ` [PATCH v4 3/3] test/crypto: " Arek Kusztal
2022-04-27  8:12   ` Zhang, Roy Fan
2022-04-27  8:12 ` [PATCH v4 0/3] cryptodev: " Zhang, Roy Fan
2022-04-27 15:57 ` [EXT] " Akhil Goyal
2022-04-29  6:25   ` Kusztal, ArkadiuszX
2022-05-06 12:05     ` Kusztal, ArkadiuszX
2022-05-10  9:43 ` Ji, Kai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220427074400.2091-2-arkadiuszx.kusztal@intel.com \
    --to=arkadiuszx.kusztal@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).