DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: declan.doherty@intel.com, akhil.goyal@intel.com,
	hemant.agrawal@nxp.com, jerin.jacob@intel.com,
	fiona.trahe@intel.com, deepak.k.jain@intel.com,
	john.griffin@intel.com
Cc: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/7] app/crypto-perf: parse AEAD data from vectors
Date: Wed, 13 Sep 2017 08:20:21 +0100	[thread overview]
Message-ID: <20170913072026.29734-3-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <20170913072026.29734-1-pablo.de.lara.guarch@intel.com>

Since DPDK 17.08, there is specific parameters
for AEAD algorithm, like AES-GCM. When verifying
crypto operations with test vectors, the parser
was not reading AEAD data (such as IV or key).

Fixes: 8a5b494a7f99 ("app/test-crypto-perf: add AEAD parameters")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test-crypto-perf/cperf_test_vector_parsing.c | 55 ++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 148a604..3952632 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -116,6 +116,20 @@ show_test_vector(struct cperf_test_vector *test_vector)
 		printf("\n");
 	}
 
+	if (test_vector->aead_key.data) {
+		printf("\naead_key =\n");
+		for (i = 0; i < test_vector->aead_key.length; ++i) {
+			if ((i % wrap == 0) && (i != 0))
+				printf("\n");
+			if (i == (uint32_t)(test_vector->aead_key.length - 1))
+				printf("0x%02x", test_vector->aead_key.data[i]);
+			else
+				printf("0x%02x, ",
+					test_vector->aead_key.data[i]);
+		}
+		printf("\n");
+	}
+
 	if (test_vector->cipher_iv.data) {
 		printf("\ncipher_iv =\n");
 		for (i = 0; i < test_vector->cipher_iv.length; ++i) {
@@ -142,6 +156,19 @@ show_test_vector(struct cperf_test_vector *test_vector)
 		printf("\n");
 	}
 
+	if (test_vector->aead_iv.data) {
+		printf("\naead_iv =\n");
+		for (i = 0; i < test_vector->aead_iv.length; ++i) {
+			if ((i % wrap == 0) && (i != 0))
+				printf("\n");
+			if (i == (uint32_t)(test_vector->aead_iv.length - 1))
+				printf("0x%02x", test_vector->aead_iv.data[i]);
+			else
+				printf("0x%02x, ", test_vector->aead_iv.data[i]);
+		}
+		printf("\n");
+	}
+
 	if (test_vector->ciphertext.data) {
 		printf("\nciphertext =\n");
 		for (i = 0; i < test_vector->ciphertext.length; ++i) {
@@ -345,6 +372,20 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
 			vector->auth_key.length = opts->auth_key_sz;
 		}
 
+	} else if (strstr(key_token, "aead_key")) {
+		rte_free(vector->aead_key.data);
+		vector->aead_key.data = data;
+		if (tc_found)
+			vector->aead_key.length = data_length;
+		else {
+			if (opts->aead_key_sz > data_length) {
+				printf("Global aead_key shorter than "
+					"aead_key_sz\n");
+				return -1;
+			}
+			vector->aead_key.length = opts->aead_key_sz;
+		}
+
 	} else if (strstr(key_token, "cipher_iv")) {
 		rte_free(vector->cipher_iv.data);
 		vector->cipher_iv.data = data;
@@ -373,6 +414,20 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
 			vector->auth_iv.length = opts->auth_iv_sz;
 		}
 
+	} else if (strstr(key_token, "aead_iv")) {
+		rte_free(vector->aead_iv.data);
+		vector->aead_iv.data = data;
+		if (tc_found)
+			vector->aead_iv.length = data_length;
+		else {
+			if (opts->aead_iv_sz > data_length) {
+				printf("Global aead iv shorter than "
+					"aead_iv_sz\n");
+				return -1;
+			}
+			vector->aead_iv.length = opts->aead_iv_sz;
+		}
+
 	} else if (strstr(key_token, "ciphertext")) {
 		rte_free(vector->ciphertext.data);
 		vector->ciphertext.data = data;
-- 
2.9.4

  parent reply	other threads:[~2017-09-13 15:20 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  8:05 [dpdk-dev] [PATCH 0/6] Crypto-perf app improvements Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 1/6] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 2/6] app/crypto-perf: parse AEAD data from vectors Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 3/6] app/crypto-perf: parse segment size Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 4/6] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 5/6] app/crypto-perf: do not populate the mbufs at init Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 6/6] app/crypto-perf: use single mempool Pablo de Lara
2017-08-30  8:30   ` Akhil Goyal
     [not found]     ` <9F7182E3F746AB4EA17801C148F3C60433039119@IRSMSX101.ger.corp.intel.com>
2017-09-11 11:08       ` De Lara Guarch, Pablo
2017-09-11 13:10         ` Shreyansh Jain
2017-09-11 13:56           ` De Lara Guarch, Pablo
2017-09-04 13:08 ` [dpdk-dev] [PATCH 0/6] Crypto-perf app improvements Zhang, Roy Fan
2017-09-13  7:20 ` [dpdk-dev] [PATCH v2 0/7] " Pablo de Lara
2017-09-13  7:20   ` [dpdk-dev] [PATCH v2 1/7] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-09-13  7:20   ` Pablo de Lara [this message]
2017-09-13  7:20   ` [dpdk-dev] [PATCH v2 3/7] app/crypto-perf: parse segment size Pablo de Lara
2017-09-13  7:20   ` [dpdk-dev] [PATCH v2 4/7] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-09-13  7:20   ` [dpdk-dev] [PATCH v2 5/7] app/crypto-perf: do not populate the mbufs at init Pablo de Lara
2017-09-22  7:55   ` [dpdk-dev] [PATCH v3 0/7] Crypto-perf app improvements Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 1/7] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 2/7] app/crypto-perf: parse AEAD data from vectors Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 3/7] app/crypto-perf: parse segment size Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 4/7] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 5/7] app/crypto-perf: do not populate the mbufs at init Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 6/7] app/crypto-perf: support multiple queue pairs Pablo de Lara
2017-09-26  8:42       ` Akhil Goyal
2017-10-04 10:25         ` De Lara Guarch, Pablo
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 7/7] app/crypto-perf: use single mempool Pablo de Lara
2017-09-26  9:21       ` Akhil Goyal
2017-10-04  7:47         ` De Lara Guarch, Pablo
2017-10-04  3:46     ` [dpdk-dev] [PATCH v4 0/8] Crypto-perf app improvements Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 1/8] app/crypto-perf: refactor common test code Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 2/8] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 3/8] app/crypto-perf: parse AEAD data from vectors Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 4/8] app/crypto-perf: parse segment size Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 5/8] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 6/8] app/crypto-perf: do not populate the mbufs at init Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 7/8] app/crypto-perf: support multiple queue pairs Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 8/8] app/crypto-perf: use single mempool Pablo de Lara
2017-10-06 11:57       ` [dpdk-dev] [PATCH v4 0/8] Crypto-perf app improvements Akhil Goyal
2017-10-06 12:50       ` De Lara Guarch, Pablo
2017-09-13  7:22 ` [dpdk-dev] [PATCH v2 0/7] " Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 1/7] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 2/7] app/crypto-perf: parse AEAD data from vectors Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 3/7] app/crypto-perf: parse segment size Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 4/7] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 5/7] app/crypto-perf: do not populate the mbufs at init Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 6/7] app/crypto-perf: support multiple queue pairs Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 7/7] app/crypto-perf: use single mempool Pablo de Lara

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=20170913072026.29734-3-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=akhil.goyal@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerin.jacob@intel.com \
    --cc=john.griffin@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).