mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
fix(psa): increase psa-mbedtls heap size for rsa
The value assigned for the mbedtls heap size for large rsa keys was too small when PSA_CRYPTO is set to 1, leading to run-time failures if one was to attempt to use a large RSA key with PSA_CRYPTO=1. Change-Id: Id9b2648ae911879f483f1b88301f28694af0721d Signed-off-by: Ryan Everett <ryan.everett@arm.com>
This commit is contained in:
parent
e372c29153
commit
52d2934560
3 changed files with 20 additions and 7 deletions
|
@ -132,18 +132,15 @@
|
|||
#endif
|
||||
|
||||
/*
|
||||
* Determine Mbed TLS heap size
|
||||
* 13312 = 13*1024
|
||||
* 11264 = 11*1024
|
||||
* 7168 = 7*1024
|
||||
* Determine Mbed TLS heap size.
|
||||
*/
|
||||
#if TF_MBEDTLS_USE_ECDSA
|
||||
#define TF_MBEDTLS_HEAP_SIZE U(13312)
|
||||
#define TF_MBEDTLS_HEAP_SIZE U(13 * 1024)
|
||||
#elif TF_MBEDTLS_USE_RSA
|
||||
#if TF_MBEDTLS_KEY_SIZE <= 2048
|
||||
#define TF_MBEDTLS_HEAP_SIZE U(7168)
|
||||
#define TF_MBEDTLS_HEAP_SIZE U(7 * 1024)
|
||||
#else
|
||||
#define TF_MBEDTLS_HEAP_SIZE U(11264)
|
||||
#define TF_MBEDTLS_HEAP_SIZE U(11 * 1024)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -26,4 +26,12 @@
|
|||
*/
|
||||
#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
|
||||
|
||||
/*
|
||||
* Override heap size for PSA Crypto when RSA key size > 2048.
|
||||
*/
|
||||
#if TF_MBEDTLS_USE_RSA && TF_MBEDTLS_KEY_SIZE > 2048
|
||||
#undef TF_MBEDTLS_HEAP_SIZE
|
||||
#define TF_MBEDTLS_HEAP_SIZE U(12 * 1024)
|
||||
#endif
|
||||
|
||||
#endif /* PSA_MBEDTLS_CONFIG_H */
|
||||
|
|
|
@ -26,4 +26,12 @@
|
|||
*/
|
||||
#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
|
||||
|
||||
/*
|
||||
* Override heap size for PSA Crypto when RSA key size > 2048.
|
||||
*/
|
||||
#if TF_MBEDTLS_USE_RSA && TF_MBEDTLS_KEY_SIZE > 2048
|
||||
#undef TF_MBEDTLS_HEAP_SIZE
|
||||
#define TF_MBEDTLS_HEAP_SIZE U(12 * 1024)
|
||||
#endif
|
||||
|
||||
#endif /* PLAT_ARM_PSA_MBEDTLS_CONFIG_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue