aboutsummaryrefslogtreecommitdiff
path: root/test/validation
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2021-09-23 11:25:46 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2021-09-29 10:26:59 +0300
commitf9c411151743ee11200483812757b55475d591b1 (patch)
treeeff011b931af3abd2c33aa50d2774f2dde4c27a5 /test/validation
parente9e646a1b22cacd8f49ad3009a9b4f854ac6e125 (diff)
crypto: fix crypto and auth range offset in bit mode
In bit mode the crypto and auth ranges are supposed to be given in bits, not in bytes. Fix the linux-gen implementation that interpreted crypto and auth offset in bytes in AES EEA2 and AES EIA2, respectively. Fix crypto validation test to provide the offsets in bits as specified by the API. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Diffstat (limited to 'test/validation')
-rw-r--r--test/validation/api/crypto/odp_crypto_test_inp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c
index b7a09b5e7..06ece9f50 100644
--- a/test/validation/api/crypto/odp_crypto_test_inp.c
+++ b/test/validation/api/crypto/odp_crypto_test_inp.c
@@ -482,10 +482,13 @@ static void alg_test_execute(const alg_test_param_t *param)
auth_range.offset = param->header_len;
auth_range.length = ref->length;
- if (param->bit_mode)
+ if (param->bit_mode) {
reflength = (ref->length + 7) / 8;
- else
+ cipher_range.offset *= 8;
+ auth_range.offset *= 8;
+ } else {
reflength = ref->length;
+ }
for (iteration = NORMAL_TEST; iteration < MAX_TEST; iteration++) {
odp_packet_t pkt;