diff --git a/include/psa/crypto_compat.h b/include/psa/crypto_compat.h index 67e7c5c82..728d28300 100644 --- a/include/psa/crypto_compat.h +++ b/include/psa/crypto_compat.h @@ -111,17 +111,18 @@ typedef MBEDTLS_PSA_DEPRECATED psa_algorithm_t mbedtls_deprecated_psa_algorithm_ #define PSA_ASYMMETRIC_SIGN_OUTPUT_SIZE( key_type, key_bits, alg ) \ MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_SIGN_OUTPUT_SIZE( key_type, key_bits, alg ) ) #define PSA_KEY_EXPORT_MAX_SIZE( key_type, key_bits ) \ - PSA_EXPORT_KEY_OUTPUT_SIZE( key_type, key_bits ) + MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_EXPORT_KEY_OUTPUT_SIZE( key_type, key_bits ) ) #define PSA_BLOCK_CIPHER_BLOCK_SIZE( type ) \ - PSA_BLOCK_CIPHER_BLOCK_LENGTH( type ) + MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_BLOCK_CIPHER_BLOCK_LENGTH( type ) ) #define PSA_MAX_BLOCK_CIPHER_BLOCK_SIZE \ - PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE + MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE ) #define PSA_HASH_SIZE( alg ) \ - PSA_HASH_LENGTH( alg ) + MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_HASH_LENGTH( alg ) ) #define PSA_MAC_FINAL_SIZE( key_type, key_bits, alg ) \ - PSA_MAC_LENGTH( key_type, key_bits, alg ) + MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_MAC_LENGTH( key_type, key_bits, alg ) ) #define PSA_ALG_TLS12_PSK_TO_MS_MAX_PSK_LEN \ - PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE + MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE ) + /* * Deprecated PSA Crypto function names (PSA Crypto API <= 1.0 beta3) */ diff --git a/include/psa/crypto_sizes.h b/include/psa/crypto_sizes.h index 001e6285c..dba6a97ba 100644 --- a/include/psa/crypto_sizes.h +++ b/include/psa/crypto_sizes.h @@ -307,7 +307,7 @@ * implementation to delay the output until it has a full block. */ #define PSA_AEAD_UPDATE_OUTPUT_SIZE(alg, input_length) \ (PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER(alg) ? \ - PSA_ROUND_UP_TO_MULTIPLE(PSA_MAX_BLOCK_CIPHER_BLOCK_SIZE, (input_length)) : \ + PSA_ROUND_UP_TO_MULTIPLE(PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE, (input_length)) : \ (input_length)) /** A sufficient ciphertext buffer size for psa_aead_finish(). @@ -358,7 +358,7 @@ #define PSA_RSA_MINIMUM_PADDING_SIZE(alg) \ (PSA_ALG_IS_RSA_OAEP(alg) ? \ - 2 * PSA_HASH_LENGTH(PSA_ALG_RSA_OAEP_GET_HASH(alg)) + 1 : \ + 2 * PSA_HASH_LENGTH(PSA_ALG_RSA_OAEP_GET_HASH(alg)) + 1 : \ 11 /*PKCS#1v1.5*/) /** @@ -667,7 +667,7 @@ * and AEAD algorithm that it recognizes, but does not support. */ #define PSA_AEAD_NONCE_LENGTH(key_type, alg) \ - (PSA_BLOCK_CIPHER_BLOCK_SIZE(key_type) == 16 && \ + (PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) == 16 && \ (PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH(alg) == PSA_ALG_CCM || \ PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH(alg) == PSA_ALG_GCM) ? 12 : \ (key_type) == PSA_KEY_TYPE_CHACHA20 && \