app/test: set null cipher iv length to zero

Message ID 1588757846-14349-1-git-send-email-adwivedi@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series app/test: set null cipher iv length to zero |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Ankur Dwivedi May 6, 2020, 9:37 a.m. UTC
  For null cipher the iv length should be set to zero.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_cryptodev_blockcipher.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Comments

Anoob Joseph May 7, 2020, 5:11 a.m. UTC | #1
> 
> For null cipher the iv length should be set to zero.
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>

Acked-by: Anoob Joseph <anoobj@marvell.com>
  
Fiona Trahe May 7, 2020, 10:37 a.m. UTC | #2
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Anoob Joseph
> Sent: Thursday, May 7, 2020 6:11 AM
> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
> Cc: Doherty, Declan <declan.doherty@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; akhil.goyal@nxp.com; Ankur Dwivedi <adwivedi@marvell.com>
> Subject: Re: [dpdk-dev] [PATCH] app/test: set null cipher iv length to zero
> 
> 
> >
> > For null cipher the iv length should be set to zero.
> >
> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> 
> Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
  
Akhil Goyal May 9, 2020, 10 p.m. UTC | #3
> > >
> > > For null cipher the iv length should be set to zero.
> > >
> > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> >
> > Acked-by: Anoob Joseph <anoobj@marvell.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Title should start from test/crypto:..

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c
index 473dad9..909b615 100644
--- a/app/test/test_cryptodev_blockcipher.c
+++ b/app/test/test_cryptodev_blockcipher.c
@@ -379,7 +379,11 @@ 
 		cipher_xform->cipher.key.data = cipher_key;
 		cipher_xform->cipher.key.length = tdata->cipher_key.len;
 		cipher_xform->cipher.iv.offset = IV_OFFSET;
-		cipher_xform->cipher.iv.length = tdata->iv.len;
+
+		if (tdata->crypto_algo == RTE_CRYPTO_CIPHER_NULL)
+			cipher_xform->cipher.iv.length = 0;
+		else
+			cipher_xform->cipher.iv.length = tdata->iv.len;
 
 		sym_op->cipher.data.offset = tdata->cipher_offset;
 		sym_op->cipher.data.length = tdata->ciphertext.len -