Copy the expected digest at the end of the plaintext
to validate Auth decode functions

Signed-off-by: Nicolas Morey-Chaisemartin <nmo...@kalray.eu>
---
 test/validation/crypto/odp_crypto_test_inp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/test/validation/crypto/odp_crypto_test_inp.c 
b/test/validation/crypto/odp_crypto_test_inp.c
index b6fcb12..dc3ee52 100644
--- a/test/validation/crypto/odp_crypto_test_inp.c
+++ b/test/validation/crypto/odp_crypto_test_inp.c
@@ -81,6 +81,11 @@ static void alg_test(odp_crypto_op_t op,
        memcpy(data_addr, plaintext, plaintext_len);
        int data_off = 0;
 
+       if (op == ODP_CRYPTO_OP_DECODE && auth_alg != ODP_AUTH_ALG_NULL) {
+               /* Copy the digest at the end of the message */
+               memcpy(data_addr + plaintext_len, digest, digest_len);
+       }
+
        /* Prepare input/output params */
        odp_crypto_op_params_t op_params;
        memset(&op_params, 0, sizeof(op_params));
-- 
2.6.3.372.gcb93895


_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to