diff mbox

[dpdk-dev] crypto/dpaa_sec: remove memset of icv on decryption side

Message ID 20171012130726.4332-3-alok.makhariya@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

alok.makhariya@nxp.com Oct. 12, 2017, 1:07 p.m. UTC
From: Alok Makhariya <alok.makhariya@nxp.com>

Since the packet lengths are modified. It is not required to
explicitly reset the icv.
Fixes: 89aaf708d44b ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
---
 drivers/crypto/dpaa_sec/dpaa_sec.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Akhil Goyal Oct. 13, 2017, 2:22 p.m. UTC | #1
On 10/12/2017 6:37 PM, alok.makhariya@nxp.com wrote:
> From: Alok Makhariya <alok.makhariya@nxp.com>
> 
> Since the packet lengths are modified. It is not required to
> explicitly reset the icv.
> Fixes: 89aaf708d44b ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
> 
> Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
> ---
>   drivers/crypto/dpaa_sec/dpaa_sec.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
> index 8a57b96..b618b59 100644
> --- a/drivers/crypto/dpaa_sec/dpaa_sec.c
> +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
> @@ -598,7 +598,6 @@ build_auth_only(struct rte_crypto_op *op, dpaa_sec_session *ses)
>   		/* hash result or digest, save digest first */
>   		rte_memcpy(old_digest, sym->auth.digest.data,
>   			   ses->digest_length);
> -		memset(sym->auth.digest.data, 0, ses->digest_length);
>   		qm_sg_entry_set64(sg, start_addr + sym->auth.data.offset);
>   		sg->length = sym->auth.data.length;
>   		cpu_to_hw_sg(sg);
> @@ -738,7 +737,6 @@ build_cipher_auth_gcm(struct rte_crypto_op *op, dpaa_sec_session *ses)
>   
>   		memcpy(ctx->digest, sym->aead.digest.data,
>   		       ses->digest_length);
> -		memset(sym->aead.digest.data, 0, ses->digest_length);
>   		sg++;
>   
>   		qm_sg_entry_set64(sg, dpaa_mem_vtop(ctx->digest));
> @@ -832,7 +830,6 @@ build_cipher_auth(struct rte_crypto_op *op, dpaa_sec_session *ses)
>   
>   		memcpy(ctx->digest, sym->auth.digest.data,
>   		       ses->digest_length);
> -		memset(sym->auth.digest.data, 0, ses->digest_length);
>   		sg++;
>   
>   		qm_sg_entry_set64(sg, dpaa_mem_vtop(ctx->digest));
> 
Acked-by Akhil Goyal <akhil.goyal@nxp.com>
De Lara Guarch, Pablo Oct. 16, 2017, 11:21 a.m. UTC | #2
> -----Original Message-----

> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]

> Sent: Friday, October 13, 2017 3:23 PM

> To: alok.makhariya@nxp.com; dev@dpdk.org

> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;

> hemant.agrawal@nxp.com

> Subject: Re: [PATCH] crypto/dpaa_sec: remove memset of icv on decryption

> side

> 

> On 10/12/2017 6:37 PM, alok.makhariya@nxp.com wrote:

> > From: Alok Makhariya <alok.makhariya@nxp.com>

> >

> > Since the packet lengths are modified. It is not required to

> > explicitly reset the icv.

> > Fixes: 89aaf708d44b ("crypto/dpaa_sec: add crypto driver for NXP DPAA

> > platform")

> >

> > Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>


...

> Acked-by Akhil Goyal <akhil.goyal@nxp.com>


Applied to dpdk-next-crypto.
Thanks,

Pablo
diff mbox

Patch

diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 8a57b96..b618b59 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -598,7 +598,6 @@  build_auth_only(struct rte_crypto_op *op, dpaa_sec_session *ses)
 		/* hash result or digest, save digest first */
 		rte_memcpy(old_digest, sym->auth.digest.data,
 			   ses->digest_length);
-		memset(sym->auth.digest.data, 0, ses->digest_length);
 		qm_sg_entry_set64(sg, start_addr + sym->auth.data.offset);
 		sg->length = sym->auth.data.length;
 		cpu_to_hw_sg(sg);
@@ -738,7 +737,6 @@  build_cipher_auth_gcm(struct rte_crypto_op *op, dpaa_sec_session *ses)
 
 		memcpy(ctx->digest, sym->aead.digest.data,
 		       ses->digest_length);
-		memset(sym->aead.digest.data, 0, ses->digest_length);
 		sg++;
 
 		qm_sg_entry_set64(sg, dpaa_mem_vtop(ctx->digest));
@@ -832,7 +830,6 @@  build_cipher_auth(struct rte_crypto_op *op, dpaa_sec_session *ses)
 
 		memcpy(ctx->digest, sym->auth.digest.data,
 		       ses->digest_length);
-		memset(sym->auth.digest.data, 0, ses->digest_length);
 		sg++;
 
 		qm_sg_entry_set64(sg, dpaa_mem_vtop(ctx->digest));