From: Radu Nicolau <radu.nicolau@intel.com>
To: dev@dpdk.org
Cc: Radu Nicolau <radu.nicolau@intel.com>,
stable@dpdk.org, Kai Ji <kai.ji@intel.com>,
Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Subject: [PATCH 3/3] crypto/qat: fix ECDH implementation
Date: Wed, 27 Aug 2025 09:23:58 +0000 [thread overview]
Message-ID: <20250827092358.765222-3-radu.nicolau@intel.com> (raw)
In-Reply-To: <20250827092358.765222-1-radu.nicolau@intel.com>
Read EC parameters from the xform, not from the asym_op,
where they may not be set.
Fixes: 305e1f856f0c ("crypto/qat: add ECDH key exchange algorithm")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
drivers/crypto/qat/qat_asym.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index bd22fc0a6f..e7042f702f 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -798,13 +798,13 @@ ecdh_set_input(struct icp_qat_fw_pke_request *qat_req,
qat_func_alignsize = RTE_ALIGN_CEIL(qat_function.bytesize, 8);
if (asym_op->ecdh.ke_type == RTE_CRYPTO_ASYM_KE_PUB_KEY_GENERATE) {
- SET_PKE_LN(asym_op->ecdh.priv_key, qat_func_alignsize, 0);
+ SET_PKE_LN(xform->ec.pkey, qat_func_alignsize, 0);
SET_PKE_LN_EC(curve[curve_id], x, 1);
SET_PKE_LN_EC(curve[curve_id], y, 2);
} else if (asym_op->ecdh.ke_type == RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE) {
- SET_PKE_LN(asym_op->ecdh.priv_key, qat_func_alignsize, 0);
- SET_PKE_LN(asym_op->ecdh.pub_key.x, qat_func_alignsize, 1);
- SET_PKE_LN(asym_op->ecdh.pub_key.y, qat_func_alignsize, 2);
+ SET_PKE_LN(xform->ec.pkey, qat_func_alignsize, 0);
+ SET_PKE_LN(xform->ec.q.x, qat_func_alignsize, 1);
+ SET_PKE_LN(xform->ec.q.y, qat_func_alignsize, 2);
} else {
return -EINVAL;
}
--
2.50.1
prev parent reply other threads:[~2025-08-27 9:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 9:23 [PATCH 1/3] crypto/qat: Add ECDH, ECDSA and ECPM capabilities Radu Nicolau
2025-08-27 9:23 ` [PATCH 2/3] test/crypto: add QAT EC tests Radu Nicolau
2025-08-27 14:31 ` Ji, Kai
2025-08-27 9:23 ` Radu Nicolau [this message]
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=20250827092358.765222-3-radu.nicolau@intel.com \
--to=radu.nicolau@intel.com \
--cc=arkadiuszx.kusztal@intel.com \
--cc=dev@dpdk.org \
--cc=kai.ji@intel.com \
--cc=stable@dpdk.org \
/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).