patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Archana Muniganti <marchana@marvell.com>
To: <akhil.goyal@nxp.com>, <pablo.de.lara.guarch@intel.com>
Cc: Archana Muniganti <marchana@marvell.com>, <anoobj@marvell.com>,
	<jerinj@marvell.com>, <dev@dpdk.org>, <stable@dpdk.org>
Subject: [dpdk-stable] [PATCH] app/crypto-perf: fix incorrect input data for AEAD decrypt
Date: Thu, 21 Nov 2019 16:44:27 +0530	[thread overview]
Message-ID: <1574334867-32619-1-git-send-email-marchana@marvell.com> (raw)

In AEAD decrypt(verify mode), test data should point to
cipher text instead of plain text

Fixes: 5b2b0a740fba ("app/crypto-perf: overwrite mbuf when verifying")

Signed-off-by: Archana Muniganti <marchana@marvell.com>
---
 app/test-crypto-perf/cperf_test_verify.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index bbdf37d..833bc9a 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -203,11 +203,19 @@ struct cperf_op_result {
 {
 	uint32_t segment_sz = options->segment_sz;
 	uint8_t *mbuf_data;
-	uint8_t *test_data =
-			(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
+	uint8_t *test_data;
+	uint32_t remaining_bytes = options->max_buffer_size;
+
+	if (options->op_type == CPERF_AEAD) {
+		test_data = (options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT) ?
 					test_vector->plaintext.data :
 					test_vector->ciphertext.data;
-	uint32_t remaining_bytes = options->max_buffer_size;
+	} else {
+		test_data =
+			(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
+				test_vector->plaintext.data :
+				test_vector->ciphertext.data;
+	}
 
 	while (remaining_bytes) {
 		mbuf_data = rte_pktmbuf_mtod(mbuf, uint8_t *);
-- 
1.8.3.1


             reply	other threads:[~2019-11-25 18:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 11:14 Archana Muniganti [this message]
2019-11-21 12:43 ` Anoob Joseph
2019-11-25 10:18   ` 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=1574334867-32619-1-git-send-email-marchana@marvell.com \
    --to=marchana@marvell.com \
    --cc=akhil.goyal@nxp.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=pablo.de.lara.guarch@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).