[dpdk-dev] [PATCH] app/test: set null cipher iv length to zero
Ankur Dwivedi
adwivedi at marvell.com
Wed May 6 11:37:26 CEST 2020
For null cipher the iv length should be set to zero.
Signed-off-by: Ankur Dwivedi <adwivedi at marvell.com>
---
app/test/test_cryptodev_blockcipher.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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 -
--
1.9.3
More information about the dev
mailing list