NULL cipher is used for validating auth only cases. With out of place
processing, validating plain text should not be done as the PMD is only
expected to update auth data.

Signed-off-by: Anoob Joseph <ano...@marvell.com>
---
 app/test/test_cryptodev.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index e54a1a9..964f44f 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -7490,6 +7490,22 @@ test_mixed_auth_cipher(const struct 
mixed_cipher_auth_test_data *tdata,
                                tdata->digest_enc.len);
        }
 
+       /*
+        * NULL cipher is used for auth only cases where only authentication
+        * is done. With verify operation, MAC would be validated by the PMD.
+        * With generate operation, verify MAC generated by the PMD.
+        */
+       if (op_mode == OUT_OF_PLACE &&
+           tdata->cipher_algo == RTE_CRYPTO_CIPHER_NULL) {
+               if (!verify)
+                       TEST_ASSERT_BUFFERS_ARE_EQUAL(
+                                       ut_params->digest,
+                                       tdata->digest_enc.data,
+                                       tdata->digest_enc.len,
+                                       "Generated auth tag not as expected");
+               goto op_status_check;
+       }
+
        /* Validate obuf */
        if (verify) {
                TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
@@ -7511,6 +7527,7 @@ test_mixed_auth_cipher(const struct 
mixed_cipher_auth_test_data *tdata,
                                "Generated auth tag not as expected");
        }
 
+op_status_check:
        TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
                        "crypto op processing failed");
 
-- 
2.7.4

Reply via email to