aboutsummaryrefslogtreecommitdiff
path: root/test/validation
diff options
context:
space:
mode:
Diffstat (limited to 'test/validation')
-rw-r--r--test/validation/api/crypto/odp_crypto_test_inp.c2
-rw-r--r--test/validation/api/crypto/test_vectors.h544
-rw-r--r--test/validation/api/crypto/test_vectors_len.h2
-rw-r--r--test/validation/api/init/init_main.c7
-rw-r--r--test/validation/api/ipsec/ipsec.c22
-rw-r--r--test/validation/api/ipsec/ipsec.h6
-rw-r--r--test/validation/api/ipsec/ipsec_test_in.c55
-rw-r--r--test/validation/api/ipsec/ipsec_test_out.c46
-rw-r--r--test/validation/api/ipsec/test_vectors.h57
-rw-r--r--test/validation/api/packet/packet.c161
-rw-r--r--test/validation/api/pool/pool.c1
-rw-r--r--test/validation/api/queue/queue.c4
-rw-r--r--test/validation/api/scheduler/scheduler.c11
-rw-r--r--test/validation/api/stash/stash.c178
-rw-r--r--test/validation/api/timer/timer.c2
-rw-r--r--test/validation/api/traffic_mngr/traffic_mngr.c6
16 files changed, 693 insertions, 411 deletions
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c
index 06ece9f50..a5987d2e7 100644
--- a/test/validation/api/crypto/odp_crypto_test_inp.c
+++ b/test/validation/api/crypto/odp_crypto_test_inp.c
@@ -710,6 +710,8 @@ static void check_alg(odp_crypto_op_t op,
CU_ASSERT_FATAL(cipher_num > 0);
CU_ASSERT_FATAL(auth_num > 0);
+ init_reference(ref, count);
+
odp_crypto_cipher_capability_t cipher_capa[cipher_num];
odp_crypto_auth_capability_t auth_capa[auth_num];
odp_bool_t cipher_tested[cipher_num];
diff --git a/test/validation/api/crypto/test_vectors.h b/test/validation/api/crypto/test_vectors.h
index c377a5e0a..98fbcd343 100644
--- a/test/validation/api/crypto/test_vectors.h
+++ b/test/validation/api/crypto/test_vectors.h
@@ -1,4 +1,5 @@
/* Copyright (c) 2014-2018, Linaro Limited
+ * Copyright (c) 2021, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -10,6 +11,7 @@
#include "test_vectors_len.h"
typedef struct crypto_test_reference_s {
+ uint8_t copy_previous_vector; /* does not copy digest_length */
uint32_t cipher_key_length;
uint8_t cipher_key[MAX_KEY_LEN];
uint32_t auth_key_length;
@@ -1461,6 +1463,10 @@ static crypto_test_reference_t aes_cmac_reference[] = {
0xf7, 0x9b, 0xdd, 0x9d, 0xd0, 0x4a, 0x28, 0x7c },
},
{
+ .copy_previous_vector = 1,
+ .digest_length = 12,
+ },
+ {
.auth_key_length = AES192_KEY_LEN,
.auth_key = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52,
0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5,
@@ -1476,6 +1482,10 @@ static crypto_test_reference_t aes_cmac_reference[] = {
0x06, 0x62, 0xf6, 0x5e, 0x61, 0x7c, 0x51, 0x84 },
},
{
+ .copy_previous_vector = 1,
+ .digest_length = 12,
+ },
+ {
.auth_key_length = AES256_KEY_LEN,
.auth_key = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
@@ -1492,50 +1502,9 @@ static crypto_test_reference_t aes_cmac_reference[] = {
0xbd, 0x4b, 0xf2, 0x8d, 0x8c, 0x37, 0xc3, 0x5c },
},
{
- .auth_key_length = AES128_KEY_LEN,
- .auth_key = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
- 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c },
- .length = 16,
- .plaintext = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
- 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a},
- .ciphertext = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
- 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a
- },
+ .copy_previous_vector = 1,
.digest_length = 12,
- .digest = { 0x07, 0x0a, 0x16, 0xb4, 0x6b, 0x4d, 0x41, 0x44,
- 0xf7, 0x9b, 0xdd, 0x9d },
},
- {
- .auth_key_length = AES192_KEY_LEN,
- .auth_key = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52,
- 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5,
- 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b },
- .length = 16,
- .plaintext = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
- 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a},
- .ciphertext = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
- 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a
- },
- .digest_length = 12,
- .digest = { 0x9e, 0x99, 0xa7, 0xbf, 0x31, 0xe7, 0x10, 0x90,
- 0x06, 0x62, 0xf6, 0x5e },
- },
- {
- .auth_key_length = AES256_KEY_LEN,
- .auth_key = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
- 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
- 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7,
- 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 },
- .length = 16,
- .plaintext = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
- 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a},
- .ciphertext = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
- 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a
- },
- .digest_length = 12,
- .digest = { 0x28, 0xa7, 0x02, 0x3f, 0x45, 0x2e, 0x8f, 0x82,
- 0xbd, 0x4b, 0xf2, 0x8d },
- }
};
/*
@@ -1685,65 +1654,14 @@ static crypto_test_reference_t hmac_md5_reference[] = {
/* "Hi There" */
.plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
.ciphertext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .digest_length = HMAC_MD5_96_CHECK_LEN,
+ .digest_length = HMAC_MD5_CHECK_LEN,
.digest = { 0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c,
- 0x13, 0xf4, 0x8e, 0xf8 },
-
- },
- {
- .auth_key_length = HMAC_MD5_KEY_LEN,
- /* "Jefe" */
- .auth_key = { 0x4a, 0x65, 0x66, 0x65 },
- .length = 28,
- /* what do ya want for nothing?*/
- .plaintext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .ciphertext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .digest_length = HMAC_MD5_96_CHECK_LEN,
- .digest = { 0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03,
- 0xea, 0xa8, 0x6e, 0x31 },
+ 0x13, 0xf4, 0x8e, 0xf8, 0x15, 0x8b, 0xfc, 0x9d },
},
{
- .auth_key_length = HMAC_MD5_KEY_LEN,
- .auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
- .length = 50,
- .plaintext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
- .ciphertext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
+ .copy_previous_vector = 1,
.digest_length = HMAC_MD5_96_CHECK_LEN,
- .digest = { 0x56, 0xbe, 0x34, 0x52, 0x1d, 0x14, 0x4c, 0x88,
- 0xdb, 0xb8, 0xc7, 0x33 }
- },
- {
- .auth_key_length = HMAC_MD5_KEY_LEN,
- .auth_key = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b },
- .length = 8,
- /* "Hi There" */
- .plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .ciphertext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .digest_length = HMAC_MD5_CHECK_LEN,
- .digest = { 0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c,
- 0x13, 0xf4, 0x8e, 0xf8, 0x15, 0x8b, 0xfc, 0x9d },
-
},
{
.auth_key_length = HMAC_MD5_KEY_LEN,
@@ -1765,6 +1683,10 @@ static crypto_test_reference_t hmac_md5_reference[] = {
},
{
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_MD5_96_CHECK_LEN,
+ },
+ {
.auth_key_length = HMAC_MD5_KEY_LEN,
.auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
@@ -1786,65 +1708,14 @@ static crypto_test_reference_t hmac_md5_reference[] = {
.digest_length = HMAC_MD5_CHECK_LEN,
.digest = { 0x56, 0xbe, 0x34, 0x52, 0x1d, 0x14, 0x4c, 0x88,
0xdb, 0xb8, 0xc7, 0x33, 0xf0, 0xe8, 0xb3, 0xf6 }
- }
-};
-
-static crypto_test_reference_t hmac_sha1_reference[] = {
- {
- .auth_key_length = HMAC_SHA1_KEY_LEN,
- .auth_key = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b },
- .length = 8,
- /* "Hi There" */
- .plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .ciphertext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .digest_length = HMAC_SHA1_96_CHECK_LEN,
- .digest = { 0xb6, 0x17, 0x31, 0x86, 0x55, 0x05,
- 0x72, 0x64, 0xe2, 0x8b, 0xc0, 0xb6 }
- },
- {
- .auth_key_length = HMAC_SHA1_KEY_LEN,
- /* "Jefe" */
- .auth_key = { 0x4a, 0x65, 0x66, 0x65 },
- .length = 28,
- /* what do ya want for nothing?*/
- .plaintext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .ciphertext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .digest_length = HMAC_SHA1_96_CHECK_LEN,
- .digest = { 0xef, 0xfc, 0xdf, 0x6a, 0xe5, 0xeb,
- 0x2f, 0xa2, 0xd2, 0x74, 0x16, 0xd5 }
},
{
- .auth_key_length = HMAC_SHA1_KEY_LEN,
- .auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa },
- .length = 50,
- .plaintext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
- .ciphertext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
- .digest_length = HMAC_SHA1_96_CHECK_LEN,
- .digest = { 0x12, 0x5d, 0x73, 0x42, 0xb9, 0xac,
- 0x11, 0xcd, 0x91, 0xa3, 0x9a, 0xf4 }
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_MD5_96_CHECK_LEN,
},
+};
+
+static crypto_test_reference_t hmac_sha1_reference[] = {
{
.auth_key_length = HMAC_SHA1_KEY_LEN,
.auth_key = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
@@ -1860,6 +1731,10 @@ static crypto_test_reference_t hmac_sha1_reference[] = {
0xf1, 0x46, 0xbe, 0x00 }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA1_96_CHECK_LEN,
+ },
+ {
.auth_key_length = HMAC_SHA1_KEY_LEN,
/* "Jefe" */
.auth_key = { 0x4a, 0x65, 0x66, 0x65 },
@@ -1879,6 +1754,10 @@ static crypto_test_reference_t hmac_sha1_reference[] = {
0x25, 0x9a, 0x7c, 0x79 }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA1_96_CHECK_LEN,
+ },
+ {
.auth_key_length = HMAC_SHA1_KEY_LEN,
.auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
@@ -1902,7 +1781,11 @@ static crypto_test_reference_t hmac_sha1_reference[] = {
.digest = { 0x12, 0x5d, 0x73, 0x42, 0xb9, 0xac, 0x11, 0xcd,
0x91, 0xa3, 0x9a, 0xf4, 0x8a, 0xa1, 0x7b, 0x4f,
0x63, 0xf1, 0x75, 0xd3 }
- }
+ },
+ {
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA1_96_CHECK_LEN,
+ },
};
static crypto_test_reference_t hmac_sha224_reference[] = {
@@ -1979,61 +1862,6 @@ static crypto_test_reference_t hmac_sha256_reference[] = {
/* "Hi There" */
.plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
.ciphertext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .digest_length = HMAC_SHA256_128_CHECK_LEN,
- .digest = { 0xb0, 0x34, 0x4c, 0x61, 0xd8, 0xdb, 0x38, 0x53,
- 0x5c, 0xa8, 0xaf, 0xce, 0xaf, 0x0b, 0xf1, 0x2b }
- },
- {
- .auth_key_length = HMAC_SHA256_KEY_LEN,
- /* "Jefe" */
- .auth_key = { 0x4a, 0x65, 0x66, 0x65 },
- .length = 28,
- /* what do ya want for nothing?*/
- .plaintext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .ciphertext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .digest_length = HMAC_SHA256_128_CHECK_LEN,
- .digest = { 0x5b, 0xdc, 0xc1, 0x46, 0xbf, 0x60, 0x75, 0x4e,
- 0x6a, 0x04, 0x24, 0x26, 0x08, 0x95, 0x75, 0xc7 }
- },
- {
- .auth_key_length = HMAC_SHA256_KEY_LEN,
- .auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa },
- .length = 50,
- .plaintext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
- .ciphertext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
- .digest_length = HMAC_SHA256_128_CHECK_LEN,
- .digest = { 0x77, 0x3e, 0xa9, 0x1e, 0x36, 0x80, 0x0e, 0x46,
- 0x85, 0x4d, 0xb8, 0xeb, 0xd0, 0x91, 0x81, 0xa7 }
- },
- {
- .auth_key_length = HMAC_SHA256_KEY_LEN,
- .auth_key = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b },
- .length = 8,
- /* "Hi There" */
- .plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .ciphertext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
.digest_length = HMAC_SHA256_CHECK_LEN,
.digest = { 0xb0, 0x34, 0x4c, 0x61, 0xd8, 0xdb, 0x38, 0x53,
0x5c, 0xa8, 0xaf, 0xce, 0xaf, 0x0b, 0xf1, 0x2b,
@@ -2041,6 +1869,10 @@ static crypto_test_reference_t hmac_sha256_reference[] = {
0x26, 0xe9, 0x37, 0x6c, 0x2e, 0x32, 0xcf, 0xf7 }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA256_128_CHECK_LEN,
+ },
+ {
.auth_key_length = HMAC_SHA256_KEY_LEN,
/* "Jefe" */
.auth_key = { 0x4a, 0x65, 0x66, 0x65 },
@@ -2061,6 +1893,10 @@ static crypto_test_reference_t hmac_sha256_reference[] = {
0x9d, 0xec, 0x58, 0xb9, 0x64, 0xec, 0x38, 0x43 }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA256_128_CHECK_LEN,
+ },
+ {
.auth_key_length = HMAC_SHA256_KEY_LEN,
.auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
@@ -2085,68 +1921,14 @@ static crypto_test_reference_t hmac_sha256_reference[] = {
0x85, 0x4d, 0xb8, 0xeb, 0xd0, 0x91, 0x81, 0xa7,
0x29, 0x59, 0x09, 0x8b, 0x3e, 0xf8, 0xc1, 0x22,
0xd9, 0x63, 0x55, 0x14, 0xce, 0xd5, 0x65, 0xfe }
- }
-};
-
-static crypto_test_reference_t hmac_sha384_reference[] = {
- {
- .auth_key_length = HMAC_SHA384_KEY_LEN,
- .auth_key = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b },
- .length = 8,
- /* "Hi There" */
- .plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .ciphertext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .digest_length = HMAC_SHA384_192_CHECK_LEN,
- .digest = { 0xaf, 0xd0, 0x39, 0x44, 0xd8, 0x48, 0x95, 0x62,
- 0x6b, 0x08, 0x25, 0xf4, 0xab, 0x46, 0x90, 0x7f,
- 0x15, 0xf9, 0xda, 0xdb, 0xe4, 0x10, 0x1e, 0xc6 }
},
{
- .auth_key_length = HMAC_SHA384_KEY_LEN,
- /* "Jefe" */
- .auth_key = { 0x4a, 0x65, 0x66, 0x65 },
- .length = 28,
- /* what do ya want for nothing?*/
- .plaintext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .ciphertext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .digest_length = HMAC_SHA384_192_CHECK_LEN,
- .digest = { 0xaf, 0x45, 0xd2, 0xe3, 0x76, 0x48, 0x40, 0x31,
- 0x61, 0x7f, 0x78, 0xd2, 0xb5, 0x8a, 0x6b, 0x1b,
- 0x9c, 0x7e, 0xf4, 0x64, 0xf5, 0xa0, 0x1b, 0x47 }
- },
- {
- .auth_key_length = HMAC_SHA384_KEY_LEN,
- .auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa },
- .length = 50,
- .plaintext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
- .ciphertext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
- .digest_length = HMAC_SHA384_192_CHECK_LEN,
- .digest = { 0x88, 0x06, 0x26, 0x08, 0xd3, 0xe6, 0xad, 0x8a,
- 0x0a, 0xa2, 0xac, 0xe0, 0x14, 0xc8, 0xa8, 0x6f,
- 0x0a, 0xa6, 0x35, 0xd9, 0x47, 0xac, 0x9f, 0xeb }
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA256_128_CHECK_LEN,
},
+};
+
+static crypto_test_reference_t hmac_sha384_reference[] = {
{
.auth_key_length = HMAC_SHA384_KEY_LEN,
.auth_key = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
@@ -2165,6 +1947,10 @@ static crypto_test_reference_t hmac_sha384_reference[] = {
0x4a, 0xf1, 0x52, 0xe8, 0xb2, 0xfa, 0x9c, 0xb6 }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA384_192_CHECK_LEN,
+ },
+ {
.auth_key_length = HMAC_SHA384_KEY_LEN,
/* "Jefe" */
.auth_key = { 0x4a, 0x65, 0x66, 0x65 },
@@ -2187,6 +1973,10 @@ static crypto_test_reference_t hmac_sha384_reference[] = {
0x8b, 0x32, 0x39, 0xec, 0xfa, 0xb2, 0x16, 0x49 }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA384_192_CHECK_LEN,
+ },
+ {
.auth_key_length = HMAC_SHA384_KEY_LEN,
.auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
@@ -2213,71 +2003,14 @@ static crypto_test_reference_t hmac_sha384_reference[] = {
0xe8, 0x3e, 0xf4, 0xe5, 0x59, 0x66, 0x14, 0x4b,
0x2a, 0x5a, 0xb3, 0x9d, 0xc1, 0x38, 0x14, 0xb9,
0x4e, 0x3a, 0xb6, 0xe1, 0x01, 0xa3, 0x4f, 0x27 }
- }
-};
-
-static crypto_test_reference_t hmac_sha512_reference[] = {
- {
- .auth_key_length = HMAC_SHA512_KEY_LEN,
- .auth_key = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b },
- .length = 8,
- /* "Hi There" */
- .plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .ciphertext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
- .digest_length = HMAC_SHA512_256_CHECK_LEN,
- .digest = { 0x87, 0xaa, 0x7c, 0xde, 0xa5, 0xef, 0x61, 0x9d,
- 0x4f, 0xf0, 0xb4, 0x24, 0x1a, 0x1d, 0x6c, 0xb0,
- 0x23, 0x79, 0xf4, 0xe2, 0xce, 0x4e, 0xc2, 0x78,
- 0x7a, 0xd0, 0xb3, 0x05, 0x45, 0xe1, 0x7c, 0xde }
},
{
- .auth_key_length = HMAC_SHA512_KEY_LEN,
- /* "Jefe" */
- .auth_key = { 0x4a, 0x65, 0x66, 0x65 },
- .length = 28,
- /* what do ya want for nothing?*/
- .plaintext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .ciphertext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
- 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
- 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
- 0x69, 0x6e, 0x67, 0x3f },
- .digest_length = HMAC_SHA512_256_CHECK_LEN,
- .digest = { 0x16, 0x4b, 0x7a, 0x7b, 0xfc, 0xf8, 0x19, 0xe2,
- 0xe3, 0x95, 0xfb, 0xe7, 0x3b, 0x56, 0xe0, 0xa3,
- 0x87, 0xbd, 0x64, 0x22, 0x2e, 0x83, 0x1f, 0xd6,
- 0x10, 0x27, 0x0c, 0xd7, 0xea, 0x25, 0x05, 0x54 }
- },
- {
- .auth_key_length = HMAC_SHA512_KEY_LEN,
- .auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa },
- .length = 50,
- .plaintext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
- .ciphertext = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd },
- .digest_length = HMAC_SHA512_256_CHECK_LEN,
- .digest = { 0xfa, 0x73, 0xb0, 0x08, 0x9d, 0x56, 0xa2, 0x84,
- 0xef, 0xb0, 0xf0, 0x75, 0x6c, 0x89, 0x0b, 0xe9,
- 0xb1, 0xb5, 0xdb, 0xdd, 0x8e, 0xe8, 0x1a, 0x36,
- 0x55, 0xf8, 0x3e, 0x33, 0xb2, 0x27, 0x9d, 0x39 }
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA384_192_CHECK_LEN,
},
+};
+
+static crypto_test_reference_t hmac_sha512_reference[] = {
{
.auth_key_length = HMAC_SHA512_KEY_LEN,
.auth_key = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
@@ -2298,6 +2031,10 @@ static crypto_test_reference_t hmac_sha512_reference[] = {
0x2e, 0x69, 0x6c, 0x20, 0x3a, 0x12, 0x68, 0x54 }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA512_256_CHECK_LEN,
+ },
+ {
.auth_key_length = HMAC_SHA512_KEY_LEN,
/* "Jefe" */
.auth_key = { 0x4a, 0x65, 0x66, 0x65 },
@@ -2322,6 +2059,10 @@ static crypto_test_reference_t hmac_sha512_reference[] = {
0x63, 0x6e, 0x07, 0x0a, 0x38, 0xbc, 0xe7, 0x37 }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA512_256_CHECK_LEN,
+ },
+ {
.auth_key_length = HMAC_SHA512_KEY_LEN,
.auth_key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
@@ -2350,49 +2091,32 @@ static crypto_test_reference_t hmac_sha512_reference[] = {
0x06, 0xb4, 0x85, 0xa4, 0x7e, 0x67, 0xc8, 0x07,
0xb9, 0x46, 0xa3, 0x37, 0xbe, 0xe8, 0x94, 0x26,
0x74, 0x27, 0x88, 0x59, 0xe1, 0x32, 0x92, 0xfb }
- }
+ },
+ {
+ .copy_previous_vector = 1,
+ .digest_length = HMAC_SHA512_256_CHECK_LEN,
+ },
};
+/*
+ * RFC 3566
+ */
static crypto_test_reference_t aes_xcbc_reference[] = {
+ /* Test Case #1 */
{
.auth_key_length = AES_XCBC_MAC_KEY_LEN,
- .auth_key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
- .length = 3,
- .plaintext = { 0x00, 0x01, 0x02 },
- .ciphertext = { 0x00, 0x01, 0x02 },
- .digest_length = AES_XCBC_MAC_96_CHECK_LEN,
- .digest = { 0x5b, 0x37, 0x65, 0x80, 0xae, 0x2f, 0x19, 0xaf,
- 0xe7, 0x21, 0x9c, 0xee }
+ .auth_key = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},
+ .length = 0,
+ .digest_length = AES_XCBC_MAC_CHECK_LEN,
+ .digest = {0x75, 0xf0, 0x25, 0x1d, 0x52, 0x8a, 0xc0, 0x1c,
+ 0x45, 0x73, 0xdf, 0xd5, 0x84, 0xd7, 0x9f, 0x29}
},
{
- .auth_key_length = AES_XCBC_MAC_KEY_LEN,
- .auth_key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
- .length = 16,
- .plaintext = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
- .ciphertext = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
+ .copy_previous_vector = 1,
.digest_length = AES_XCBC_MAC_96_CHECK_LEN,
- .digest = { 0xd2, 0xa2, 0x46, 0xfa, 0x34, 0x9b, 0x68, 0xa7,
- 0x99, 0x98, 0xa4, 0x39 }
- },
- {
- .auth_key_length = AES_XCBC_MAC_KEY_LEN,
- .auth_key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
- .length = 20,
- .plaintext = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13 },
- .ciphertext = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13 },
- .digest_length = AES_XCBC_MAC_96_CHECK_LEN,
- .digest = { 0x47, 0xf5, 0x1b, 0x45, 0x64, 0x96, 0x62, 0x15,
- 0xb8, 0x98, 0x5c, 0x63 }
},
+ /* Test Case #2 */
{
.auth_key_length = AES_XCBC_MAC_KEY_LEN,
.auth_key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
@@ -2405,6 +2129,11 @@ static crypto_test_reference_t aes_xcbc_reference[] = {
0xe7, 0x21, 0x9c, 0xee, 0xf1, 0x72, 0x75, 0x6f }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = AES_XCBC_MAC_96_CHECK_LEN,
+ },
+ /* Test Case #3 */
+ {
.auth_key_length = AES_XCBC_MAC_KEY_LEN,
.auth_key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
@@ -2418,6 +2147,11 @@ static crypto_test_reference_t aes_xcbc_reference[] = {
0x99, 0x98, 0xa4, 0x39, 0x4f, 0xf7, 0xa2, 0x63 }
},
{
+ .copy_previous_vector = 1,
+ .digest_length = AES_XCBC_MAC_96_CHECK_LEN,
+ },
+ /* Test Case #4 */
+ {
.auth_key_length = AES_XCBC_MAC_KEY_LEN,
.auth_key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
@@ -2431,7 +2165,72 @@ static crypto_test_reference_t aes_xcbc_reference[] = {
.digest_length = AES_XCBC_MAC_CHECK_LEN,
.digest = { 0x47, 0xf5, 0x1b, 0x45, 0x64, 0x96, 0x62, 0x15,
0xb8, 0x98, 0x5c, 0x63, 0x05, 0x5e, 0xd3, 0x08 }
- }
+ },
+ {
+ .copy_previous_vector = 1,
+ .digest_length = AES_XCBC_MAC_96_CHECK_LEN,
+ },
+ /* Test Case #5 */
+ {
+ .auth_key_length = AES_XCBC_MAC_KEY_LEN,
+ .auth_key = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},
+ .length = 32,
+ .plaintext = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
+ .ciphertext = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
+ .digest_length = AES_XCBC_MAC_CHECK_LEN,
+ .digest = {0xf5, 0x4f, 0x0e, 0xc8, 0xd2, 0xb9, 0xf3, 0xd3,
+ 0x68, 0x07, 0x73, 0x4b, 0xd5, 0x28, 0x3f, 0xd4}
+ },
+ {
+ .copy_previous_vector = 1,
+ .digest_length = AES_XCBC_MAC_96_CHECK_LEN,
+ },
+ /* Test Case #6 */
+ {
+ .auth_key_length = AES_XCBC_MAC_KEY_LEN,
+ .auth_key = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},
+ .length = 34,
+ .plaintext = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21},
+ .ciphertext = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21},
+ .digest_length = AES_XCBC_MAC_CHECK_LEN,
+ .digest = {0xbe, 0xcb, 0xb3, 0xbc, 0xcd, 0xb5, 0x18, 0xa3,
+ 0x06, 0x77, 0xd5, 0x48, 0x1f, 0xb6, 0xb4, 0xd8}
+ },
+ {
+ .copy_previous_vector = 1,
+ .digest_length = AES_XCBC_MAC_96_CHECK_LEN,
+ },
+ /* Test Case #7 */
+ {
+ .auth_key_length = AES_XCBC_MAC_KEY_LEN,
+ .auth_key = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},
+ .length = 1000,
+ /* Plaintext is 1000 zero bytes. No explicit init needed. */
+ .digest_length = AES_XCBC_MAC_CHECK_LEN,
+ .digest = {0xf0, 0xda, 0xfe, 0xe8, 0x95, 0xdb, 0x30, 0x25,
+ 0x37, 0x61, 0x10, 0x3b, 0x5d, 0x84, 0x52, 0x8f}
+ },
+ {
+ .copy_previous_vector = 1,
+ .digest_length = AES_XCBC_MAC_96_CHECK_LEN,
+ },
};
/*
@@ -2941,4 +2740,21 @@ static crypto_test_reference_t sha512_reference[] = {
}
};
+static void init_reference(crypto_test_reference_t *ref, int size)
+{
+ int n;
+ crypto_test_reference_t *prev = NULL;
+
+ for (n = 0; n < size; n++) {
+ if (prev && ref[n].copy_previous_vector) {
+ uint32_t len;
+
+ len = ref[n].digest_length;
+ ref[n] = *prev;
+ ref[n].digest_length = len;
+ }
+ prev = &ref[n];
+ }
+}
+
#endif
diff --git a/test/validation/api/crypto/test_vectors_len.h b/test/validation/api/crypto/test_vectors_len.h
index 17121e12e..9edf2999e 100644
--- a/test/validation/api/crypto/test_vectors_len.h
+++ b/test/validation/api/crypto/test_vectors_len.h
@@ -9,7 +9,7 @@
/* Maximum */
#define MAX_KEY_LEN 64
#define MAX_IV_LEN 16
-#define MAX_DATA_LEN 715
+#define MAX_DATA_LEN 1000
#define MAX_AAD_LEN 12
#define MAX_DIGEST_LEN 64
diff --git a/test/validation/api/init/init_main.c b/test/validation/api/init/init_main.c
index c335e10a3..f1716db25 100644
--- a/test/validation/api/init/init_main.c
+++ b/test/validation/api/init/init_main.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2019, Nokia
+ * Copyright (c) 2019-2021, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,7 @@
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
/* Replacement abort function */
static void ODP_NORETURN my_abort_func(void)
@@ -51,6 +52,7 @@ static void init_test_defaults(void)
{
int ret;
odp_instance_t instance;
+ odp_instance_t current_instance;
odp_init_t param;
odp_init_param_init(&param);
@@ -61,6 +63,9 @@ static void init_test_defaults(void)
ret = odp_init_local(instance, ODP_THREAD_WORKER);
CU_ASSERT_FATAL(ret == 0);
+ CU_ASSERT_FATAL(odp_instance(&current_instance) == 0);
+ CU_ASSERT(memcmp(&current_instance, &instance, sizeof(odp_instance_t)) == 0);
+
ret = odp_term_local();
CU_ASSERT_FATAL(ret == 0);
diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c
index c6fbe6f91..cd1824fb1 100644
--- a/test/validation/api/ipsec/ipsec.c
+++ b/test/validation/api/ipsec/ipsec.c
@@ -329,6 +329,12 @@ int ipsec_check_esp_aes_gcm_128_reass_ipv6(void)
return ODP_TEST_INACTIVE;
}
+int ipsec_check_esp_null_aes_xcbc(void)
+{
+ return ipsec_check_esp(ODP_CIPHER_ALG_NULL, 0,
+ ODP_AUTH_ALG_AES_XCBC_MAC, 128);
+}
+
void ipsec_sa_param_fill(odp_ipsec_sa_param_t *param,
odp_bool_t in,
odp_bool_t ah,
@@ -949,9 +955,15 @@ static void verify_in(const ipsec_test_part *part,
CU_ASSERT_EQUAL(IPSEC_SA_CTX,
odp_ipsec_sa_context(sa));
if (suite_context.inbound_op_mode != ODP_IPSEC_OP_MODE_SYNC) {
- uint32_t len = part->pkt_in->len - part->pkt_in->l3_offset;
+ uint32_t len;
- CU_ASSERT(result.orig_ip_len == len);
+ if (part->out[i].orig_ip_len)
+ len = part->out[i].orig_ip_len;
+ else
+ len = part->pkt_in->len - part->pkt_in->l3_offset;
+
+ CU_ASSERT(result.orig_ip_len == 0 ||
+ result.orig_ip_len == len);
}
}
ipsec_check_packet(part->out[i].pkt_res,
@@ -991,11 +1003,7 @@ static void parse_ip(odp_packet_t pkt)
.proto = proto,
.last_layer = ODP_PROTO_LAYER_L4,
};
- /*
- * odp_packet_parse() is buggy in linux generic ODP. Intentionally
- * ignore the return value until the bug has been fixed.
- */
- (void)odp_packet_parse(pkt, l3, &param);
+ CU_ASSERT(odp_packet_parse(pkt, l3, &param) == 0);
}
int ipsec_check_out(const ipsec_test_part *part, odp_ipsec_sa_t sa,
diff --git a/test/validation/api/ipsec/ipsec.h b/test/validation/api/ipsec/ipsec.h
index 6edce03d0..cbb533913 100644
--- a/test/validation/api/ipsec/ipsec.h
+++ b/test/validation/api/ipsec/ipsec.h
@@ -96,6 +96,11 @@ typedef struct {
odp_proto_l3_type_t l3_type;
odp_proto_l4_type_t l4_type;
uint32_t seq_num;
+ /*
+ * Expected original IP length. Non zero only when expected len
+ * differs from that of input test packet (pkt_in).
+ */
+ uint32_t orig_ip_len;
} out[MAX_FRAGS];
} ipsec_test_part;
@@ -149,5 +154,6 @@ int ipsec_check_esp_chacha20_poly1305(void);
int ipsec_check_test_sa_update_seq_num(void);
int ipsec_check_esp_aes_gcm_128_reass_ipv4(void);
int ipsec_check_esp_aes_gcm_128_reass_ipv6(void);
+int ipsec_check_esp_null_aes_xcbc(void);
#endif
diff --git a/test/validation/api/ipsec/ipsec_test_in.c b/test/validation/api/ipsec/ipsec_test_in.c
index bcdcd4e83..508d7aaa5 100644
--- a/test/validation/api/ipsec/ipsec_test_in.c
+++ b/test/validation/api/ipsec/ipsec_test_in.c
@@ -1777,6 +1777,7 @@ static void test_multi_out_in(odp_ipsec_sa_t out_sa,
{
uint8_t ver_ihl = result_packet->data[result_packet->l3_offset];
odp_bool_t is_result_ipv6 = (ODPH_IPV4HDR_VER(ver_ihl) == ODPH_IPV6);
+ uint32_t orig_ip_len = 0;
int i;
for (i = 0; i < num_input_packets; i++) {
@@ -1784,6 +1785,7 @@ static void test_multi_out_in(odp_ipsec_sa_t out_sa,
ipsec_test_part test_in;
ipsec_test_packet test_pkt;
odp_packet_t pkt = ODP_PACKET_INVALID;
+ uint32_t l3_off, pkt_len;
/*
* Convert plain text packet to IPsec packet through
@@ -1798,11 +1800,26 @@ static void test_multi_out_in(odp_ipsec_sa_t out_sa,
* Expect result packet only for the last packet.
*/
memset(&test_in, 0, sizeof(test_in));
+
+ /*
+ * In case of complete reassembly, the original IP length is the
+ * sum of IP lengths of the ESP packets that contained the
+ * individual fragments.
+ */
+ if (reass_status == ODP_PACKET_REASS_COMPLETE) {
+ pkt_len = odp_packet_len(pkt);
+ l3_off = odp_packet_l3_offset(pkt);
+ CU_ASSERT(ODP_PACKET_OFFSET_INVALID != l3_off)
+
+ orig_ip_len += pkt_len - l3_off;
+ }
+
if (i == num_input_packets - 1) {
part_prep_plain(&test_in, 1, is_result_ipv6, true);
test_in.out[0].pkt_res = result_packet;
test_in.out[0].reass_status = reass_status;
test_in.out[0].num_frags = num_input_packets;
+ test_in.out[0].orig_ip_len = orig_ip_len;
}
ipsec_test_packet_from_pkt(&test_pkt, &pkt);
test_in.pkt_in = &test_pkt;
@@ -2192,6 +2209,42 @@ static void test_in_ipv6_esp_reass_incomp(void)
ipsec_sa_destroy(out_sa);
}
+static void test_in_ipv4_null_aes_xcbc_esp(void)
+{
+ odp_ipsec_tunnel_param_t tunnel;
+ odp_ipsec_sa_param_t param;
+ odp_ipsec_sa_t sa;
+
+ memset(&tunnel, 0, sizeof(odp_ipsec_tunnel_param_t));
+
+ ipsec_sa_param_fill(&param,
+ true, false, 0x100, &tunnel,
+ ODP_CIPHER_ALG_NULL, NULL,
+ ODP_AUTH_ALG_AES_XCBC_MAC, &key_auth_aes_xcbc_128,
+ NULL, NULL);
+
+ sa = odp_ipsec_sa_create(&param);
+
+ CU_ASSERT_NOT_EQUAL_FATAL(ODP_IPSEC_SA_INVALID, sa);
+
+ ipsec_test_part test = {
+ .pkt_in = &pkt_ipv4_null_aes_xcbc_esp,
+ .num_pkt = 1,
+ .out = {
+ { .status.warn.all = 0,
+ .status.error.all = 0,
+ .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+ .l4_type = ODP_PROTO_L4_TYPE_UDP,
+ .pkt_res = &pkt_ipv4_null_aes_xcbc_plain,
+ },
+ },
+ };
+
+ ipsec_check_in_one(&test, sa);
+
+ ipsec_sa_destroy(sa);
+}
+
static void ipsec_test_capability(void)
{
odp_ipsec_capability_t capa;
@@ -2312,5 +2365,7 @@ odp_testinfo_t ipsec_in_suite[] = {
ipsec_check_esp_aes_gcm_128_reass_ipv6),
ODP_TEST_INFO_CONDITIONAL(test_in_ipv6_esp_reass_incomp,
ipsec_check_esp_aes_gcm_128_reass_ipv6),
+ ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_null_aes_xcbc_esp,
+ ipsec_check_esp_null_aes_xcbc),
ODP_TEST_INFO_NULL,
};
diff --git a/test/validation/api/ipsec/ipsec_test_out.c b/test/validation/api/ipsec/ipsec_test_out.c
index 733db10b9..aab480bdd 100644
--- a/test/validation/api/ipsec/ipsec_test_out.c
+++ b/test/validation/api/ipsec/ipsec_test_out.c
@@ -1377,6 +1377,50 @@ static void test_out_ipv4_udp_esp_null_sha256(void)
ipsec_sa_destroy(sa);
}
+static void test_out_ipv4_null_aes_xcbc(void)
+{
+ odp_ipsec_tunnel_param_t tunnel;
+ odp_ipsec_sa_param_t param;
+ odp_ipsec_sa_t sa;
+
+ memset(&tunnel, 0, sizeof(odp_ipsec_tunnel_param_t));
+ uint32_t src = IPV4ADDR(10, 0, 111, 2);
+ uint32_t dst = IPV4ADDR(10, 0, 222, 2);
+
+ memset(&tunnel, 0, sizeof(odp_ipsec_tunnel_param_t));
+ tunnel.type = ODP_IPSEC_TUNNEL_IPV4;
+ tunnel.ipv4.src_addr = &src;
+ tunnel.ipv4.dst_addr = &dst;
+ tunnel.ipv4.ttl = 64;
+
+ ipsec_sa_param_fill(&param,
+ false, false, 0x100, &tunnel,
+ ODP_CIPHER_ALG_NULL, NULL,
+ ODP_AUTH_ALG_AES_XCBC_MAC, &key_auth_aes_xcbc_128,
+ NULL, NULL);
+
+ sa = odp_ipsec_sa_create(&param);
+
+ CU_ASSERT_NOT_EQUAL_FATAL(ODP_IPSEC_SA_INVALID, sa);
+
+ ipsec_test_part test = {
+ .pkt_in = &pkt_ipv4_null_aes_xcbc_plain,
+ .num_pkt = 1,
+ .out = {
+ { .status.warn.all = 0,
+ .status.error.all = 0,
+ .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+ .l4_type = _ODP_PROTO_L4_TYPE_UNDEF,
+ .pkt_res = &pkt_ipv4_null_aes_xcbc_esp,
+ },
+ },
+ };
+
+ ipsec_check_out_one(&test, sa);
+
+ ipsec_sa_destroy(sa);
+}
+
static void test_sa_info(void)
{
uint32_t src = IPV4ADDR(10, 0, 111, 2);
@@ -1849,6 +1893,8 @@ odp_testinfo_t ipsec_out_suite[] = {
ipsec_check_esp_null_sha256),
ODP_TEST_INFO_CONDITIONAL(test_out_ipv4_udp_esp_null_sha256,
ipsec_check_esp_null_sha256),
+ ODP_TEST_INFO_CONDITIONAL(test_out_ipv4_null_aes_xcbc,
+ ipsec_check_esp_null_aes_xcbc),
ODP_TEST_INFO_CONDITIONAL(test_sa_info,
ipsec_check_esp_aes_cbc_128_sha1),
ODP_TEST_INFO_CONDITIONAL(test_test_sa_update_seq_num,
diff --git a/test/validation/api/ipsec/test_vectors.h b/test/validation/api/ipsec/test_vectors.h
index 136794c75..b032ef973 100644
--- a/test/validation/api/ipsec/test_vectors.h
+++ b/test/validation/api/ipsec/test_vectors.h
@@ -75,6 +75,8 @@ KEY(key_rfc7634, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f);
KEY(key_rfc7634_salt, 0xa0, 0xa1, 0xa2, 0xa3);
KEY(key_3byte_salt, 0x01, 0x02, 0x03);
+KEY(key_auth_aes_xcbc_128, 0x61, 0x31, 0x62, 0x32, 0x63, 0x33, 0x64, 0x34,
+ 0x65, 0x35, 0x66, 0x36, 0x67, 0x37, 0x68, 0x38);
/* DES keys have parity bits so that each byte has odd parity */
KEY(key_des_64, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4);
@@ -2108,4 +2110,59 @@ static const ipsec_test_packet pkt_ipv4_udp_esp_null_sha256 = {
},
};
+static const ipsec_test_packet pkt_ipv4_null_aes_xcbc_esp = {
+ .len = 106,
+ .l2_offset = 0,
+ .l3_offset = 14,
+ .l4_offset = 34,
+ .data = {
+ /* ETH */
+ 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1,
+ 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0x08, 0x00,
+
+ /* IP */
+ 0x45, 0x00, 0x00, 0x5c, 0x06, 0x00, 0x00, 0x00,
+ 0x40, 0x32, 0x13, 0x6c, 0x0a, 0x00, 0x6f, 0x02,
+ 0x0a, 0x00, 0xde, 0x02,
+
+ /* ESP */
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
+
+ /* IP */
+ 0x45, 0x00, 0x00, 0x2f, 0x49, 0x37, 0x00, 0x00,
+ 0x40, 0x11, 0x22, 0x84, 0x0d, 0x00, 0x00, 0x02,
+ 0x02, 0x00, 0x00, 0x02, 0x08, 0x00, 0x08, 0x00,
+ 0x00, 0x1b, 0x6d, 0x99, 0x58, 0x58, 0x58, 0x58,
+ 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
+ 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
+
+ /* ESP trailer */
+ 0x01, 0x02, 0x03, 0x03, 0x04,
+
+ /* ICV */
+ 0xf1, 0x52, 0x64, 0xd1, 0x9b, 0x62, 0x24, 0xdd,
+ 0xcc, 0x14, 0xf5, 0xc1,
+ },
+};
+
+static const ipsec_test_packet pkt_ipv4_null_aes_xcbc_plain = {
+ .len = 61,
+ .l2_offset = 0,
+ .l3_offset = 14,
+ .l4_offset = 34,
+ .data = {
+ /* ETH */
+ 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1,
+ 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0x08, 0x00,
+
+ /* IP */
+ 0x45, 0x00, 0x00, 0x2f, 0x49, 0x37, 0x00, 0x00,
+ 0x40, 0x11, 0x22, 0x84, 0x0d, 0x00, 0x00, 0x02,
+ 0x02, 0x00, 0x00, 0x02, 0x08, 0x00, 0x08, 0x00,
+ 0x00, 0x1b, 0x6d, 0x99, 0x58, 0x58, 0x58, 0x58,
+ 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
+ 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
+ },
+};
+
#endif
diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c
index e25260b1d..4a9b7cdc5 100644
--- a/test/validation/api/packet/packet.c
+++ b/test/validation/api/packet/packet.c
@@ -36,6 +36,9 @@ ODP_STATIC_ASSERT(PACKET_POOL_NUM_SEG > 1 &&
/* Number of preallocated packet vector test packets */
#define PKT_VEC_PACKET_NUM PKT_VEC_NUM
+/* Maximum packet length when 'pool_capa.pkt.max_len == 0' */
+#define DEFAULT_MAX_LEN (32 * 1024)
+
static odp_pool_capability_t pool_capa;
static odp_pool_param_t default_param;
static odp_pool_t default_pool;
@@ -130,6 +133,25 @@ static void _packet_compare_data(odp_packet_t pkt1, odp_packet_t pkt2,
}
}
+static int packet_sanity_check(odp_packet_t pkt)
+{
+ odp_packet_seg_t seg;
+ uint32_t len = 0;
+
+ for (seg = odp_packet_first_seg(pkt);
+ seg != ODP_PACKET_SEG_INVALID;
+ seg = odp_packet_next_seg(pkt, seg)) {
+ uint32_t seglen = odp_packet_seg_data_len(pkt, seg);
+
+ CU_ASSERT(seglen != 0);
+ if (seglen == 0)
+ return 1;
+ len += seglen;
+ }
+ CU_ASSERT(len == odp_packet_len(pkt));
+ return len != odp_packet_len(pkt);
+}
+
static int fill_data_forward(odp_packet_t pkt, uint32_t offset, uint32_t len,
uint32_t *cur_data)
{
@@ -566,6 +588,89 @@ static void packet_test_alloc_segmented(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
+static void packet_test_alloc_max_len(void)
+{
+ const int num = 5;
+ odp_packet_t pkts[num];
+ odp_packet_t pkt;
+ uint32_t max_len;
+ odp_pool_t pool;
+ odp_pool_param_t params;
+ int ret, i, num_alloc;
+
+ max_len = pool_capa.pkt.max_len;
+ if (!max_len)
+ max_len = DEFAULT_MAX_LEN;
+
+ odp_pool_param_init(&params);
+ params.type = ODP_POOL_PACKET;
+ params.pkt.len = max_len;
+ params.pkt.num = num;
+
+ pool = odp_pool_create("pool_alloc_max_len", &params);
+ CU_ASSERT_FATAL(pool != ODP_POOL_INVALID);
+
+ pkt = odp_packet_alloc(pool, max_len);
+ CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
+ CU_ASSERT(odp_packet_len(pkt) == max_len);
+
+ odp_packet_free(pkt);
+
+ num_alloc = 0;
+ for (i = 0; i < num; i++) {
+ ret = odp_packet_alloc_multi(pool, max_len,
+ &pkts[num_alloc], num - num_alloc);
+ CU_ASSERT_FATAL(ret >= 0);
+ num_alloc += ret;
+ if (num_alloc >= num)
+ break;
+ }
+
+ CU_ASSERT(num_alloc == num);
+
+ for (i = 0; i < num_alloc; i++)
+ CU_ASSERT(odp_packet_len(pkts[i]) == max_len);
+
+ odp_packet_free_multi(pkts, num_alloc);
+
+ CU_ASSERT(odp_pool_destroy(pool) == 0);
+}
+
+static void packet_test_alloc_max_segment(void)
+{
+ const int num = 5;
+ uint32_t max_len, max_seg_len;
+ odp_packet_t pkt;
+ odp_pool_t pool;
+ odp_pool_param_t params;
+
+ max_len = pool_capa.pkt.max_len;
+ if (max_len == 0)
+ max_len = DEFAULT_MAX_LEN;
+
+ max_seg_len = pool_capa.pkt.max_seg_len;
+ if (max_seg_len == 0 || max_seg_len > max_len)
+ max_seg_len = max_len;
+
+ odp_pool_param_init(&params);
+ params.type = ODP_POOL_PACKET;
+ params.pkt.seg_len = max_seg_len;
+ params.pkt.len = max_len;
+ params.pkt.num = num;
+
+ pool = odp_pool_create("pool_alloc_max_segment", &params);
+ CU_ASSERT_FATAL(pool != ODP_POOL_INVALID);
+
+ pkt = odp_packet_alloc(pool, max_len);
+ CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
+ CU_ASSERT(odp_packet_len(pkt) == max_len);
+ CU_ASSERT(odp_packet_seg_len(pkt) >= max_seg_len);
+
+ odp_packet_free(pkt);
+
+ CU_ASSERT(odp_pool_destroy(pool) == 0);
+}
+
static void packet_test_alloc_align(void)
{
odp_pool_t pool;
@@ -925,6 +1030,7 @@ static void _verify_headroom_shift(odp_packet_t *pkt,
extended = 1;
}
}
+ packet_sanity_check(*pkt);
CU_ASSERT_PTR_NOT_NULL(data);
if (extended) {
@@ -1022,6 +1128,7 @@ static void _verify_tailroom_shift(odp_packet_t *pkt,
extended = 1;
}
}
+ packet_sanity_check(*pkt);
CU_ASSERT_PTR_NOT_NULL(tail);
if (extended) {
@@ -1289,6 +1396,7 @@ static void packet_test_add_rem_data(void)
CU_ASSERT(ret >= 0);
if (ret < 0)
goto free_packet;
+ packet_sanity_check(new_pkt);
CU_ASSERT(odp_packet_len(new_pkt) == pkt_len + add_len);
/* Verify that user metadata is preserved */
CU_ASSERT(odp_packet_user_ptr(new_pkt) == usr_ptr);
@@ -1310,6 +1418,7 @@ static void packet_test_add_rem_data(void)
CU_ASSERT(ret >= 0);
if (ret < 0)
goto free_packet;
+ packet_sanity_check(new_pkt);
CU_ASSERT(odp_packet_len(new_pkt) == pkt_len - add_len);
CU_ASSERT(odp_packet_user_ptr(new_pkt) == usr_ptr);
@@ -1715,12 +1824,15 @@ static void packet_test_concatsplit(void)
CU_ASSERT(odp_packet_concat(&pkt, pkt2) >= 0);
CU_ASSERT(odp_packet_len(pkt) == pkt_len * 2);
+ packet_sanity_check(pkt);
packet_compare_offset(pkt, 0, pkt, pkt_len, pkt_len);
CU_ASSERT(odp_packet_split(&pkt, pkt_len, &pkt2) == 0);
CU_ASSERT(pkt != pkt2);
CU_ASSERT(odp_packet_data(pkt) != odp_packet_data(pkt2));
CU_ASSERT(odp_packet_len(pkt) == odp_packet_len(pkt2));
+ packet_sanity_check(pkt);
+ packet_sanity_check(pkt2);
packet_compare_data(pkt, pkt2);
packet_compare_data(pkt, test_packet);
@@ -1731,19 +1843,22 @@ static void packet_test_concatsplit(void)
odp_packet_pool(segmented_test_packet));
CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
pkt_len = odp_packet_len(pkt);
-
+ packet_sanity_check(pkt);
packet_compare_data(pkt, segmented_test_packet);
+
CU_ASSERT(odp_packet_split(&pkt, pkt_len / 2, &splits[0]) == 0);
CU_ASSERT(pkt != splits[0]);
CU_ASSERT(odp_packet_data(pkt) != odp_packet_data(splits[0]));
CU_ASSERT(odp_packet_len(pkt) == pkt_len / 2);
CU_ASSERT(odp_packet_len(pkt) + odp_packet_len(splits[0]) == pkt_len);
-
+ packet_sanity_check(pkt);
+ packet_sanity_check(splits[0]);
packet_compare_offset(pkt, 0, segmented_test_packet, 0, pkt_len / 2);
packet_compare_offset(splits[0], 0, segmented_test_packet,
pkt_len / 2, odp_packet_len(splits[0]));
CU_ASSERT(odp_packet_concat(&pkt, splits[0]) >= 0);
+ packet_sanity_check(pkt);
packet_compare_offset(pkt, 0, segmented_test_packet, 0, pkt_len / 2);
packet_compare_offset(pkt, pkt_len / 2, segmented_test_packet,
pkt_len / 2, pkt_len / 2);
@@ -1754,15 +1869,24 @@ static void packet_test_concatsplit(void)
packet_compare_data(pkt, segmented_test_packet);
CU_ASSERT(odp_packet_split(&pkt, pkt_len / 2, &splits[0]) == 0);
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_split(&pkt, pkt_len / 4, &splits[1]) == 0);
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_split(&pkt, pkt_len / 8, &splits[2]) == 0);
+ packet_sanity_check(pkt);
+ packet_sanity_check(splits[0]);
+ packet_sanity_check(splits[1]);
+ packet_sanity_check(splits[2]);
CU_ASSERT(odp_packet_len(splits[0]) + odp_packet_len(splits[1]) +
odp_packet_len(splits[2]) + odp_packet_len(pkt) == pkt_len);
CU_ASSERT(odp_packet_concat(&pkt, splits[2]) >= 0);
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_concat(&pkt, splits[1]) >= 0);
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_concat(&pkt, splits[0]) >= 0);
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_len(pkt) == odp_packet_len(segmented_test_packet));
packet_compare_data(pkt, segmented_test_packet);
@@ -1813,6 +1937,9 @@ static void packet_test_concat_small(void)
odp_packet_free(pkt2);
break;
}
+
+ if (packet_sanity_check(pkt))
+ break;
}
CU_ASSERT(odp_packet_len(pkt) == len);
@@ -1866,6 +1993,7 @@ static void packet_test_concat_extend_trunc(void)
ret = odp_packet_concat(&pkt, pkt2);
CU_ASSERT(ret >= 0);
+ packet_sanity_check(pkt);
if (ret < 0)
odp_packet_free(pkt2);
@@ -1876,13 +2004,13 @@ static void packet_test_concat_extend_trunc(void)
ret = odp_packet_extend_tail(&pkt, ext_len, NULL, NULL);
CU_ASSERT(ret >= 0);
-
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_len(pkt) == (cur_len + ext_len));
cur_len = odp_packet_len(pkt);
ret = odp_packet_extend_head(&pkt, ext_len, NULL, NULL);
CU_ASSERT(ret >= 0);
-
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_len(pkt) == (cur_len + ext_len));
cur_len = odp_packet_len(pkt);
@@ -1895,18 +2023,19 @@ static void packet_test_concat_extend_trunc(void)
if (ret < 0)
odp_packet_free(pkt2);
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_len(pkt) == (cur_len + alloc_len));
cur_len = odp_packet_len(pkt);
ret = odp_packet_trunc_head(&pkt, trunc_len, NULL, NULL);
CU_ASSERT(ret >= 0);
-
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_len(pkt) == (cur_len - trunc_len));
cur_len = odp_packet_len(pkt);
ret = odp_packet_trunc_tail(&pkt, trunc_len, NULL, NULL);
CU_ASSERT(ret >= 0);
-
+ packet_sanity_check(pkt);
CU_ASSERT(odp_packet_len(pkt) == (cur_len - trunc_len));
cur_len = odp_packet_len(pkt);
@@ -1962,6 +2091,9 @@ static void packet_test_extend_small(void)
if (ret < 0)
break;
+ if (packet_sanity_check(pkt))
+ break;
+
if (tail) {
/* assert needs brackets */
CU_ASSERT(seg_len == 1);
@@ -2066,6 +2198,9 @@ static void packet_test_extend_large(void)
if (ret < 0)
break;
+ if (packet_sanity_check(pkt))
+ break;
+
if (tail) {
/* assert needs brackets */
CU_ASSERT((seg_len > 0) &&
@@ -2197,6 +2332,9 @@ static void packet_test_extend_mix(void)
CU_ASSERT(ret == 0);
}
+ if (packet_sanity_check(pkt))
+ break;
+
cur_len += ext_len;
}
@@ -2259,9 +2397,11 @@ static void packet_test_extend_ref(void)
NULL, NULL) >= 0);
CU_ASSERT(odp_packet_extend_head(&max_pkt, 1, NULL, NULL) >= 0);
CU_ASSERT(odp_packet_len(max_pkt) == max_len);
+ packet_sanity_check(max_pkt);
/* Now try with a reference in place */
CU_ASSERT(odp_packet_trunc_tail(&max_pkt, 100, NULL, NULL) >= 0);
+ packet_sanity_check(max_pkt);
ref = odp_packet_ref(max_pkt, 100);
/* Verify ref lengths */
@@ -2275,6 +2415,7 @@ static void packet_test_extend_ref(void)
/* Now extend max_pkt and verify effect */
CU_ASSERT(odp_packet_extend_head(&max_pkt, 10, NULL, NULL) >= 0);
CU_ASSERT(odp_packet_len(max_pkt) == max_len - 90);
+ packet_sanity_check(max_pkt);
/* Extend on max_pkt should not affect ref */
CU_ASSERT(odp_packet_len(ref) == max_len - 200);
@@ -2282,12 +2423,14 @@ static void packet_test_extend_ref(void)
/* Now extend ref and verify effect*/
CU_ASSERT(odp_packet_extend_head(&ref, 20, NULL, NULL) >= 0);
CU_ASSERT(odp_packet_len(ref) == max_len - 180);
+ packet_sanity_check(max_pkt);
/* Extend on ref should not affect max_pkt */
CU_ASSERT(odp_packet_len(max_pkt) == max_len - 90);
/* Trunc max_pkt of all unshared len */
CU_ASSERT(odp_packet_trunc_head(&max_pkt, 110, NULL, NULL) >= 0);
+ packet_sanity_check(max_pkt);
/* Verify effect on max_pkt */
CU_ASSERT(odp_packet_len(max_pkt) == max_len - 200);
@@ -2299,6 +2442,7 @@ static void packet_test_extend_ref(void)
odp_packet_free(ref);
CU_ASSERT(odp_packet_has_ref(max_pkt) == 0);
CU_ASSERT(odp_packet_len(max_pkt) == max_len - 200);
+ packet_sanity_check(max_pkt);
odp_packet_free(max_pkt);
}
@@ -2339,6 +2483,8 @@ static void packet_test_align(void)
/* Verify requested contiguous addressabilty */
CU_ASSERT(aligned_seglen >= seg_len + 2);
+
+ packet_sanity_check(pkt);
}
/* Get a misaligned address */
@@ -2358,6 +2504,7 @@ static void packet_test_align(void)
packet_compare_offset(pkt, offset, segmented_test_packet, offset,
aligned_seglen);
CU_ASSERT((uintptr_t)aligned_data % max_align == 0);
+ packet_sanity_check(pkt);
odp_packet_free(pkt);
}
@@ -4080,6 +4227,8 @@ odp_testinfo_t packet_suite[] = {
ODP_TEST_INFO(packet_test_alloc_free_multi),
ODP_TEST_INFO(packet_test_free_sp),
ODP_TEST_INFO(packet_test_alloc_segmented),
+ ODP_TEST_INFO(packet_test_alloc_max_len),
+ ODP_TEST_INFO(packet_test_alloc_max_segment),
ODP_TEST_INFO(packet_test_alloc_align),
ODP_TEST_INFO(packet_test_basic_metadata),
ODP_TEST_INFO(packet_test_debug),
diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c
index 861ac18ae..866f93020 100644
--- a/test/validation/api/pool/pool.c
+++ b/test/validation/api/pool/pool.c
@@ -140,6 +140,7 @@ static void pool_test_lookup_info_print(void)
CU_ASSERT(param.type == info.params.type);
odp_pool_print(pool);
+ odp_pool_print_all();
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c
index 6f59cbf71..7b39da433 100644
--- a/test/validation/api/queue/queue.c
+++ b/test/validation/api/queue/queue.c
@@ -669,7 +669,9 @@ static void queue_test_param(void)
CU_ASSERT_FATAL(buf != ODP_BUFFER_INVALID);
ev = odp_buffer_to_event(buf);
- if (!(CU_ASSERT(odp_queue_enq(queue, ev) == 0))) {
+ ret = odp_queue_enq(queue, ev);
+ CU_ASSERT(ret == 0);
+ if (ret) {
odp_buffer_free(buf);
} else {
CU_ASSERT(ev == odp_queue_deq(queue));
diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c
index 9c84eacd3..da0eae267 100644
--- a/test/validation/api/scheduler/scheduler.c
+++ b/test/validation/api/scheduler/scheduler.c
@@ -274,7 +274,7 @@ static void scheduler_test_queue_destroy(void)
odp_buffer_t buf;
odp_event_t ev;
uint32_t *u32;
- int i;
+ int i, ret;
odp_schedule_sync_t sync[] = {ODP_SCHED_SYNC_PARALLEL,
ODP_SCHED_SYNC_ATOMIC,
ODP_SCHED_SYNC_ORDERED};
@@ -305,7 +305,10 @@ static void scheduler_test_queue_destroy(void)
u32[0] = MAGIC;
ev = odp_buffer_to_event(buf);
- if (!(CU_ASSERT(odp_queue_enq(queue, ev) == 0)))
+
+ ret = odp_queue_enq(queue, ev);
+ CU_ASSERT(ret == 0);
+ if (ret)
odp_buffer_free(buf);
ev = odp_schedule(&from, ODP_SCHED_WAIT);
@@ -371,7 +374,9 @@ static void scheduler_test_wait(void)
u32[0] = MAGIC;
ev = odp_buffer_to_event(buf);
- if (!(CU_ASSERT(odp_queue_enq(queue, ev) == 0))) {
+ ret = odp_queue_enq(queue, ev);
+ CU_ASSERT(ret == 0);
+ if (ret) {
odp_buffer_free(buf);
continue;
}
diff --git a/test/validation/api/stash/stash.c b/test/validation/api/stash/stash.c
index c99d5a471..49da49dfd 100644
--- a/test/validation/api/stash/stash.c
+++ b/test/validation/api/stash/stash.c
@@ -27,6 +27,13 @@
#define MAX_RETRY 1024
#define RETRY_MSEC 100
+typedef enum stash_op_t {
+ STASH_GEN,
+ STASH_U32,
+ STASH_U64,
+ STASH_PTR
+} stash_op_t;
+
typedef struct num_obj_t {
uint32_t u64;
uint32_t u32;
@@ -358,7 +365,7 @@ static void stash_create_fifo_u32_all(void)
CU_ASSERT_FATAL(odp_stash_destroy(stash[i]) == 0);
}
-static void stash_default_put(uint32_t size, int32_t burst)
+static void stash_default_put(uint32_t size, int32_t burst, stash_op_t op)
{
odp_stash_t stash;
odp_stash_param_t param;
@@ -414,7 +421,16 @@ static void stash_default_put(uint32_t size, int32_t burst)
retry = MAX_RETRY;
num_left = num;
while (num_left) {
- ret = odp_stash_put(stash, input, burst);
+ if (op == STASH_GEN)
+ ret = odp_stash_put(stash, input, burst);
+ else if (op == STASH_U32)
+ ret = odp_stash_put_u32(stash, input_u32, burst);
+ else if (op == STASH_U64)
+ ret = odp_stash_put_u64(stash, input_u64, burst);
+ else if (op == STASH_PTR)
+ ret = odp_stash_put_ptr(stash, input, burst);
+ else
+ ret = -1;
CU_ASSERT_FATAL(ret >= 0);
CU_ASSERT_FATAL(ret <= burst);
@@ -446,8 +462,16 @@ static void stash_default_put(uint32_t size, int32_t burst)
output_u8[0] = MAGIC_U8;
output_u8[burst + 1] = MAGIC_U8;
}
-
- ret = odp_stash_get(stash, output, burst);
+ if (op == STASH_GEN)
+ ret = odp_stash_get(stash, output, burst);
+ else if (op == STASH_U32)
+ ret = odp_stash_get_u32(stash, &output_u32[1], burst);
+ else if (op == STASH_U64)
+ ret = odp_stash_get_u64(stash, &output_u64[1], burst);
+ else if (op == STASH_PTR)
+ ret = odp_stash_get_ptr(stash, output, burst);
+ else
+ ret = -1;
CU_ASSERT_FATAL(ret >= 0);
CU_ASSERT_FATAL(ret <= burst);
@@ -494,7 +518,7 @@ static void stash_default_put(uint32_t size, int32_t burst)
CU_ASSERT_FATAL(odp_stash_destroy(stash) == 0);
}
-static void stash_fifo_put(uint32_t size, int32_t burst)
+static void stash_fifo_put(uint32_t size, int32_t burst, stash_op_t op)
{
odp_stash_t stash;
odp_stash_param_t param;
@@ -553,8 +577,16 @@ static void stash_fifo_put(uint32_t size, int32_t burst)
else
input_u8[i] = VAL_U8 + num_left - i;
}
-
- ret = odp_stash_put(stash, input, burst);
+ if (op == STASH_GEN)
+ ret = odp_stash_put(stash, input, burst);
+ else if (op == STASH_U32)
+ ret = odp_stash_put_u32(stash, input_u32, burst);
+ else if (op == STASH_U64)
+ ret = odp_stash_put_u64(stash, input_u64, burst);
+ else if (op == STASH_PTR)
+ ret = odp_stash_put_ptr(stash, input, burst);
+ else
+ ret = -1;
CU_ASSERT_FATAL(ret >= 0);
if (ret) {
@@ -587,7 +619,16 @@ static void stash_fifo_put(uint32_t size, int32_t burst)
output_u8[burst + 1] = MAGIC_U8;
}
- ret = odp_stash_get(stash, output, burst);
+ if (op == STASH_GEN)
+ ret = odp_stash_get(stash, output, burst);
+ else if (op == STASH_U32)
+ ret = odp_stash_get_u32(stash, &output_u32[1], burst);
+ else if (op == STASH_U64)
+ ret = odp_stash_get_u64(stash, &output_u64[1], burst);
+ else if (op == STASH_PTR)
+ ret = odp_stash_get_ptr(stash, output, burst);
+ else
+ ret = -1;
CU_ASSERT_FATAL(ret >= 0);
if (size == sizeof(uint64_t)) {
@@ -649,6 +690,14 @@ static int check_support_64(void)
return ODP_TEST_INACTIVE;
}
+static int check_support_ptr(void)
+{
+ if (global.capa_default.max_obj_size >= sizeof(uintptr_t))
+ return ODP_TEST_ACTIVE;
+
+ return ODP_TEST_INACTIVE;
+}
+
static int check_support_fifo_64(void)
{
if (global.fifo_supported &&
@@ -658,6 +707,15 @@ static int check_support_fifo_64(void)
return ODP_TEST_INACTIVE;
}
+static int check_support_fifo_ptr(void)
+{
+ if (global.fifo_supported &&
+ global.capa_fifo.max_obj_size >= sizeof(uintptr_t))
+ return ODP_TEST_ACTIVE;
+
+ return ODP_TEST_INACTIVE;
+}
+
static int check_support_fifo(void)
{
if (global.fifo_supported)
@@ -668,82 +726,142 @@ static int check_support_fifo(void)
static void stash_default_put_u64_1(void)
{
- stash_default_put(sizeof(uint64_t), 1);
+ stash_default_put(sizeof(uint64_t), 1, STASH_GEN);
}
static void stash_default_put_u64_n(void)
{
- stash_default_put(sizeof(uint64_t), BURST);
+ stash_default_put(sizeof(uint64_t), BURST, STASH_GEN);
+}
+
+static void stash_default_u64_put_u64_1(void)
+{
+ stash_default_put(sizeof(uint64_t), 1, STASH_U64);
+}
+
+static void stash_default_u64_put_u64_n(void)
+{
+ stash_default_put(sizeof(uint64_t), BURST, STASH_U64);
+}
+
+static void stash_default_put_ptr_1(void)
+{
+ stash_default_put(sizeof(uintptr_t), 1, STASH_PTR);
+}
+
+static void stash_default_put_ptr_n(void)
+{
+ stash_default_put(sizeof(uintptr_t), BURST, STASH_PTR);
}
static void stash_default_put_u32_1(void)
{
- stash_default_put(sizeof(uint32_t), 1);
+ stash_default_put(sizeof(uint32_t), 1, STASH_GEN);
}
static void stash_default_put_u32_n(void)
{
- stash_default_put(sizeof(uint32_t), BURST);
+ stash_default_put(sizeof(uint32_t), BURST, STASH_GEN);
+}
+
+static void stash_default_u32_put_u32_1(void)
+{
+ stash_default_put(sizeof(uint32_t), 1, STASH_U32);
+}
+
+static void stash_default_u32_put_u32_n(void)
+{
+ stash_default_put(sizeof(uint32_t), BURST, STASH_U32);
}
static void stash_default_put_u16_1(void)
{
- stash_default_put(sizeof(uint16_t), 1);
+ stash_default_put(sizeof(uint16_t), 1, STASH_GEN);
}
static void stash_default_put_u16_n(void)
{
- stash_default_put(sizeof(uint16_t), BURST);
+ stash_default_put(sizeof(uint16_t), BURST, STASH_GEN);
}
static void stash_default_put_u8_1(void)
{
- stash_default_put(sizeof(uint8_t), 1);
+ stash_default_put(sizeof(uint8_t), 1, STASH_GEN);
}
static void stash_default_put_u8_n(void)
{
- stash_default_put(sizeof(uint8_t), BURST);
+ stash_default_put(sizeof(uint8_t), BURST, STASH_GEN);
}
static void stash_fifo_put_u64_1(void)
{
- stash_fifo_put(sizeof(uint64_t), 1);
+ stash_fifo_put(sizeof(uint64_t), 1, STASH_GEN);
}
static void stash_fifo_put_u64_n(void)
{
- stash_fifo_put(sizeof(uint64_t), BURST);
+ stash_fifo_put(sizeof(uint64_t), BURST, STASH_GEN);
+}
+
+static void stash_fifo_u64_put_u64_1(void)
+{
+ stash_fifo_put(sizeof(uint64_t), 1, STASH_U64);
+}
+
+static void stash_fifo_u64_put_u64_n(void)
+{
+ stash_fifo_put(sizeof(uint64_t), BURST, STASH_U64);
+}
+
+static void stash_fifo_put_ptr_1(void)
+{
+ stash_fifo_put(sizeof(uintptr_t), 1, STASH_PTR);
+}
+
+static void stash_fifo_put_ptr_n(void)
+{
+ stash_fifo_put(sizeof(uintptr_t), BURST, STASH_PTR);
}
static void stash_fifo_put_u32_1(void)
{
- stash_fifo_put(sizeof(uint32_t), 1);
+ stash_fifo_put(sizeof(uint32_t), 1, STASH_GEN);
}
static void stash_fifo_put_u32_n(void)
{
- stash_fifo_put(sizeof(uint32_t), BURST);
+ stash_fifo_put(sizeof(uint32_t), BURST, STASH_GEN);
+}
+
+static void stash_fifo_u32_put_u32_1(void)
+{
+ stash_fifo_put(sizeof(uint32_t), 1, STASH_U32);
+}
+
+static void stash_fifo_u32_put_u32_n(void)
+{
+ stash_fifo_put(sizeof(uint32_t), BURST, STASH_U32);
}
static void stash_fifo_put_u16_1(void)
{
- stash_fifo_put(sizeof(uint16_t), 1);
+ stash_fifo_put(sizeof(uint16_t), 1, STASH_GEN);
}
static void stash_fifo_put_u16_n(void)
{
- stash_fifo_put(sizeof(uint16_t), BURST);
+ stash_fifo_put(sizeof(uint16_t), BURST, STASH_GEN);
}
static void stash_fifo_put_u8_1(void)
{
- stash_fifo_put(sizeof(uint8_t), 1);
+ stash_fifo_put(sizeof(uint8_t), 1, STASH_GEN);
}
static void stash_fifo_put_u8_n(void)
{
- stash_fifo_put(sizeof(uint8_t), BURST);
+ stash_fifo_put(sizeof(uint8_t), BURST, STASH_GEN);
}
odp_testinfo_t stash_suite[] = {
@@ -753,8 +871,14 @@ odp_testinfo_t stash_suite[] = {
ODP_TEST_INFO(stash_create_u32),
ODP_TEST_INFO_CONDITIONAL(stash_default_put_u64_1, check_support_64),
ODP_TEST_INFO_CONDITIONAL(stash_default_put_u64_n, check_support_64),
+ ODP_TEST_INFO_CONDITIONAL(stash_default_u64_put_u64_1, check_support_64),
+ ODP_TEST_INFO_CONDITIONAL(stash_default_u64_put_u64_n, check_support_64),
+ ODP_TEST_INFO_CONDITIONAL(stash_default_put_ptr_1, check_support_ptr),
+ ODP_TEST_INFO_CONDITIONAL(stash_default_put_ptr_n, check_support_ptr),
ODP_TEST_INFO(stash_default_put_u32_1),
ODP_TEST_INFO(stash_default_put_u32_n),
+ ODP_TEST_INFO(stash_default_u32_put_u32_1),
+ ODP_TEST_INFO(stash_default_u32_put_u32_n),
ODP_TEST_INFO(stash_default_put_u16_1),
ODP_TEST_INFO(stash_default_put_u16_n),
ODP_TEST_INFO(stash_default_put_u8_1),
@@ -763,8 +887,14 @@ odp_testinfo_t stash_suite[] = {
ODP_TEST_INFO(stash_create_u32_all),
ODP_TEST_INFO_CONDITIONAL(stash_fifo_put_u64_1, check_support_fifo_64),
ODP_TEST_INFO_CONDITIONAL(stash_fifo_put_u64_n, check_support_fifo_64),
+ ODP_TEST_INFO_CONDITIONAL(stash_fifo_u64_put_u64_1, check_support_fifo_64),
+ ODP_TEST_INFO_CONDITIONAL(stash_fifo_u64_put_u64_n, check_support_fifo_64),
+ ODP_TEST_INFO_CONDITIONAL(stash_fifo_put_ptr_1, check_support_fifo_ptr),
+ ODP_TEST_INFO_CONDITIONAL(stash_fifo_put_ptr_n, check_support_fifo_ptr),
ODP_TEST_INFO_CONDITIONAL(stash_fifo_put_u32_1, check_support_fifo),
ODP_TEST_INFO_CONDITIONAL(stash_fifo_put_u32_n, check_support_fifo),
+ ODP_TEST_INFO_CONDITIONAL(stash_fifo_u32_put_u32_1, check_support_fifo),
+ ODP_TEST_INFO_CONDITIONAL(stash_fifo_u32_put_u32_n, check_support_fifo),
ODP_TEST_INFO_CONDITIONAL(stash_fifo_put_u16_1, check_support_fifo),
ODP_TEST_INFO_CONDITIONAL(stash_fifo_put_u16_n, check_support_fifo),
ODP_TEST_INFO_CONDITIONAL(stash_fifo_put_u8_1, check_support_fifo),
diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c
index 0716b7999..4cdbf05c2 100644
--- a/test/validation/api/timer/timer.c
+++ b/test/validation/api/timer/timer.c
@@ -717,7 +717,7 @@ static void timer_test_event_type(odp_queue_type_t queue_type,
ODPH_DBG(" period_ns %" PRIu64 "\n", period_ns);
ODPH_DBG(" period_tick %" PRIu64 "\n", period_tick);
ODPH_DBG(" duration_ns %" PRIu64 "\n", duration_ns);
- ODPH_DBG(" user_ptr %p\n\n", user_ctx);
+ ODPH_DBG(" user_ptr %p\n\n", (const void *)user_ctx);
for (i = 0; i < num; i++) {
if (event_type == ODP_EVENT_BUFFER) {
diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c
index 2ba0d1c9d..0899272ba 100644
--- a/test/validation/api/traffic_mngr/traffic_mngr.c
+++ b/test/validation/api/traffic_mngr/traffic_mngr.c
@@ -120,7 +120,7 @@ typedef enum {
typedef struct {
uint32_t num_queues;
- odp_tm_queue_t tm_queues[0];
+ odp_tm_queue_t tm_queues[];
} tm_queue_desc_t;
typedef struct tm_node_desc_s tm_node_desc_t;
@@ -133,7 +133,7 @@ struct tm_node_desc_s {
odp_tm_node_t node;
odp_tm_node_t parent_node;
tm_queue_desc_t *queue_desc;
- tm_node_desc_t *children[0];
+ tm_node_desc_t *children[];
};
typedef struct {
@@ -1813,7 +1813,7 @@ static void dump_tm_subtree(tm_node_desc_t *node_desc)
"level=%" PRIu32" parent=0x%" PRIX64 " children=%" PRIu32 " "
"queues=%" PRIu32 " queue_fanin=%" PRIu32 " "
"node_fanin=%" PRIu32 "\n",
- node_desc, node_desc->node_name,
+ (void *)node_desc, node_desc->node_name,
odp_tm_node_to_u64(node_desc->node), node_desc->node_idx,
node_desc->level, odp_tm_node_to_u64(node_desc->parent_node),
node_desc->num_children, num_queues, node_info.tm_queue_fanin,