diff mbox

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

Message ID 20171012130726.4332-4-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: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR")
Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org

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

Comments

Akhil Goyal Oct. 13, 2017, 2:24 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: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR")
> Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
> ---
>   drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> index 9895300..62b9203 100644
> --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> @@ -203,7 +203,6 @@ build_authenc_gcm_fd(dpaa2_sec_session *sess,
>   		old_icv = (uint8_t *)(sge + 1);
>   		memcpy(old_icv,	sym_op->aead.digest.data,
>   		       sess->digest_length);
> -		memset(sym_op->aead.digest.data, 0, sess->digest_length);
>   		DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_icv));
>   		sge->length = sess->digest_length;
>   		DPAA2_SET_FD_LEN(fd, (sym_op->aead.data.length +
> @@ -342,7 +341,6 @@ build_authenc_fd(dpaa2_sec_session *sess,
>   		old_icv = (uint8_t *)(sge + 1);
>   		memcpy(old_icv,	sym_op->auth.digest.data,
>   		       sess->digest_length);
> -		memset(sym_op->auth.digest.data, 0, sess->digest_length);
>   		DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_icv));
>   		sge->length = sess->digest_length;
>   		DPAA2_SET_FD_LEN(fd, (sym_op->auth.data.length +
> @@ -436,7 +434,6 @@ build_auth_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
>   		old_digest = (uint8_t *)(sge + 1);
>   		rte_memcpy(old_digest, sym_op->auth.digest.data,
>   			   sess->digest_length);
> -		memset(sym_op->auth.digest.data, 0, sess->digest_length);
>   		DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_digest));
>   		sge->length = sess->digest_length;
>   		fle->length = sym_op->auth.data.length +
> 

 >
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Pablo de Lara 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:24 PM

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

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

> hemant.agrawal@nxp.com; stable@dpdk.org

> Subject: Re: [PATCH] crypto/dpaa2_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: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR")

> > Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")

> > Cc: stable@dpdk.org

> >

> > 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/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 9895300..62b9203 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -203,7 +203,6 @@  build_authenc_gcm_fd(dpaa2_sec_session *sess,
 		old_icv = (uint8_t *)(sge + 1);
 		memcpy(old_icv,	sym_op->aead.digest.data,
 		       sess->digest_length);
-		memset(sym_op->aead.digest.data, 0, sess->digest_length);
 		DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_icv));
 		sge->length = sess->digest_length;
 		DPAA2_SET_FD_LEN(fd, (sym_op->aead.data.length +
@@ -342,7 +341,6 @@  build_authenc_fd(dpaa2_sec_session *sess,
 		old_icv = (uint8_t *)(sge + 1);
 		memcpy(old_icv,	sym_op->auth.digest.data,
 		       sess->digest_length);
-		memset(sym_op->auth.digest.data, 0, sess->digest_length);
 		DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_icv));
 		sge->length = sess->digest_length;
 		DPAA2_SET_FD_LEN(fd, (sym_op->auth.data.length +
@@ -436,7 +434,6 @@  build_auth_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
 		old_digest = (uint8_t *)(sge + 1);
 		rte_memcpy(old_digest, sym_op->auth.digest.data,
 			   sess->digest_length);
-		memset(sym_op->auth.digest.data, 0, sess->digest_length);
 		DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_digest));
 		sge->length = sess->digest_length;
 		fle->length = sym_op->auth.data.length +