diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2023-07-04 11:04:20 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2023-07-10 13:08:12 +0300 |
commit | 95e4221faad20a71c4a1a93f626322cc747ec5ed (patch) | |
tree | 9accb131895c5ffcf72e20dad5866e3d3eebbec7 | |
parent | 310d4e8d227e6abaa46eec903d0b05ded0cd241d (diff) |
validation: crypto: test null alg packet data copying with OOP
Add null algorithms in the cipher+auth combination tests and do not
zero their range before crypto operation to check that the data copying
done by the OOP operation is done like with other algorithms.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
-rw-r--r-- | test/validation/api/crypto/crypto_op_test.c | 13 | ||||
-rw-r--r-- | test/validation/api/crypto/odp_crypto_test_inp.c | 4 |
2 files changed, 5 insertions, 12 deletions
diff --git a/test/validation/api/crypto/crypto_op_test.c b/test/validation/api/crypto/crypto_op_test.c index 33c9ab9f2..b54300c84 100644 --- a/test/validation/api/crypto/crypto_op_test.c +++ b/test/validation/api/crypto/crypto_op_test.c @@ -178,7 +178,6 @@ static void prepare_crypto_ranges(const crypto_op_test_param_t *param, odp_packet_data_range_t *cipher_range, odp_packet_data_range_t *auth_range) { - odp_packet_data_range_t zero_range = {.offset = 0, .length = 0}; uint32_t c_scale = param->session.cipher_range_in_bits ? 8 : 1; uint32_t a_scale = param->session.auth_range_in_bits ? 8 : 1; @@ -186,11 +185,6 @@ static void prepare_crypto_ranges(const crypto_op_test_param_t *param, *auth_range = param->auth_range; cipher_range->offset += c_scale * param->header_len; auth_range->offset += a_scale * param->header_len; - - if (param->ref->cipher == ODP_CIPHER_ALG_NULL) - *cipher_range = zero_range; - if (param->ref->auth == ODP_AUTH_ALG_NULL) - *auth_range = zero_range; } static int prepare_input_packet(const crypto_op_test_param_t *param, @@ -391,13 +385,10 @@ static void prepare_expected_data(const crypto_op_test_param_t *param, auth_offset /= 8; auth_len = (auth_len + 7) / 8; } - if (param->ref->cipher == ODP_CIPHER_ALG_NULL) - cipher_len = 0; - if (param->ref->auth == ODP_AUTH_ALG_NULL || - param->ref->auth == ODP_AUTH_ALG_AES_GCM || + if (param->ref->auth == ODP_AUTH_ALG_AES_GCM || param->ref->auth == ODP_AUTH_ALG_AES_CCM || param->ref->auth == ODP_AUTH_ALG_CHACHA20_POLY1305) { - /* auth range is ignored with null and AEAD algorithms */ + /* auth range is ignored with AEAD algorithms */ auth_len = 0; } diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 85e9d067f..0cc01b8e4 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -714,6 +714,7 @@ static void test_auth_hash_in_auth_range(odp_auth_alg_t auth, * Cipher algorithms that are not AEAD algorithms */ static odp_cipher_alg_t cipher_algs[] = { + ODP_CIPHER_ALG_NULL, ODP_CIPHER_ALG_DES, ODP_CIPHER_ALG_3DES_CBC, ODP_CIPHER_ALG_3DES_ECB, @@ -729,10 +730,11 @@ static odp_cipher_alg_t cipher_algs[] = { }; /* - * Authentication algorithms and hashes that use auth_range + * Authentication algorithms and hashes that may use auth_range * parameter. AEAD algorithms are excluded. */ static odp_auth_alg_t auth_algs[] = { + ODP_AUTH_ALG_NULL, ODP_AUTH_ALG_MD5_HMAC, ODP_AUTH_ALG_SHA1_HMAC, ODP_AUTH_ALG_SHA224_HMAC, |