DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/crypto: skip plain text compare for null cipher OOP
@ 2021-11-08 15:19 Anoob Joseph
  2021-11-10 11:23 ` De Lara Guarch, Pablo
  2021-11-10 13:04 ` [dpdk-dev] [PATCH v2] test/crypto: skip plain text compare for null cipher Anoob Joseph
  0 siblings, 2 replies; 7+ messages in thread
From: Anoob Joseph @ 2021-11-08 15:19 UTC (permalink / raw)
  To: Akhil Goyal, Declan Doherty, Fan Zhang
  Cc: Anoob Joseph, Jerin Jacob, Archana Muniganti, Tejasree Kondoj,
	Hemant Agrawal, Radu Nicolau, Ciara Power, Gagandeep Singh, dev

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-11 11:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 15:19 [dpdk-dev] [PATCH] test/crypto: skip plain text compare for null cipher OOP Anoob Joseph
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

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).