test/crypto: 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>
This commit is contained in:
Ankur Dwivedi 2020-05-06 15:07:26 +05:30 committed by Akhil Goyal
parent 2eaf352d3d
commit d954825a24

View File

@ -379,7 +379,11 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
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 -