DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ji, Kai" <kai.ji@intel.com>
To: "Kusztal, ArkadiuszX" <arkadiuszx.kusztal@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "gakhil@marvell.com" <gakhil@marvell.com>
Subject: RE: [PATCH v2 4/4] crypto/qat: add ecdh public key verification
Date: Mon, 24 Oct 2022 11:26:19 +0000	[thread overview]
Message-ID: <SN6PR11MB3408EFFA2B1AA641D892AFED812E9@SN6PR11MB3408.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20221020150940.62465-5-arkadiuszx.kusztal@intel.com>

Code may need rebase, otherwise 

Acked-by: Kai Ji <kai.ji@intel.com>

> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Thursday, October 20, 2022 4:10 PM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Ji, Kai <kai.ji@intel.com>; Kusztal, ArkadiuszX
> <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH v2 4/4] crypto/qat: add ecdh public key verification
> 
> This commit adds verification option for elliptic curve points when used along
> ECDH algorithm.
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
<snip>
> +
> +	cookie->alg_bytesize = curve[curve_id].bytesize;
> +	cookie->qat_func_alignsize = qat_func_alignsize;
> +	qat_req->pke_hdr.cd_pars.func_id = func_id;
> +	qat_req->input_param_count =
> +			5;
[KJ] do we need new line here ?
> +	qat_req->output_param_count =
> +			0;
> +
> +	HEXDUMP("x", cookie->input_array[0], qat_func_alignsize);
> +	HEXDUMP("y", cookie->input_array[1], qat_func_alignsize);
> +	HEXDUMP("p", cookie->input_array[2], qat_func_alignsize);
> +	HEXDUMP("a", cookie->input_array[3], qat_func_alignsize);
> +	HEXDUMP("b", cookie->input_array[4], qat_func_alignsize);
> +
> +	return 0;
> +}
> +
>  static uint8_t
>  ecdh_collect(struct rte_crypto_asym_op *asym_op,
>  		const struct qat_asym_op_cookie *cookie) @@ -830,6 +877,9
> @@ ecdh_collect(struct rte_crypto_asym_op *asym_op,
>  	uint32_t qat_func_alignsize = cookie->qat_func_alignsize;
>  	uint32_t ltrim = qat_func_alignsize - alg_bytesize;
> 
> +	if (asym_op->ecdh.ke_type ==
> RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY)
> +		return RTE_CRYPTO_OP_STATUS_SUCCESS;
> +
>  	if (asym_op->ecdh.ke_type ==
> RTE_CRYPTO_ASYM_KE_PUB_KEY_GENERATE) {
>  		asym_op->ecdh.pub_key.x.length = alg_bytesize;
>  		asym_op->ecdh.pub_key.y.length = alg_bytesize; @@ -870,8
> +920,14 @@ asym_set_input(struct icp_qat_fw_pke_request *qat_req,
>  	case RTE_CRYPTO_ASYM_XFORM_ECPM:
>  		return ecpm_set_input(qat_req, cookie, asym_op, xform);
>  	case RTE_CRYPTO_ASYM_XFORM_ECDH:
> -		return ecdh_set_input(qat_req, cookie,
> +		if (asym_op->ecdh.ke_type ==
> +			RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY) {
> +			return ecdh_verify_set_input(qat_req, cookie,
>  				asym_op, xform);
> +		} else {
> +			return ecdh_set_input(qat_req, cookie,
> +				asym_op, xform);
> +		}
>  	default:
>  		QAT_LOG(ERR, "Invalid/unsupported asymmetric crypto
> xform");
>  		return -EINVAL;
> --
> 2.13.6


  reply	other threads:[~2022-10-24 11:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 15:09 [PATCH v2 0/4] crypto/qat: extend asymmetric crypto pmd Arek Kusztal
2022-10-20 15:09 ` [PATCH v2 1/4] crypto/qat: make immutable parameters constant Arek Kusztal
2022-10-20 21:55   ` Ji, Kai
2022-10-20 15:09 ` [PATCH v2 2/4] crypto/qat: improve freeing of asym cookies Arek Kusztal
2022-10-20 21:57   ` Ji, Kai
2022-10-20 15:09 ` [PATCH v2 3/4] crypto/qat: add ecdh key exchange algorithm Arek Kusztal
2022-10-24 11:11   ` Ji, Kai
2022-10-20 15:09 ` [PATCH v2 4/4] crypto/qat: add ecdh public key verification Arek Kusztal
2022-10-24 11:26   ` Ji, Kai [this message]
2022-10-27  9:48 ` [EXT] [PATCH v2 0/4] crypto/qat: extend asymmetric crypto pmd Akhil Goyal

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=SN6PR11MB3408EFFA2B1AA641D892AFED812E9@SN6PR11MB3408.namprd11.prod.outlook.com \
    --to=kai.ji@intel.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.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).