All of lore.kernel.org
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support
@ 2021-09-07  9:07 Radu Nicolau
  2021-09-07  9:07 ` [dpdk-dev] [PATCH 2/3] crypto/aesni_mb: add AES CCM 192-bit key support Radu Nicolau
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Radu Nicolau @ 2021-09-07  9:07 UTC (permalink / raw)
  To: Declan Doherty, Pablo de Lara; +Cc: dev, Radu Nicolau

Add support for NULL/NULL xform.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c    |  3 ++
 .../crypto/aesni_mb/rte_aesni_mb_pmd_ops.c    | 38 +++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index a01c826a3c..b8ab84e215 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -462,6 +462,9 @@ aesni_mb_set_session_cipher_parameters(const MB_MGR *mb_mgr,
 
 	/* Select cipher mode */
 	switch (xform->cipher.algo) {
+	case RTE_CRYPTO_CIPHER_NULL:
+		sess->cipher.mode = NULL_CIPHER;
+		return 0;
 	case RTE_CRYPTO_CIPHER_AES_CBC:
 		sess->cipher.mode = CBC;
 		is_aes = 1;
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
index fc7fdfec8e..ebf75198ae 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
@@ -502,6 +502,44 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 			}, }
 		}, }
 	},
+	{       /* NULL (AUTH) */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			{.auth = {
+				.algo = RTE_CRYPTO_AUTH_NULL,
+				.block_size = 1,
+				.key_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				},
+				.digest_size = {
+				.min = 0,
+					.max = 0,
+				.increment = 0
+				},
+				.iv_size = { 0 }
+			}, },
+		}, },
+	},
+	{       /* NULL (CIPHER) */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_NULL,
+				.block_size = 1,
+				.key_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				},
+				.iv_size = { 0 }
+			}, },
+		}, }
+	},
+
 #if IMB_VERSION(0, 53, 0) <= IMB_VERSION_NUM
 	{	/* AES ECB */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-- 
2.25.1


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

* [dpdk-dev] [PATCH 2/3] crypto/aesni_mb: add AES CCM 192-bit key support
  2021-09-07  9:07 [dpdk-dev] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support Radu Nicolau
@ 2021-09-07  9:07 ` Radu Nicolau
  2021-09-07  9:07 ` [dpdk-dev] [PATCH 3/3] crypto/aesni_gcm: add AES CCM support Radu Nicolau
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Radu Nicolau @ 2021-09-07  9:07 UTC (permalink / raw)
  To: Declan Doherty, Pablo de Lara; +Cc: dev, Radu Nicolau

Add support for 192 bit keys for AES CCM algorithm.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c     | 6 ++++++
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index b8ab84e215..6419aed123 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -689,6 +689,12 @@ aesni_mb_set_session_aead_parameters(const MB_MGR *mb_mgr,
 					sess->cipher.expanded_aes_keys.encode,
 					sess->cipher.expanded_aes_keys.decode);
 			break;
+		case AES_192_BYTES:
+			sess->cipher.key_length_in_bytes = AES_192_BYTES;
+			IMB_AES_KEYEXP_192(mb_mgr, xform->aead.key.data,
+					sess->cipher.expanded_aes_keys.encode,
+					sess->cipher.expanded_aes_keys.decode);
+			break;
 		case AES_256_BYTES:
 			sess->cipher.key_length_in_bytes = AES_256_BYTES;
 			IMB_AES_KEYEXP_256(mb_mgr, xform->aead.key.data,
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
index ebf75198ae..5b89be04fb 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
@@ -402,7 +402,7 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 					.min = 16,
 #if IMB_VERSION(0, 54, 2) <= IMB_VERSION_NUM
 					.max = 32,
-					.increment = 16
+					.increment = 8
 #else
 					.max = 16,
 					.increment = 0
-- 
2.25.1


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

* [dpdk-dev] [PATCH 3/3] crypto/aesni_gcm: add AES CCM support
  2021-09-07  9:07 [dpdk-dev] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support Radu Nicolau
  2021-09-07  9:07 ` [dpdk-dev] [PATCH 2/3] crypto/aesni_mb: add AES CCM 192-bit key support Radu Nicolau
