DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] crypto/aesni_mb: fix DOCSIS AES-256
@ 2020-04-21 13:22 Pablo de Lara
  2020-04-21 13:33 ` De Lara Guarch, Pablo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pablo de Lara @ 2020-04-21 13:22 UTC (permalink / raw)
  To: declan.doherty, mairtin.oloingsigh; +Cc: dev, Pablo de Lara

When adding support for DOCSIS AES-256,
when setting the cipher parameters, all key sizes
were accepted, but only 128-bit and 256-bit keys
are.

Fixes: 124d04b43743 ("crypto/aesni_mb: support DOCSIS AES-256")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 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 a1d59e8..5ff6a79 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -381,6 +381,7 @@ aesni_mb_set_session_cipher_parameters(const MB_MGR *mb_mgr,
 {
 	uint8_t is_aes = 0;
 	uint8_t is_3DES = 0;
+	uint8_t is_docsis = 0;
 
 	if (xform == NULL) {
 		sess->cipher.mode = NULL_CIPHER;
@@ -417,7 +418,7 @@ aesni_mb_set_session_cipher_parameters(const MB_MGR *mb_mgr,
 		break;
 	case RTE_CRYPTO_CIPHER_AES_DOCSISBPI:
 		sess->cipher.mode = DOCSIS_SEC_BPI;
-		is_aes = 1;
+		is_docsis = 1;
 		break;
 	case RTE_CRYPTO_CIPHER_DES_CBC:
 		sess->cipher.mode = DES;
@@ -463,6 +464,26 @@ aesni_mb_set_session_cipher_parameters(const MB_MGR *mb_mgr,
 			AESNI_MB_LOG(ERR, "Invalid cipher key length");
 			return -EINVAL;
 		}
+	} else if (is_docsis) {
+		switch (xform->cipher.key.length) {
+		case AES_128_BYTES:
+			sess->cipher.key_length_in_bytes = AES_128_BYTES;
+			IMB_AES_KEYEXP_128(mb_mgr, xform->cipher.key.data,
+					sess->cipher.expanded_aes_keys.encode,
+					sess->cipher.expanded_aes_keys.decode);
+			break;
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		case AES_256_BYTES:
+			sess->cipher.key_length_in_bytes = AES_256_BYTES;
+			IMB_AES_KEYEXP_256(mb_mgr, xform->cipher.key.data,
+					sess->cipher.expanded_aes_keys.encode,
+					sess->cipher.expanded_aes_keys.decode);
+			break;
+#endif
+		default:
+			AESNI_MB_LOG(ERR, "Invalid cipher key length");
+			return -EINVAL;
+		}
 	} else if (is_3DES) {
 		uint64_t *keys[3] = {sess->cipher.exp_3des_keys.key[0],
 				sess->cipher.exp_3des_keys.key[1],
-- 
2.7.5


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

* Re: [dpdk-dev] [PATCH] crypto/aesni_mb: fix DOCSIS AES-256
  2020-04-21 13:22 [dpdk-dev] [PATCH] crypto/aesni_mb: fix DOCSIS AES-256 Pablo de Lara
@ 2020-04-21 13:33 ` De Lara Guarch, Pablo
  2020-04-22  9:52 ` O'loingsigh, Mairtin
  2020-04-23 13:46 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
  2 siblings, 0 replies; 5+ messages in thread
From: De Lara Guarch, Pablo @ 2020-04-21 13:33 UTC (permalink / raw)
  To: Doherty, Declan, O'loingsigh, Mairtin; +Cc: dev

Hi Akhil,

> -----Original Message-----
> From: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Sent: Tuesday, April 21, 2020 2:22 PM
> To: Doherty, Declan <declan.doherty@intel.com>; O'loingsigh, Mairtin
> <mairtin.oloingsigh@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [PATCH] crypto/aesni_mb: fix DOCSIS AES-256
> 
> When adding support for DOCSIS AES-256,
> when setting the cipher parameters, all key sizes were accepted, but only 128-bit
> and 256-bit keys are.
> 
> Fixes: 124d04b43743 ("crypto/aesni_mb: support DOCSIS AES-256")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

This can be merged to the commit above before RC1 is out, if there is still time.

Thanks,
Pablo


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

* Re: [dpdk-dev] [PATCH] crypto/aesni_mb: fix DOCSIS AES-256
  2020-04-21 13:22 [dpdk-dev] [PATCH] crypto/aesni_mb: fix DOCSIS AES-256 Pablo de Lara
  2020-04-21 13:33 ` De Lara Guarch, Pablo
