DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v2] examples/fips_validation: add parsing for AES CTR
@ 2022-08-22 12:23 Brian Dooley
  2022-09-15 13:21 ` Ji, Kai
  2022-09-16 13:53 ` [PATCH v3] " Brian Dooley
  0 siblings, 2 replies; 10+ messages in thread
From: Brian Dooley @ 2022-08-22 12:23 UTC (permalink / raw)
  To: Fan Zhang, Brian Dooley; +Cc: dev, gmuthukrishn, gakhil, kai.ji

Added functionality to parse algorithm for AES CTR test

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
v2: fix clang warning for int-in-bool-context
---
 examples/fips_validation/fips_validation.c     | 2 ++
 examples/fips_validation/fips_validation.h     | 2 ++
 examples/fips_validation/fips_validation_aes.c | 5 +++++
 examples/fips_validation/main.c                | 9 +++++++--
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index 12b9b03f56..541eead078 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -466,6 +466,8 @@ fips_test_parse_one_json_vector_set(void)
 		info.algo = FIPS_TEST_ALGO_AES_CBC;
 	else if (strstr(algo_str, "AES-XTS"))
 		info.algo = FIPS_TEST_ALGO_AES_XTS;
+	else if (strstr(algo_str, "AES-CTR"))
+		info.algo = FIPS_TEST_ALGO_AES_CTR;
 	else if (strstr(algo_str, "SHA"))
 		info.algo = FIPS_TEST_ALGO_SHA;
 	else
diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h
index 5c1abcbd91..96fdbec41a 100644
--- a/examples/fips_validation/fips_validation.h
+++ b/examples/fips_validation/fips_validation.h
@@ -35,6 +35,7 @@
 enum fips_test_algorithms {
 		FIPS_TEST_ALGO_AES = 0,
 		FIPS_TEST_ALGO_AES_CBC,
+		FIPS_TEST_ALGO_AES_CTR,
 		FIPS_TEST_ALGO_AES_GCM,
 		FIPS_TEST_ALGO_AES_CMAC,
 		FIPS_TEST_ALGO_AES_CCM,
@@ -105,6 +106,7 @@ enum fips_aesavs_test_types {
 	AESAVS_TYPE_MMT,
 	AESAVS_TYPE_MCT,
 	AESAVS_TYPE_AFT,
+	AESAVS_TYPE_CTR,
 };
 
 enum fips_tdes_test_types {
diff --git a/examples/fips_validation/fips_validation_aes.c b/examples/fips_validation/fips_validation_aes.c
index 4f61505bb3..0ef97aa03d 100644
--- a/examples/fips_validation/fips_validation_aes.c
+++ b/examples/fips_validation/fips_validation_aes.c
@@ -30,8 +30,10 @@
 #define TESTTYPE_JSON_STR	"testType"
 #define DIR_JSON_STR		"direction"
 #define KEYLEN_JSON_STR		"keyLen"
+#define OVERFLOW_JSON_STR	"overflow"
 
 #define KEY_JSON_STR	"key"
+#define PAYLOADLEN_JSON_STR	"payloadLen"
 #define IV_JSON_STR	"iv"
 #define PT_JSON_STR	"pt"
 #define CT_JSON_STR	"ct"
@@ -52,6 +54,7 @@ struct {
 		{AESAVS_TYPE_MMT, "MMT"},
 		{AESAVS_TYPE_MCT, "MCT"},
 		{AESAVS_TYPE_AFT, "AFT"},
+		{AESAVS_TYPE_CTR, "CTR"},
 };
 
 struct aes_test_algo {
@@ -60,6 +63,7 @@ struct aes_test_algo {
 } const algo_con[] = {
 		{"CBC", RTE_CRYPTO_CIPHER_AES_CBC},
 		{"ECB", RTE_CRYPTO_CIPHER_AES_ECB},
+		{"CTR", RTE_CRYPTO_CIPHER_AES_CTR},
 };
 
 static int
@@ -291,6 +295,7 @@ parse_test_aes_json_init(void)
 	case AESAVS_TYPE_MCT:
 		info.parse_writeback = parse_test_aes_mct_json_writeback;
 		break;
+	case AESAVS_TYPE_CTR:
 	case AESAVS_TYPE_AFT:
 		info.parse_writeback = parse_test_aes_json_writeback;
 		break;
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index 8bd5a66889..0ee618cc66 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -770,9 +770,11 @@ prepare_aes_xform(struct rte_crypto_sym_xform *xform)
 	struct rte_crypto_cipher_xform *cipher_xform = &xform->cipher;
 
 	xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-
 	if (info.interim_info.aes_data.cipher_algo == RTE_CRYPTO_CIPHER_AES_CBC)
 		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_CBC;
+	else if (info.interim_info.aes_data.cipher_algo ==
+			RTE_CRYPTO_CIPHER_AES_CTR)
+		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_CTR;
 	else
 		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_ECB;
 
@@ -781,7 +783,8 @@ prepare_aes_xform(struct rte_crypto_sym_xform *xform)
 			RTE_CRYPTO_CIPHER_OP_DECRYPT;
 	cipher_xform->key.data = vec.cipher_auth.key.val;
 	cipher_xform->key.length = vec.cipher_auth.key.len;
-	if (cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CBC) {
+	if (cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CBC ||
+			cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CTR) {
 		cipher_xform->iv.length = vec.iv.len;
 		cipher_xform->iv.offset = IV_OFF;
 	} else {
@@ -1796,6 +1799,7 @@ init_test_ops(void)
 {
 	switch (info.algo) {
 	case FIPS_TEST_ALGO_AES_CBC:
+	case FIPS_TEST_ALGO_AES_CTR:
 	case FIPS_TEST_ALGO_AES:
 		test_ops.prepare_op = prepare_cipher_op;
 		test_ops.prepare_xform  = prepare_aes_xform;
@@ -2007,6 +2011,7 @@ fips_test_one_test_group(void)
 		ret = parse_test_xts_json_init();
 		break;
 	case FIPS_TEST_ALGO_AES_CBC:
+	case FIPS_TEST_ALGO_AES_CTR:
 	case FIPS_TEST_ALGO_AES:
 		ret = parse_test_aes_json_init();
 		break;
-- 
2.25.1


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

* RE: [PATCH v2] examples/fips_validation: add parsing for AES CTR
  2022-08-22 12:23 [PATCH v2] examples/fips_validation: add parsing for AES CTR Brian Dooley
@ 2022-09-15 13:21 ` Ji, Kai
  2022-09-16 17:23   ` Gowrishankar Muthukrishnan
  2022-09-16 13:53 ` [PATCH v3] " Brian Dooley
  1 sibling, 1 reply; 10+ messages in thread
From: Ji, Kai @ 2022-09-15 13:21 UTC (permalink / raw)
  To: Dooley, Brian, Zhang, Roy Fan; +Cc: dev, gmuthukrishn, gakhil

Please fix the checkpath issue reported.

Acked-by: Ji, Kai <kai.ji@intel.com>

> -----Original Message-----
> From: Dooley, Brian <brian.dooley@intel.com>
> Sent: Monday, August 22, 2022 1:23 PM
> To: Zhang, Roy Fan <roy.fan.zhang@intel.com>; Dooley, Brian
> <brian.dooley@intel.com>
> Cc: dev@dpdk.org; gmuthukrishn@marvell.com; gakhil@marvell.com; Ji, Kai
> <kai.ji@intel.com>
> Subject: [PATCH v2] examples/fips_validation: add parsing for AES CTR
> 
> Added functionality to parse algorithm for AES CTR test
> 
> Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> ---
> v2: fix clang warning for int-in-bool-context
> ---

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

* [PATCH v3] examples/fips_validation: add parsing for AES CTR
  2022-08-22 12:23 [PATCH v2] examples/fips_validation: add parsing for AES CTR Brian Dooley
  2022-09-15 13:21 ` Ji, Kai
@ 2022-09-16 13:53 ` Brian Dooley
  2022-09-30  8:53   ` [PATCH v4] " Brian Dooley
  1 sibling, 1 reply; 10+ messages in thread
From: Brian Dooley @ 2022-09-16 13:53 UTC (permalink / raw)
  To: Fan Zhang, Brian Dooley; +Cc: dev, gmuthukrishn, gakhil, kai.ji

Added functionality to parse algorithm for AES CTR test

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
---
v2: fix clang warning for int-in-bool-context
---
v3: in reply to fix and patchwork CI
---
 examples/fips_validation/fips_validation.c     | 2 ++
 examples/fips_validation/fips_validation.h     | 2 ++
 examples/fips_validation/fips_validation_aes.c | 5 +++++
 examples/fips_validation/main.c                | 9 +++++++--
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index 12b9b03f56..541eead078 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -466,6 +466,8 @@ fips_test_parse_one_json_vector_set(void)
 		info.algo = FIPS_TEST_ALGO_AES_CBC;
 	else if (strstr(algo_str, "AES-XTS"))
 		info.algo = FIPS_TEST_ALGO_AES_XTS;
+	else if (strstr(algo_str, "AES-CTR"))
+		info.algo = FIPS_TEST_ALGO_AES_CTR;
 	else if (strstr(algo_str, "SHA"))
 		info.algo = FIPS_TEST_ALGO_SHA;
 	else
diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h
index 5c1abcbd91..96fdbec41a 100644
--- a/examples/fips_validation/fips_validation.h
+++ b/examples/fips_validation/fips_validation.h
@@ -35,6 +35,7 @@
 enum fips_test_algorithms {
 		FIPS_TEST_ALGO_AES = 0,
 		FIPS_TEST_ALGO_AES_CBC,
+		FIPS_TEST_ALGO_AES_CTR,
 		FIPS_TEST_ALGO_AES_GCM,
 		FIPS_TEST_ALGO_AES_CMAC,
 		FIPS_TEST_ALGO_AES_CCM,
@@ -105,6 +106,7 @@ enum fips_aesavs_test_types {
 	AESAVS_TYPE_MMT,
 	AESAVS_TYPE_MCT,
 	AESAVS_TYPE_AFT,
+	AESAVS_TYPE_CTR,
 };
 
 enum fips_tdes_test_types {
diff --git a/examples/fips_validation/fips_validation_aes.c b/examples/fips_validation/fips_validation_aes.c
index 4f61505bb3..0ef97aa03d 100644
--- a/examples/fips_validation/fips_validation_aes.c
+++ b/examples/fips_validation/fips_validation_aes.c
@@ -30,8 +30,10 @@
 #define TESTTYPE_JSON_STR	"testType"
 #define DIR_JSON_STR		"direction"
 #define KEYLEN_JSON_STR		"keyLen"
+#define OVERFLOW_JSON_STR	"overflow"
 
 #define KEY_JSON_STR	"key"
+#define PAYLOADLEN_JSON_STR	"payloadLen"
 #define IV_JSON_STR	"iv"
 #define PT_JSON_STR	"pt"
 #define CT_JSON_STR	"ct"
@@ -52,6 +54,7 @@ struct {
 		{AESAVS_TYPE_MMT, "MMT"},
 		{AESAVS_TYPE_MCT, "MCT"},
 		{AESAVS_TYPE_AFT, "AFT"},
+		{AESAVS_TYPE_CTR, "CTR"},
 };
 
 struct aes_test_algo {
@@ -60,6 +63,7 @@ struct aes_test_algo {
 } const algo_con[] = {
 		{"CBC", RTE_CRYPTO_CIPHER_AES_CBC},
 		{"ECB", RTE_CRYPTO_CIPHER_AES_ECB},
+		{"CTR", RTE_CRYPTO_CIPHER_AES_CTR},
 };
 
 static int
@@ -291,6 +295,7 @@ parse_test_aes_json_init(void)
 	case AESAVS_TYPE_MCT:
 		info.parse_writeback = parse_test_aes_mct_json_writeback;
 		break;
+	case AESAVS_TYPE_CTR:
 	case AESAVS_TYPE_AFT:
 		info.parse_writeback = parse_test_aes_json_writeback;
 		break;
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index 8bd5a66889..0ee618cc66 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -770,9 +770,11 @@ prepare_aes_xform(struct rte_crypto_sym_xform *xform)
 	struct rte_crypto_cipher_xform *cipher_xform = &xform->cipher;
 
 	xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-
 	if (info.interim_info.aes_data.cipher_algo == RTE_CRYPTO_CIPHER_AES_CBC)
 		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_CBC;
+	else if (info.interim_info.aes_data.cipher_algo ==
+			RTE_CRYPTO_CIPHER_AES_CTR)
+		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_CTR;
 	else
 		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_ECB;
 
@@ -781,7 +783,8 @@ prepare_aes_xform(struct rte_crypto_sym_xform *xform)
 			RTE_CRYPTO_CIPHER_OP_DECRYPT;
 	cipher_xform->key.data = vec.cipher_auth.key.val;
 	cipher_xform->key.length = vec.cipher_auth.key.len;
-	if (cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CBC) {
+	if (cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CBC ||
+			cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CTR) {
 		cipher_xform->iv.length = vec.iv.len;
 		cipher_xform->iv.offset = IV_OFF;
 	} else {
@@ -1796,6 +1799,7 @@ init_test_ops(void)
 {
 	switch (info.algo) {
 	case FIPS_TEST_ALGO_AES_CBC:
+	case FIPS_TEST_ALGO_AES_CTR:
 	case FIPS_TEST_ALGO_AES:
 		test_ops.prepare_op = prepare_cipher_op;
 		test_ops.prepare_xform  = prepare_aes_xform;
@@ -2007,6 +2011,7 @@ fips_test_one_test_group(void)
 		ret = parse_test_xts_json_init();
 		break;
 	case FIPS_TEST_ALGO_AES_CBC:
+	case FIPS_TEST_ALGO_AES_CTR:
 	case FIPS_TEST_ALGO_AES:
 		ret = parse_test_aes_json_init();
 		break;
-- 
2.25.1


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

* RE: [PATCH v2] examples/fips_validation: add parsing for AES CTR
  2022-09-15 13:21 ` Ji, Kai
@ 2022-09-16 17:23   ` Gowrishankar Muthukrishnan
  0 siblings, 0 replies; 10+ messages in thread
From: Gowrishankar Muthukrishnan @ 2022-09-16 17:23 UTC (permalink / raw)
  To: Ji, Kai, Dooley, Brian, Zhang, Roy Fan; +Cc: dev, Akhil Goyal, Anoob Joseph

Tested with FIPS test vectors from NIST.

Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>

Thanks,
Gowrishankar

> -----Original Message-----
> From: Ji, Kai <kai.ji@intel.com>
> Sent: Thursday, September 15, 2022 6:52 PM
> To: Dooley, Brian <brian.dooley@intel.com>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>
> Cc: dev@dpdk.org; Gowrishankar Muthukrishnan
> <gmuthukrishn@marvell.com>; Akhil Goyal <gakhil@marvell.com>
> Subject: [EXT] RE: [PATCH v2] examples/fips_validation: add parsing for AES
> CTR
> 
> External Email
> 
> ----------------------------------------------------------------------
> Please fix the checkpath issue reported.
> 
> Acked-by: Ji, Kai <kai.ji@intel.com>
> 
> > -----Original Message-----
> > From: Dooley, Brian <brian.dooley@intel.com>
> > Sent: Monday, August 22, 2022 1:23 PM
> > To: Zhang, Roy Fan <roy.fan.zhang@intel.com>; Dooley, Brian
> > <brian.dooley@intel.com>
> > Cc: dev@dpdk.org; gmuthukrishn@marvell.com; gakhil@marvell.com; Ji,
> > Kai <kai.ji@intel.com>
> > Subject: [PATCH v2] examples/fips_validation: add parsing for AES CTR
> >
> > Added functionality to parse algorithm for AES CTR test
> >
> > Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> > ---
> > v2: fix clang warning for int-in-bool-context
> > ---

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

* [PATCH v4] examples/fips_validation: add parsing for AES CTR
  2022-09-16 13:53 ` [PATCH v3] " Brian Dooley
@ 2022-09-30  8:53   ` Brian Dooley
  2022-10-07 10:48     ` [EXT] " Akhil Goyal
  2022-10-07 16:58     ` [PATCH v5] " Brian Dooley
  0 siblings, 2 replies; 10+ messages in thread
From: Brian Dooley @ 2022-09-30  8:53 UTC (permalink / raw)
  To: Brian Dooley; +Cc: dev, gmuthukrishn, gakhil, roy.fan.zhang, kai.ji

Added functionality to parse algorithm for AES CTR test

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
v2: fix clang warning for int-in-bool-context
---
v3: in reply to fix and patchwork CI
---
v4: missing acks
---
 examples/fips_validation/fips_validation.c     | 2 ++
 examples/fips_validation/fips_validation.h     | 2 ++
 examples/fips_validation/fips_validation_aes.c | 5 +++++
 examples/fips_validation/main.c                | 9 +++++++--
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index cd905b2c5b..016888fe7f 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -468,6 +468,8 @@ fips_test_parse_one_json_vector_set(void)
 		info.algo = FIPS_TEST_ALGO_AES_CBC;
 	else if (strstr(algo_str, "AES-XTS"))
 		info.algo = FIPS_TEST_ALGO_AES_XTS;
+	else if (strstr(algo_str, "AES-CTR"))
+		info.algo = FIPS_TEST_ALGO_AES_CTR;
 	else if (strstr(algo_str, "SHA"))
 		info.algo = FIPS_TEST_ALGO_SHA;
 	else
diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h
index 5c1abcbd91..96fdbec41a 100644
--- a/examples/fips_validation/fips_validation.h
+++ b/examples/fips_validation/fips_validation.h
@@ -35,6 +35,7 @@
 enum fips_test_algorithms {
 		FIPS_TEST_ALGO_AES = 0,
 		FIPS_TEST_ALGO_AES_CBC,
+		FIPS_TEST_ALGO_AES_CTR,
 		FIPS_TEST_ALGO_AES_GCM,
 		FIPS_TEST_ALGO_AES_CMAC,
 		FIPS_TEST_ALGO_AES_CCM,
@@ -105,6 +106,7 @@ enum fips_aesavs_test_types {
 	AESAVS_TYPE_MMT,
 	AESAVS_TYPE_MCT,
 	AESAVS_TYPE_AFT,
+	AESAVS_TYPE_CTR,
 };
 
 enum fips_tdes_test_types {
diff --git a/examples/fips_validation/fips_validation_aes.c b/examples/fips_validation/fips_validation_aes.c
index 4f61505bb3..0ef97aa03d 100644
--- a/examples/fips_validation/fips_validation_aes.c
+++ b/examples/fips_validation/fips_validation_aes.c
@@ -30,8 +30,10 @@
 #define TESTTYPE_JSON_STR	"testType"
 #define DIR_JSON_STR		"direction"
 #define KEYLEN_JSON_STR		"keyLen"
+#define OVERFLOW_JSON_STR	"overflow"
 
 #define KEY_JSON_STR	"key"
+#define PAYLOADLEN_JSON_STR	"payloadLen"
 #define IV_JSON_STR	"iv"
 #define PT_JSON_STR	"pt"
 #define CT_JSON_STR	"ct"
@@ -52,6 +54,7 @@ struct {
 		{AESAVS_TYPE_MMT, "MMT"},
 		{AESAVS_TYPE_MCT, "MCT"},
 		{AESAVS_TYPE_AFT, "AFT"},
+		{AESAVS_TYPE_CTR, "CTR"},
 };
 
 struct aes_test_algo {
@@ -60,6 +63,7 @@ struct aes_test_algo {
 } const algo_con[] = {
 		{"CBC", RTE_CRYPTO_CIPHER_AES_CBC},
 		{"ECB", RTE_CRYPTO_CIPHER_AES_ECB},
+		{"CTR", RTE_CRYPTO_CIPHER_AES_CTR},
 };
 
 static int
@@ -291,6 +295,7 @@ parse_test_aes_json_init(void)
 	case AESAVS_TYPE_MCT:
 		info.parse_writeback = parse_test_aes_mct_json_writeback;
 		break;
+	case AESAVS_TYPE_CTR:
 	case AESAVS_TYPE_AFT:
 		info.parse_writeback = parse_test_aes_json_writeback;
 		break;
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index e6c0b6a3a1..6713fe0582 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -771,9 +771,11 @@ prepare_aes_xform(struct rte_crypto_sym_xform *xform)
 	struct rte_crypto_cipher_xform *cipher_xform = &xform->cipher;
 
 	xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-
 	if (info.interim_info.aes_data.cipher_algo == RTE_CRYPTO_CIPHER_AES_CBC)
 		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_CBC;
+	else if (info.interim_info.aes_data.cipher_algo ==
+			RTE_CRYPTO_CIPHER_AES_CTR)
+		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_CTR;
 	else
 		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_ECB;
 
@@ -782,7 +784,8 @@ prepare_aes_xform(struct rte_crypto_sym_xform *xform)
 			RTE_CRYPTO_CIPHER_OP_DECRYPT;
 	cipher_xform->key.data = vec.cipher_auth.key.val;
 	cipher_xform->key.length = vec.cipher_auth.key.len;
-	if (cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CBC) {
+	if (cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CBC ||
+			cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CTR) {
 		cipher_xform->iv.length = vec.iv.len;
 		cipher_xform->iv.offset = IV_OFF;
 	} else {
@@ -1797,6 +1800,7 @@ init_test_ops(void)
 {
 	switch (info.algo) {
 	case FIPS_TEST_ALGO_AES_CBC:
+	case FIPS_TEST_ALGO_AES_CTR:
 	case FIPS_TEST_ALGO_AES:
 		test_ops.prepare_op = prepare_cipher_op;
 		test_ops.prepare_xform  = prepare_aes_xform;
@@ -2008,6 +2012,7 @@ fips_test_one_test_group(void)
 		ret = parse_test_xts_json_init();
 		break;
 	case FIPS_TEST_ALGO_AES_CBC:
+	case FIPS_TEST_ALGO_AES_CTR:
 	case FIPS_TEST_ALGO_AES:
 		ret = parse_test_aes_json_init();
 		break;
-- 
2.25.1


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

* RE: [EXT] [PATCH v4] examples/fips_validation: add parsing for AES CTR
  2022-09-30  8:53   ` [PATCH v4] " Brian Dooley
@ 2022-10-07 10:48     ` Akhil Goyal
  2022-10-10 14:29       ` Dooley, Brian
  2022-10-07 16:58     ` [PATCH v5] " Brian Dooley
  1 sibling, 1 reply; 10+ messages in thread
From: Akhil Goyal @ 2022-10-07 10:48 UTC (permalink / raw)
  To: Brian Dooley; +Cc: dev, Gowrishankar Muthukrishnan, roy.fan.zhang, kai.ji

Hi Brian,
> Added functionality to parse algorithm for AES CTR test
> 
> Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> Acked-by: Kai Ji <kai.ji@intel.com>
> Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> ---
> v2: fix clang warning for int-in-bool-context
> ---
> v3: in reply to fix and patchwork CI
> ---
> v4: missing acks
> ---
>  examples/fips_validation/fips_validation.c     | 2 ++
>  examples/fips_validation/fips_validation.h     | 2 ++
>  examples/fips_validation/fips_validation_aes.c | 5 +++++
>  examples/fips_validation/main.c                | 9 +++++++--
>  4 files changed, 16 insertions(+), 2 deletions(-)
Can you also update doc/guides/sample_app_ug/fips_validation.rst for CTR and GMAC that you have added.

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

* [PATCH v5] examples/fips_validation: add parsing for AES CTR
  2022-09-30  8:53   ` [PATCH v4] " Brian Dooley
  2022-10-07 10:48     ` [EXT] " Akhil Goyal
@ 2022-10-07 16:58     ` Brian Dooley
  2022-10-10 19:49       ` [EXT] " Akhil Goyal
  1 sibling, 1 reply; 10+ messages in thread
From: Brian Dooley @ 2022-10-07 16:58 UTC (permalink / raw)
  To: Brian Dooley; +Cc: dev, stable, gakhil, Kai Ji, Gowrishankar Muthukrishnan

Added functionality to parse algorithm for AES CTR test

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
v2: fix clang warning for int-in-bool-context
---
v3: in reply to fix and patchwork CI
---
v4: missing acks
---
v5: add documentation
---
 doc/guides/sample_app_ug/fips_validation.rst   | 2 ++
 examples/fips_validation/fips_validation.c     | 2 ++
 examples/fips_validation/fips_validation.h     | 2 ++
 examples/fips_validation/fips_validation_aes.c | 5 +++++
 examples/fips_validation/main.c                | 9 +++++++--
 5 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/doc/guides/sample_app_ug/fips_validation.rst b/doc/guides/sample_app_ug/fips_validation.rst
index 6f4bd34726..6e5885e23b 100644
--- a/doc/guides/sample_app_ug/fips_validation.rst
+++ b/doc/guides/sample_app_ug/fips_validation.rst
@@ -61,6 +61,8 @@ ACVP
     * AES-CBC (128,192,256) - AFT, MCT
     * AES-GCM (128,192,256) - AFT
     * AES-CMAC (128,192,256) - AFT
+    * AES-CTR (128,192,256) - AFT, CTR
+    * AES-GMAC (128,192,256) - AFT
     * AES-XTS (128,256) - AFT
     * HMAC (SHA1, SHA224, SHA256, SHA384, SHA512)
     * SHA (1, 256, 384, 512) - AFT, MCT
diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index cd905b2c5b..016888fe7f 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -468,6 +468,8 @@ fips_test_parse_one_json_vector_set(void)
 		info.algo = FIPS_TEST_ALGO_AES_CBC;
 	else if (strstr(algo_str, "AES-XTS"))
 		info.algo = FIPS_TEST_ALGO_AES_XTS;
+	else if (strstr(algo_str, "AES-CTR"))
+		info.algo = FIPS_TEST_ALGO_AES_CTR;
 	else if (strstr(algo_str, "SHA"))
 		info.algo = FIPS_TEST_ALGO_SHA;
 	else
diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h
index 5c1abcbd91..96fdbec41a 100644
--- a/examples/fips_validation/fips_validation.h
+++ b/examples/fips_validation/fips_validation.h
@@ -35,6 +35,7 @@
 enum fips_test_algorithms {
 		FIPS_TEST_ALGO_AES = 0,
 		FIPS_TEST_ALGO_AES_CBC,
+		FIPS_TEST_ALGO_AES_CTR,
 		FIPS_TEST_ALGO_AES_GCM,
 		FIPS_TEST_ALGO_AES_CMAC,
 		FIPS_TEST_ALGO_AES_CCM,
@@ -105,6 +106,7 @@ enum fips_aesavs_test_types {
 	AESAVS_TYPE_MMT,
 	AESAVS_TYPE_MCT,
 	AESAVS_TYPE_AFT,
+	AESAVS_TYPE_CTR,
 };
 
 enum fips_tdes_test_types {
diff --git a/examples/fips_validation/fips_validation_aes.c b/examples/fips_validation/fips_validation_aes.c
index 4f61505bb3..0ef97aa03d 100644
--- a/examples/fips_validation/fips_validation_aes.c
+++ b/examples/fips_validation/fips_validation_aes.c
@@ -30,8 +30,10 @@
 #define TESTTYPE_JSON_STR	"testType"
 #define DIR_JSON_STR		"direction"
 #define KEYLEN_JSON_STR		"keyLen"
+#define OVERFLOW_JSON_STR	"overflow"
 
 #define KEY_JSON_STR	"key"
+#define PAYLOADLEN_JSON_STR	"payloadLen"
 #define IV_JSON_STR	"iv"
 #define PT_JSON_STR	"pt"
 #define CT_JSON_STR	"ct"
@@ -52,6 +54,7 @@ struct {
 		{AESAVS_TYPE_MMT, "MMT"},
 		{AESAVS_TYPE_MCT, "MCT"},
 		{AESAVS_TYPE_AFT, "AFT"},
+		{AESAVS_TYPE_CTR, "CTR"},
 };
 
 struct aes_test_algo {
@@ -60,6 +63,7 @@ struct aes_test_algo {
 } const algo_con[] = {
 		{"CBC", RTE_CRYPTO_CIPHER_AES_CBC},
 		{"ECB", RTE_CRYPTO_CIPHER_AES_ECB},
+		{"CTR", RTE_CRYPTO_CIPHER_AES_CTR},
 };
 
 static int
@@ -291,6 +295,7 @@ parse_test_aes_json_init(void)
 	case AESAVS_TYPE_MCT:
 		info.parse_writeback = parse_test_aes_mct_json_writeback;
 		break;
+	case AESAVS_TYPE_CTR:
 	case AESAVS_TYPE_AFT:
 		info.parse_writeback = parse_test_aes_json_writeback;
 		break;
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index f8063b6599..4916d2b12e 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -761,9 +761,11 @@ prepare_aes_xform(struct rte_crypto_sym_xform *xform)
 	struct rte_crypto_cipher_xform *cipher_xform = &xform->cipher;
 
 	xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-
 	if (info.interim_info.aes_data.cipher_algo == RTE_CRYPTO_CIPHER_AES_CBC)
 		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_CBC;
+	else if (info.interim_info.aes_data.cipher_algo ==
+			RTE_CRYPTO_CIPHER_AES_CTR)
+		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_CTR;
 	else
 		cipher_xform->algo = RTE_CRYPTO_CIPHER_AES_ECB;
 
@@ -772,7 +774,8 @@ prepare_aes_xform(struct rte_crypto_sym_xform *xform)
 			RTE_CRYPTO_CIPHER_OP_DECRYPT;
 	cipher_xform->key.data = vec.cipher_auth.key.val;
 	cipher_xform->key.length = vec.cipher_auth.key.len;
-	if (cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CBC) {
+	if (cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CBC ||
+			cipher_xform->algo == RTE_CRYPTO_CIPHER_AES_CTR) {
 		cipher_xform->iv.length = vec.iv.len;
 		cipher_xform->iv.offset = IV_OFF;
 	} else {
@@ -1784,6 +1787,7 @@ init_test_ops(void)
 {
 	switch (info.algo) {
 	case FIPS_TEST_ALGO_AES_CBC:
+	case FIPS_TEST_ALGO_AES_CTR:
 	case FIPS_TEST_ALGO_AES:
 		test_ops.prepare_op = prepare_cipher_op;
 		test_ops.prepare_xform  = prepare_aes_xform;
@@ -1995,6 +1999,7 @@ fips_test_one_test_group(void)
 		ret = parse_test_xts_json_init();
 		break;
 	case FIPS_TEST_ALGO_AES_CBC:
+	case FIPS_TEST_ALGO_AES_CTR:
 	case FIPS_TEST_ALGO_AES:
 		ret = parse_test_aes_json_init();
 		break;
-- 
2.25.1


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

* RE: [EXT] [PATCH v4] examples/fips_validation: add parsing for AES CTR
  2022-10-07 10:48     ` [EXT] " Akhil Goyal
@ 2022-10-10 14:29       ` Dooley, Brian
  2022-10-10 15:51         ` Akhil Goyal
  0 siblings, 1 reply; 10+ messages in thread
From: Dooley, Brian @ 2022-10-10 14:29 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: dev, Gowrishankar Muthukrishnan, roy.fan.zhang, Ji, Kai

Hi Akhil,

> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Friday, October 7, 2022 11:49 AM
> To: Dooley, Brian <brian.dooley@intel.com>
> Cc: dev@dpdk.org; Gowrishankar Muthukrishnan
> <gmuthukrishn@marvell.com>; roy.fan.zhang@intel.com; Ji, Kai
> <kai.ji@intel.com>
> Subject: RE: [EXT] [PATCH v4] examples/fips_validation: add parsing for AES
> CTR
> 
> Hi Brian,
> > Added functionality to parse algorithm for AES CTR test
> >
> > Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> > Acked-by: Kai Ji <kai.ji@intel.com>
> > Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> > ---
> > v2: fix clang warning for int-in-bool-context
> > ---
> > v3: in reply to fix and patchwork CI
> > ---
> > v4: missing acks
> > ---
> >  examples/fips_validation/fips_validation.c     | 2 ++
> >  examples/fips_validation/fips_validation.h     | 2 ++
> >  examples/fips_validation/fips_validation_aes.c | 5 +++++
> >  examples/fips_validation/main.c                | 9 +++++++--
> >  4 files changed, 16 insertions(+), 2 deletions(-)
> Can you also update doc/guides/sample_app_ug/fips_validation.rst for CTR
> and GMAC that you have added.

Docs now updated in latest version


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

* RE: [EXT] [PATCH v4] examples/fips_validation: add parsing for AES CTR
  2022-10-10 14:29       ` Dooley, Brian
@ 2022-10-10 15:51         ` Akhil Goyal
  0 siblings, 0 replies; 10+ messages in thread
From: Akhil Goyal @ 2022-10-10 15:51 UTC (permalink / raw)
  To: Dooley, Brian; +Cc: dev, Gowrishankar Muthukrishnan, roy.fan.zhang, Ji, Kai

> Hi Akhil,
> 
> > Hi Brian,
> > > Added functionality to parse algorithm for AES CTR test
> > >
> > > Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> > > Acked-by: Kai Ji <kai.ji@intel.com>
> > > Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> > > ---
> > > v2: fix clang warning for int-in-bool-context
> > > ---
> > > v3: in reply to fix and patchwork CI
> > > ---
> > > v4: missing acks
> > > ---
> > >  examples/fips_validation/fips_validation.c     | 2 ++
> > >  examples/fips_validation/fips_validation.h     | 2 ++
> > >  examples/fips_validation/fips_validation_aes.c | 5 +++++
> > >  examples/fips_validation/main.c                | 9 +++++++--
> > >  4 files changed, 16 insertions(+), 2 deletions(-)
> > Can you also update doc/guides/sample_app_ug/fips_validation.rst for CTR
> > and GMAC that you have added.
> 
> Docs now updated in latest version
Yes, but you added doc updates for both CTR and GMAC in same patch.
I will split it while merging.

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

* RE: [EXT] [PATCH v5] examples/fips_validation: add parsing for AES CTR
  2022-10-07 16:58     ` [PATCH v5] " Brian Dooley
@ 2022-10-10 19:49       ` Akhil Goyal
  0 siblings, 0 replies; 10+ messages in thread
From: Akhil Goyal @ 2022-10-10 19:49 UTC (permalink / raw)
  To: Brian Dooley; +Cc: dev, stable, Kai Ji, Gowrishankar Muthukrishnan

> Added functionality to parse algorithm for AES CTR test
> 
> Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> Acked-by: Kai Ji <kai.ji@intel.com>
> Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> ---
> v2: fix clang warning for int-in-bool-context
> ---
> v3: in reply to fix and patchwork CI
> ---
> v4: missing acks
> ---
> v5: add documentation
> ---
>  doc/guides/sample_app_ug/fips_validation.rst   | 2 ++
>  examples/fips_validation/fips_validation.c     | 2 ++
>  examples/fips_validation/fips_validation.h     | 2 ++
>  examples/fips_validation/fips_validation_aes.c | 5 +++++
>  examples/fips_validation/main.c                | 9 +++++++--
>  5 files changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/guides/sample_app_ug/fips_validation.rst
> b/doc/guides/sample_app_ug/fips_validation.rst
> index 6f4bd34726..6e5885e23b 100644
> --- a/doc/guides/sample_app_ug/fips_validation.rst
> +++ b/doc/guides/sample_app_ug/fips_validation.rst
> @@ -61,6 +61,8 @@ ACVP
>      * AES-CBC (128,192,256) - AFT, MCT
>      * AES-GCM (128,192,256) - AFT
>      * AES-CMAC (128,192,256) - AFT
> +    * AES-CTR (128,192,256) - AFT, CTR
> +    * AES-GMAC (128,192,256) - AFT

Removed GMAC from this patch and added in GMAC FIPS support

Applied to dpdk-next-crypto

Thanks


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

end of thread, other threads:[~2022-10-10 19:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22 12:23 [PATCH v2] examples/fips_validation: add parsing for AES CTR Brian Dooley
2022-09-15 13:21 ` Ji, Kai
2022-09-16 17:23   ` Gowrishankar Muthukrishnan
2022-09-16 13:53 ` [PATCH v3] " Brian Dooley
2022-09-30  8:53   ` [PATCH v4] " Brian Dooley
2022-10-07 10:48     ` [EXT] " Akhil Goyal
2022-10-10 14:29       ` Dooley, Brian
2022-10-10 15:51         ` Akhil Goyal
2022-10-07 16:58     ` [PATCH v5] " Brian Dooley
2022-10-10 19:49       ` [EXT] " 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).