public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Garvit Varshney <gvarshney@marvell.com>
To: <dev@dpdk.org>
Cc: <gakhil@marvell.com>, Garvit Varshney <gvarshney@marvell.com>
Subject: [PATCH] crypto/cnxk: return decrypted data for RSA verify
Date: Tue, 27 Jan 2026 10:04:59 +0530	[thread overview]
Message-ID: <20260127043459.178859-1-gvarshney@marvell.com> (raw)

For RSA verify operations with RTE_CRYPTO_RSA_PADDING_NONE, the driver
cannot determine which padding algorithm the application is using.
As per the API specification in rte_crypto_asym.h, when
RTE_CRYPTO_RSA_PADDING_NONE and RTE_CRYPTO_ASYM_OP_VERIFY are selected,
the decrypted signature should be returned to the application in the
cipher output buffer.

Fixes: dfd038b97ec3 ("crypto/cnxk: refactor RSA verification")

Signed-off-by: Garvit Varshney <gvarshney@marvell.com>
---
 .mailmap                      | 1 +
 drivers/crypto/cnxk/cnxk_ae.h | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.mailmap b/.mailmap
index 2f089326ff..730f02707a 100644
--- a/.mailmap
+++ b/.mailmap
@@ -496,6 +496,7 @@ Ganghui Zeng <zengganghui@huawei.com>
 Gao Feng <davidfgao@tencent.com>
 Gaoxiang Liu <liugaoxiang@huawei.com>
 Gargi Sau <gargi.sau@intel.com>
+Garvit Varshney <gvarshney@marvell.com>
 Gary Mussar <gmussar@ciena.com>
 Gaurav Singh <gaurav1086@gmail.com>
 Gautam Dawar <gdawar@solarflare.com>
diff --git a/drivers/crypto/cnxk/cnxk_ae.h b/drivers/crypto/cnxk/cnxk_ae.h
index 912a2a9496..21a0c8068a 100644
--- a/drivers/crypto/cnxk/cnxk_ae.h
+++ b/drivers/crypto/cnxk/cnxk_ae.h
@@ -1591,9 +1591,10 @@ cnxk_ae_dequeue_rsa_op(struct rte_crypto_op *cop, uint8_t *rptr,
 		break;
 	case RTE_CRYPTO_ASYM_OP_VERIFY:
 		if (rsa_ctx->padding.type == RTE_CRYPTO_RSA_PADDING_NONE) {
-			rsa->sign.length = rsa_ctx->n.length;
-			if (memcmp(rptr, rsa->message.data, rsa->message.length))
-				cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
+			/* Application compares decrypted data with message for SW padding schemes
+			 */
+			rsa->cipher.length = rsa_ctx->n.length;
+			memcpy(rsa->cipher.data, rptr, rsa->cipher.length);
 		} else {
 			/* Get length of signed output */
 			rsa->sign.length = rte_cpu_to_be_16(*((uint16_t *)rptr));
-- 
2.25.1


             reply	other threads:[~2026-01-27  4:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27  4:34 Garvit Varshney [this message]
2026-02-10 14:00 ` [PATCH] crypto/cnxk: return decrypted data for RSA verify 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=20260127043459.178859-1-gvarshney@marvell.com \
    --to=gvarshney@marvell.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