@ 2020-04-22  9:52 ` O'loingsigh, Mairtin
  2020-04-23 13:46 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
  2 siblings, 0 replies; 5+ messages in thread
From: O'loingsigh, Mairtin @ 2020-04-22  9:52 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, Doherty, Declan; +Cc: dev



-----Original Message-----
From: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com> 
Sent: Tuesday, April 21, 2020 2:22 PM
To: Doherty, Declan <declan.doherty@intel.com>; O'loingsigh, Mairtin <mairtin.oloingsigh@intel.com>
Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
Subject: [PATCH] crypto/aesni_mb: fix DOCSIS AES-256

When adding support for DOCSIS AES-256,
when setting the cipher parameters, all key sizes were accepted, but only 128-bit and 256-bit keys are.

Fixes: 124d04b43743 ("crypto/aesni_mb: support DOCSIS AES-256")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>


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

* [dpdk-dev] [PATCH v2] crypto/aesni_mb: fix DOCSIS AES-256
  2020-04-21 13:22 [dpdk-dev] [PATCH] crypto/aesni_mb: fix DOCSIS AES-256 Pablo de Lara
  2020-04-21 13:33 ` De Lara Guarch, Pablo
  2020-04-22  9:52 ` O'loingsigh, Mairtin
@ 2020-04-23 13:46 ` Pablo de Lara
  2020-05-09 21:49   ` Akhil Goyal
  2 siblings, 1 reply; 5+ messages in thread
From: Pablo de Lara @ 2020-04-23 13:46 UTC (permalink / raw)
  To: declan.doherty; +Cc: akhil.goyal, dev, Pablo de Lara

When adding support for DOCSIS AES-256,
when setting the cipher parameters, all key sizes
were accepted, but only 128-bit and 256-bit keys
are supported.

Fixes: 124d04b43743 ("crypto/aesni_mb: support DOCSIS AES-256")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
---

v2:
- Fixed commit message (missing a word).
- Rebased on top of dpdk-next-crypto

 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 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 a1d59e8..5ff6a79 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -381,6 +381,7 @@ aesni_mb_set_session_cipher_parameters(const MB_MGR *mb_mgr,
 {
 	uint8_t is_aes = 0;
 	uint8_t is_3DES = 0;
+	uint8_t is_docsis = 0;
 
 	if (xform == NULL) {
 		sess->cipher.mode = NULL_CIPHER;
@@ -417,7 +418,7 @@ aesni_mb_set_session_cipher_parameters(const MB_MGR *mb_mgr,
 		break;
 	case RTE_CRYPTO_CIPHER_AES_DOCSISBPI:
 		sess->cipher.mode = DOCSIS_SEC_BPI;
-		is_aes = 1;
+		is_docsis = 1;
 		break;
 	case RTE_CRYPTO_CIPHER_DES_CBC:
 		sess->cipher.mode = DES;
@@ -463,6 +464,26 @@ aesni_mb_set_session_cipher_parameters(const MB_MGR *mb_mgr,
 			AESNI_MB_LOG(ERR, "Invalid cipher key length");
 			return -EINVAL;
 		}
+	} else if (is_docsis) {
+		switch (xform->cipher.key.length) {
+		case AES_128_BYTES:
+			sess->cipher.key_length_in_bytes = AES_128_BYTES;
+			IMB_AES_KEYEXP_128(mb_mgr, xform->cipher.key.data,
+					sess->cipher.expanded_aes_keys.encode,
+					sess->cipher.expanded_aes_keys.decode);
+			break;
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		case AES_256_BYTES:
+			sess->cipher.key_length_in_bytes = AES_256_BYTES;
+			IMB_AES_KEYEXP_256(mb_mgr, xform->cipher.key.data,
+					sess->cipher.expanded_aes_keys.encode,
+					sess->cipher.expanded_aes_keys.decode);
+			break;
+#endif
+		default:
+			AESNI_MB_LOG(ERR, "Invalid cipher key length");
+			return -EINVAL;
+		}
 	} else if (is_3DES) {
 		uint64_t *keys[3] = {sess->cipher.exp_3des_keys.key[0],
 				sess->cipher.exp_3des_keys.key[1],
-- 
2.7.5


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

* Re: [dpdk-dev] [PATCH v2] crypto/aesni_mb: fix DOCSIS AES-256
  2020-04-23 13:46 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
@ 2020-05-09 21:49   ` Akhil Goyal
  0 siblings, 0 replies; 5+ messages in thread
From: Akhil Goyal @ 2020-05-09 21:49 UTC (permalink / raw)
  To: Pablo de Lara, declan.doherty; +Cc: dev

> When adding support for DOCSIS AES-256,
> when setting the cipher parameters, all key sizes
> were accepted, but only 128-bit and 256-bit keys
> are supported.
> 
> Fixes: 124d04b43743 ("crypto/aesni_mb: support DOCSIS AES-256")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Acked-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
> ---
Applied to dpdk-next-crypto

Thanks.


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

end of thread, other threads:[~2020-05-09 21:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 13:22 [dpdk-dev] [PATCH] crypto/aesni_mb: fix DOCSIS AES-256 Pablo de Lara
2020-04-21 13:33 ` De Lara Guarch, Pablo
2020-04-22  9:52 ` O'loingsigh, Mairtin
2020-04-23 13:46 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
2020-05-09 21:49   ` 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).