DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anoob Joseph <anoobj@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>,
	Declan Doherty <declan.doherty@intel.com>,
	Fan Zhang <roy.fan.zhang@intel.com>
Cc: Anoob Joseph <anoobj@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Archana Muniganti <marchana@marvell.com>,
	Tejasree Kondoj <ktejasree@marvell.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	"Radu Nicolau" <radu.nicolau@intel.com>,
	Ciara Power <ciara.power@intel.com>,
	Gagandeep Singh <g.singh@nxp.com>, <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH] test/crypto: skip plain text compare for null cipher OOP
Date: Mon, 8 Nov 2021 20:49:51 +0530	[thread overview]
Message-ID: <1636384791-157-1-git-send-email-anoobj@marvell.com> (raw)

NULL cipher is used for validating auth only cases. With out of place
processing, validating plain text should not be done as the PMD is only
expected to update auth data.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index e54a1a9..964f44f 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -7490,6 +7490,22 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
 				tdata->digest_enc.len);
 	}
 
+	/*
+	 * NULL cipher is used for auth only cases where only authentication
+	 * is done. With verify operation, MAC would be validated by the PMD.
+	 * With generate operation, verify MAC generated by the PMD.
+	 */
+	if (op_mode == OUT_OF_PLACE &&
+	    tdata->cipher_algo == RTE_CRYPTO_CIPHER_NULL) {
+		if (!verify)
+			TEST_ASSERT_BUFFERS_ARE_EQUAL(
+					ut_params->digest,
+					tdata->digest_enc.data,
+					tdata->digest_enc.len,
+					"Generated auth tag not as expected");
+		goto op_status_check;
+	}
+
 	/* Validate obuf */
 	if (verify) {
 		TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
@@ -7511,6 +7527,7 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
 				"Generated auth tag not as expected");
 	}
 
+op_status_check:
 	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
 			"crypto op processing failed");
 
-- 
2.7.4


             reply	other threads:[~2021-11-08 15:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 15:19 Anoob Joseph [this message]
2021-11-10 11:23 ` De Lara Guarch, Pablo
2021-11-10 11:48   ` Anoob Joseph
2021-11-10 13:04 ` [dpdk-dev] [PATCH v2] test/crypto: skip plain text compare for null cipher Anoob Joseph
2021-11-10 17:00   ` Power, Ciara
2021-11-10 17:16     ` De Lara Guarch, Pablo
2021-11-11 11:04       ` 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=1636384791-157-1-git-send-email-anoobj@marvell.com \
    --to=anoobj@marvell.com \
    --cc=ciara.power@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=gakhil@marvell.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerinj@marvell.com \
    --cc=ktejasree@marvell.com \
    --cc=marchana@marvell.com \
    --cc=radu.nicolau@intel.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).