mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-31 10:20:45 +00:00
psa_crypto_core: take also cipher's key length into account when sizing static key buffer
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
5278ebd186
commit
7d7867fb44
@ -56,9 +56,12 @@ typedef enum {
|
|||||||
} psa_key_slot_state_t;
|
} psa_key_slot_state_t;
|
||||||
|
|
||||||
/* If the size of static key slots is not explicitly defined by the user, then
|
/* If the size of static key slots is not explicitly defined by the user, then
|
||||||
* set it to PSA_EXPORT_KEY_PAIR_OR_PUBLIC_MAX_SIZE. */
|
* set it to the maximum between PSA_EXPORT_KEY_PAIR_OR_PUBLIC_MAX_SIZE and
|
||||||
|
* PSA_CIPHER_MAX_KEY_LENGTH. */
|
||||||
#if !defined(MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE)
|
#if !defined(MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE)
|
||||||
#define MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE (PSA_EXPORT_KEY_PAIR_OR_PUBLIC_MAX_SIZE)
|
#define MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE \
|
||||||
|
(PSA_EXPORT_KEY_PAIR_OR_PUBLIC_MAX_SIZE > PSA_CIPHER_MAX_KEY_LENGTH) ? \
|
||||||
|
PSA_EXPORT_KEY_PAIR_OR_PUBLIC_MAX_SIZE : PSA_CIPHER_MAX_KEY_LENGTH
|
||||||
#endif /* !MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE*/
|
#endif /* !MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE*/
|
||||||
|
|
||||||
/** The data structure representing a key slot, containing key material
|
/** The data structure representing a key slot, containing key material
|
||||||
|
Loading…
x
Reference in New Issue
Block a user