From 9c3b5077e606f1fa58f768a2c632088055b7729a Mon Sep 17 00:00:00 2001 From: gabor-mezei-arm Date: Wed, 10 Mar 2021 15:57:44 +0100 Subject: [PATCH] Update PSA_CIPHER_ENCRYPT_OUTPUT_SIZE Signed-off-by: gabor-mezei-arm --- include/psa/crypto_sizes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/psa/crypto_sizes.h b/include/psa/crypto_sizes.h index 2a822d7f4..b5fb47ddb 100644 --- a/include/psa/crypto_sizes.h +++ b/include/psa/crypto_sizes.h @@ -952,8 +952,8 @@ #define PSA_CIPHER_ENCRYPT_OUTPUT_SIZE(key_type, alg, input_length) \ (alg == PSA_ALG_CBC_PKCS7 ? \ PSA_ROUND_UP_TO_MULTIPLE(PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type), \ - (input_length) + PSA_CIPHER_IV_LENGTH((key_type), \ - (alg))) : \ + (input_length) + 1) + \ + PSA_CIPHER_IV_LENGTH((key_type), (alg)) : \ (PSA_ALG_IS_CIPHER(alg) ? \ (input_length) + PSA_CIPHER_IV_LENGTH((key_type), (alg)) : \ 0))