test/crypto: set null cipher IV length to zero
authorAnkur Dwivedi <adwivedi@marvell.com>
Wed, 6 May 2020 09:37:26 +0000 (15:07 +0530)
committerAkhil Goyal <akhil.goyal@nxp.com>
Mon, 11 May 2020 11:17:43 +0000 (13:17 +0200)
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>
app/test/test_cryptodev_blockcipher.c

index 473dad9..909b615 100644 (file)
@@ -379,7 +379,11 @@ iterate:
                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 -