@ 2021-09-07  9:07 ` Radu Nicolau
  2021-10-08 12:21 ` [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support Akhil Goyal
  2022-02-21 13:39 ` [PATCH v2] crypto/ipsec_mb: add NULL/NULL support to aesni-mb Fan Zhang
  3 siblings, 0 replies; 9+ messages in thread
From: Radu Nicolau @ 2021-09-07  9:07 UTC (permalink / raw)
  To: Declan Doherty, Pablo de Lara; +Cc: dev, Radu Nicolau

Add support for AES CCM.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c     |  8 +++---
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 30 ++++++++++++++++++++
 2 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 886e2a5aaa..ee36b36f42 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -73,13 +73,13 @@ aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *gcm_ops,
 		key = auth_xform->auth.key.data;
 		sess->req_digest_length = auth_xform->auth.digest_length;
 
-	/* AES-GCM */
+	/* AES-GCM - AES-CCM */
 	} else if (xform->type == RTE_CRYPTO_SYM_XFORM_AEAD) {
 		aead_xform = xform;
-
-		if (aead_xform->aead.algo != RTE_CRYPTO_AEAD_AES_GCM) {
+		if ((aead_xform->aead.algo != RTE_CRYPTO_AEAD_AES_GCM) &&
+		    (aead_xform->aead.algo != RTE_CRYPTO_AEAD_AES_CCM)) {
 			AESNI_GCM_LOG(ERR, "The only combined operation "
-						"supported is AES GCM");
+						"supported is AES GCM/CCM");
 			return -ENOTSUP;
 		}
 
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index 18dbc4c18c..989d42b4b7 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -66,6 +66,36 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 			}, }
 		}, }
 	},
+	{       /* AES CCM */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AEAD,
+			{.aead = {
+				.algo = RTE_CRYPTO_AEAD_AES_CCM,
+				.block_size = 16,
+				.key_size = {
+					.min = 16,
+					.max = 32,
+					.increment = 8
+				},
+				.digest_size = {
+					.min = 1,
+					.max = 16,
+					.increment = 1
+				},
+				.aad_size = {
+					.min = 0,
+					.max = 65535,
+					.increment = 1
+				},
+				.iv_size = {
+					.min = 12,
+					.max = 12,
+					.increment = 0
+				}
+			}, }
+		}, }
+	},
 	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
 };
 
-- 
2.25.1


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

* Re: [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support
  2021-09-07  9:07 [dpdk-dev] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support Radu Nicolau
  2021-09-07  9:07 ` [dpdk-dev] [PATCH 2/3] crypto/aesni_mb: add AES CCM 192-bit key support Radu Nicolau
  2021-09-07  9:07 ` [dpdk-dev] [PATCH 3/3] crypto/aesni_gcm: add AES CCM support Radu Nicolau
@ 2021-10-08 12:21 ` Akhil Goyal
  2021-10-08 12:49   ` Zhang, Roy Fan
  2022-02-21 13:39 ` [PATCH v2] crypto/ipsec_mb: add NULL/NULL support to aesni-mb Fan Zhang
  3 siblings, 1 reply; 9+ messages in thread
From: Akhil Goyal @ 2021-10-08 12:21 UTC (permalink / raw)
  To: Radu Nicolau, Declan Doherty, Pablo de Lara; +Cc: dev

> Add support for NULL/NULL xform.
> 
> Signed-off-by: Declan Doherty <declan.doherty@intel.com>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
Release notes missing.
Updates in doc/guides/cryptodevs/features/aesni_gcm.ini and
doc/guides/cryptodevs/features/aesni_mb.ini missing.


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

* Re: [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support
  2021-10-08 12:21 ` [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support Akhil Goyal
@ 2021-10-08 12:49   ` Zhang, Roy Fan
  2021-10-08 18:18     ` Akhil Goyal
  0 siblings, 1 reply; 9+ messages in thread
From: Zhang, Roy Fan @ 2021-10-08 12:49 UTC (permalink / raw)
  To: Akhil Goyal, Nicolau, Radu, Doherty, Declan, De Lara Guarch,
	Pablo, Power, Ciara
  Cc: dev

Hi Radu and Akhil

We can add  this change as a patch into http://patchwork.dpdk.org/project/dpdk/cover/20210929163035.608387-1-ciara.power@intel.com/ v4 it is ok.
The doc can be updated accordingly.

Regards,
Fan

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Akhil Goyal
> Sent: Friday, October 8, 2021 1:21 PM
> To: Nicolau, Radu <radu.nicolau@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL
> support
> 
> > Add support for NULL/NULL xform.
> >
> > Signed-off-by: Declan Doherty <declan.doherty@intel.com>
> > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> > ---
> Release notes missing.
> Updates in doc/guides/cryptodevs/features/aesni_gcm.ini and
> doc/guides/cryptodevs/features/aesni_mb.ini missing.


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

* Re: [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support
  2021-10-08 12:49   ` Zhang, Roy Fan
@ 2021-10-08 18:18     ` Akhil Goyal
  2021-10-11  8:47       ` Nicolau, Radu
  0 siblings, 1 reply; 9+ messages in thread
From: Akhil Goyal @ 2021-10-08 18:18 UTC (permalink / raw)
  To: Zhang, Roy Fan, Nicolau, Radu, Doherty, Declan, De Lara Guarch,
	Pablo, Power, Ciara
  Cc: dev

> 
> Hi Radu and Akhil
> 
> We can add  this change as a patch into
> http://patchwork.dpdk.org/project/dpdk/cover/20210929163035.608387-1-ciara.power@intel.com/  v4 it is ok.
> The doc can be updated accordingly.
> 
No issues from my side.

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

* Re: [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support
  2021-10-08 18:18     ` Akhil Goyal
@ 2021-10-11  8:47       ` Nicolau, Radu
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolau, Radu @ 2021-10-11  8:47 UTC (permalink / raw)
  To: Akhil Goyal, Zhang, Roy Fan, Doherty, Declan, De Lara Guarch,
	Pablo, Power, Ciara
  Cc: dev


On 10/8/2021 7:18 PM, Akhil Goyal wrote:
>> Hi Radu and Akhil
>>
>> We can add  this change as a patch into
>> http://patchwork.dpdk.org/project/dpdk/cover/20210929163035.608387-1-ciara.power@intel.com/  v4 it is ok.
>> The doc can be updated accordingly.
>>
> No issues from my side.
Same for my side, no issues, thanks!

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

* [PATCH v2] crypto/ipsec_mb: add NULL/NULL support to aesni-mb
  2021-09-07  9:07 [dpdk-dev] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support Radu Nicolau
                   ` (2 preceding siblings ...)
  2021-10-08 12:21 ` [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support Akhil Goyal
@ 2022-02-21 13:39 ` Fan Zhang
  2022-02-22 19:07   ` [EXT] " Akhil Goyal
  3 siblings, 1 reply; 9+ messages in thread
From: Fan Zhang @ 2022-02-21 13:39 UTC (permalink / raw)
  To: dev; +Cc: gakhil, Fan Zhang, Declan Doherty, Radu Nicolau

Add NULL cipher and auth support to AESNI-MB PMD type.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
v2:
- Added actual PMD support.

 drivers/crypto/ipsec_mb/pmd_aesni_mb.c      | 18 ++++++++++
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 37 +++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index a308d42ffa..0111c6f540 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -88,6 +88,12 @@ aesni_mb_set_session_auth_parameters(const IMB_MGR *mb_mgr,
 	sess->auth.operation = xform->auth.op;
 
 	/* Set Authentication Parameters */
+	if (xform->auth.algo == RTE_CRYPTO_AUTH_NULL) {
+		sess->auth.algo = IMB_AUTH_NULL;
+		sess->auth.gen_digest_len = 0;
+		return 0;
+	}
+
 	if (xform->auth.algo == RTE_CRYPTO_AUTH_AES_XCBC_MAC) {
 		sess->auth.algo = IMB_AUTH_AES_XCBC;
 
@@ -434,6 +440,12 @@ aesni_mb_set_session_cipher_parameters(const IMB_MGR *mb_mgr,
 		sess->cipher.mode = IMB_CIPHER_KASUMI_UEA1_BITLEN;
 		is_kasumi = 1;
 		break;
+	case RTE_CRYPTO_CIPHER_NULL:
+		sess->cipher.mode = IMB_CIPHER_NULL;
+		sess->cipher.key_length_in_bytes = 0;
+		sess->iv.offset = xform->cipher.iv.offset;
+		sess->iv.length = xform->cipher.iv.length;
+		return 0;
 	default:
 		IPSEC_MB_LOG(ERR, "Unsupported cipher mode parameter");
 		return -ENOTSUP;
@@ -1324,6 +1336,12 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
 			session->iv.offset);
 	}
 
+	if (job->cipher_mode == IMB_CIPHER_NULL && oop) {
+		memcpy(job->dst + job->cipher_start_src_offset_in_bytes,
+			job->src + job->cipher_start_src_offset_in_bytes,
+			job->msg_len_to_cipher_in_bytes);
+	}
+
 	if (job->cipher_mode == IMB_CIPHER_ZUC_EEA3)
 		job->msg_len_to_cipher_in_bytes >>= 3;
 	else if (job->hash_alg == IMB_AUTH_KASUMI_UIA1)
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
index d37cc787a0..f46037ff76 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
@@ -275,6 +275,43 @@ static const struct rte_cryptodev_capabilities aesni_mb_capabilities[] = {
 			}, }
 		}, }
 	},
+	{	/* NULL (AUTH) */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			{.auth = {
+				.algo = RTE_CRYPTO_AUTH_NULL,
+				.block_size = 1,
+				.key_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				},
+				.digest_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				},
+				.iv_size = { 0 }
+			}, },
+		}, },
+	},
+	{	/* NULL (CIPHER) */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_NULL,
+				.block_size = 1,
+				.key_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				},
+				.iv_size = { 0 }
+			}, },
+		}, }
+	},
 	{	/* AES CBC */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {
-- 
2.25.1


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

* RE: [EXT] [PATCH v2] crypto/ipsec_mb: add NULL/NULL support to aesni-mb
  2022-02-21 13:39 ` [PATCH v2] crypto/ipsec_mb: add NULL/NULL support to aesni-mb Fan Zhang
@ 2022-02-22 19:07   ` Akhil Goyal
  0 siblings, 0 replies; 9+ messages in thread
From: Akhil Goyal @ 2022-02-22 19:07 UTC (permalink / raw)
  To: Fan Zhang, dev; +Cc: Declan Doherty, Radu Nicolau

> Add NULL cipher and auth support to AESNI-MB PMD type.
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> Signed-off-by: Declan Doherty <declan.doherty@intel.com>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
Applied to dpdk-next-crypto

Thanks.

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

end of thread, other threads:[~2022-02-22 19:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  9:07 [dpdk-dev] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support Radu Nicolau
2021-09-07  9:07 ` [dpdk-dev] [PATCH 2/3] crypto/aesni_mb: add AES CCM 192-bit key support Radu Nicolau
2021-09-07  9:07 ` [dpdk-dev] [PATCH 3/3] crypto/aesni_gcm: add AES CCM support Radu Nicolau
2021-10-08 12:21 ` [dpdk-dev] [EXT] [PATCH 1/3] crypto/aesni_mb: add NULL/NULL support Akhil Goyal
2021-10-08 12:49   ` Zhang, Roy Fan
2021-10-08 18:18     ` Akhil Goyal
2021-10-11  8:47       ` Nicolau, Radu
2022-02-21 13:39 ` [PATCH v2] crypto/ipsec_mb: add NULL/NULL support to aesni-mb Fan Zhang
2022-02-22 19:07   ` [EXT] " Akhil Goyal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.