NULL cipher is used for validating auth only cases. With NULL cipher,
validating plain text should not be done as the PMD is only expected
to update auth data.
Fixes:
e847fc512817 ("test/crypto: add encrypted digest case for AES-CTR-CMAC")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
tdata->digest_enc.len);
}
tdata->digest_enc.len);
}
- /* Validate obuf */
- if (verify) {
- TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
- plaintext,
- tdata->plaintext.data,
- tdata->plaintext.len_bits >> 3,
- "Plaintext data not as expected");
- } else {
- TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
- ciphertext,
- tdata->ciphertext.data,
- tdata->validDataLen.len_bits,
- "Ciphertext data not as expected");
-
TEST_ASSERT_BUFFERS_ARE_EQUAL(
ut_params->digest,
tdata->digest_enc.data,
TEST_ASSERT_BUFFERS_ARE_EQUAL(
ut_params->digest,
tdata->digest_enc.data,
- DIGEST_BYTE_LENGTH_SNOW3G_UIA2,
"Generated auth tag not as expected");
}
"Generated auth tag not as expected");
}
+ if (tdata->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
+ if (verify) {
+ TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+ plaintext,
+ tdata->plaintext.data,
+ tdata->plaintext.len_bits >> 3,
+ "Plaintext data not as expected");
+ } else {
+ TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+ ciphertext,
+ tdata->ciphertext.data,
+ tdata->validDataLen.len_bits,
+ "Ciphertext data not as expected");
+ }
+ }
+
TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
"crypto op processing failed");
TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
"crypto op processing failed");
tdata->digest_enc.data, tdata->digest_enc.len);
}
tdata->digest_enc.data, tdata->digest_enc.len);
}
- /* Validate obuf */
- if (verify) {
- TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
- plaintext,
- tdata->plaintext.data,
- tdata->plaintext.len_bits >> 3,
- "Plaintext data not as expected");
- } else {
- TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
- ciphertext,
- tdata->ciphertext.data,
- tdata->validDataLen.len_bits,
- "Ciphertext data not as expected");
TEST_ASSERT_BUFFERS_ARE_EQUAL(
digest,
tdata->digest_enc.data,
TEST_ASSERT_BUFFERS_ARE_EQUAL(
digest,
tdata->digest_enc.data,
"Generated auth tag not as expected");
}
"Generated auth tag not as expected");
}
+ if (tdata->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
+ if (verify) {
+ TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+ plaintext,
+ tdata->plaintext.data,
+ tdata->plaintext.len_bits >> 3,
+ "Plaintext data not as expected");
+ } else {
+ TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+ ciphertext,
+ tdata->ciphertext.data,
+ tdata->validDataLen.len_bits,
+ "Ciphertext data not as expected");
+ }
+ }
+
TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
"crypto op processing failed");
TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
"crypto op processing failed");