Skip to content

Commit

Permalink
app/crypto-perf: fix input of AEAD decrypt
Browse files Browse the repository at this point in the history
[ upstream commit 7f9816b ]

In AEAD decrypt (verify mode), test data should point to
cipher text instead of plain text

Fixes: 5b2b0a7 ("app/crypto-perf: overwrite mbuf when verifying")

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  • Loading branch information
MunigantiArchana authored and kevintraynor committed Dec 11, 2019
1 parent f34a476 commit f8b624a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/test-crypto-perf/cperf_test_verify.c
Expand Up @@ -202,11 +202,19 @@ cperf_mbuf_set(struct rte_mbuf *mbuf,
{
uint32_t segment_sz = options->segment_sz;
uint8_t *mbuf_data;
uint8_t *test_data =
(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
uint8_t *test_data;
uint32_t remaining_bytes = options->max_buffer_size;

if (options->op_type == CPERF_AEAD) {
test_data = (options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT) ?
test_vector->plaintext.data :
test_vector->ciphertext.data;
uint32_t remaining_bytes = options->max_buffer_size;
} else {
test_data =
(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
test_vector->plaintext.data :
test_vector->ciphertext.data;
}

while (remaining_bytes) {
mbuf_data = rte_pktmbuf_mtod(mbuf, uint8_t *);
Expand Down

0 comments on commit f8b624a

Please sign in to comment.