crypto/aesni_mb: add NULL/NULL support
PATCH 1/3 crypto/aesni_mb: add NULL/NULL support
Add support for NULL/NULL xform.
--- 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(+)
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +3 -0
@@ -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 ;
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +38 -0
@@ -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,
Signature · 1 line
2.25.1
PATCH 2/3 crypto/aesni_mb: add AES CCM 192-bit key support
Add support for 192 bit keys for AES CCM algorithm.
--- 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(-)
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +6 -0
@@ -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,
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +1 -1
@@ -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
Signature · 1 line
2.25.1
PATCH 3/3 crypto/aesni_gcm: add AES CCM support
In reply to Radu NicolauAdd support for AES CCM.
--- 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(-)
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +4 -4
@@ -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 ; }
drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c +30 -0
@@ -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 () };
Signature · 1 line
2.25.1
Quoted 5 lines
Add support for NULL/NULL xform.
Signed-off-by Declan Doherty <[email protected]>Signed-off-by Radu Nicolau <[email protected]>---
Release notes missing.
Updates in doc/guides/cryptodevs/features/aesni_gcm.ini and doc/guides/cryptodevs/features/aesni_mb.ini missing.
Hi Radu and Akhil
We can add this change as a patch into http://patchwork.dpdk.org/project/dpdk/cover/[email protected]/ v4 it is ok. The doc can be updated accordingly.
Regards,
Fan
Quoted 18 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Akhil Goyal
Sent: Friday, October 8, 2021 1:21 PM
To: Nicolau, Radu <[email protected]>; Doherty, Declan <[email protected]>; De Lara Guarch, Pablo <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [EXT] [PATCH 1/3]crypto/aesni_mb: add NULL/NULL supportQuoted 5 lines
Add support for NULL/NULL xform.
Signed-off-by Declan Doherty <[email protected]>Signed-off-by Radu Nicolau <[email protected]>---
Release notes missing.
Updates in doc/guides/cryptodevs/features/aesni_gcm.ini and doc/guides/cryptodevs/features/aesni_mb.ini missing.
Quoted 7 lines
Hi Radu and Akhil
We can add this change as a patch into
http://patchwork.dpdk.org/project/dpdk/cover/[email protected]/ v4 it is ok. The doc can be updated accordingly.
No issues from my side.
Quoted 7 lines · Akhil Goyal
Quoted 6 lines
Hi Radu and Akhil
We can add this change as a patch into
http://patchwork.dpdk.org/project/dpdk/cover/[email protected]/ v4 it is ok. The doc can be updated accordingly.No issues from my side.
Same for my side, no issues, thanks!
PATCH v2 1/1 crypto/ipsec_mb: add NULL/NULL support to aesni-mb
In reply to Radu NicolauAdd NULL cipher and auth support to AESNI-MB PMD type.
---
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(+)
drivers/crypto/ipsec_mb/pmd_aesni_mb.c +18 -0
@@ -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 )
drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h +37 -0
@@ -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 = {
Signature · 1 line
2.25.1
Akhil Goyal
AppliedRE: [EXT] [PATCH v2] crypto/ipsec_mb: add NULL/NULL support to aesni-mb
Quoted 6 lines
Add NULL cipher and auth support to AESNI-MB PMD type.
Signed-off-by Fan Zhang <[email protected]>Signed-off-by Declan Doherty <[email protected]>Signed-off-by Radu Nicolau <[email protected]>---
Applied to dpdk-next-crypto
Thanks.