aboutsummaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
authorGilles Peskine <Gilles.Peskine@arm.com>2022-04-21 11:14:52 +0200
committerGilles Peskine <Gilles.Peskine@arm.com>2022-04-21 11:33:17 +0200
commitb29d814169c2d879f2b14a865e2439ac0e0131da (patch)
tree8bb3a4e10acc763f5d766e20b5c2124b527cf423 /tests/src
parent5eef11af2c5cfff412582da336d30a0917d50441 (diff)
downloadmbedtls-b29d814169c2d879f2b14a865e2439ac0e0131da.zip
mbedtls-b29d814169c2d879f2b14a865e2439ac0e0131da.tar.gz
mbedtls-b29d814169c2d879f2b14a865e2439ac0e0131da.tar.bz2
Use MAX_SIZE macros instead of hard-coding IV/nonce max size
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/psa_exercise_key.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/src/psa_exercise_key.c b/tests/src/psa_exercise_key.c
index 53af7b8..9576afd 100644
--- a/tests/src/psa_exercise_key.c
+++ b/tests/src/psa_exercise_key.c
@@ -164,7 +164,7 @@ static int exercise_cipher_key( mbedtls_svc_key_id_t key,
psa_algorithm_t alg )
{
psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT;
- unsigned char iv[16] = {0};
+ unsigned char iv[PSA_CIPHER_IV_MAX_SIZE] = {0};
size_t iv_length;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
psa_key_type_t key_type;
@@ -242,7 +242,7 @@ static int exercise_aead_key( mbedtls_svc_key_id_t key,
psa_key_usage_t usage,
psa_algorithm_t alg )
{
- unsigned char nonce[16] = {0};
+ unsigned char nonce[PSA_AEAD_NONCE_MAX_SIZE] = {0};
size_t nonce_length;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
psa_key_type_t key_type;