mirror of
				https://github.com/Mbed-TLS/mbedtls.git
				synced 2025-10-30 10:45:34 +03: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:
		| @@ -56,9 +56,12 @@ typedef enum { | ||||
| } psa_key_slot_state_t; | ||||
|  | ||||
| /* 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) | ||||
| #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*/ | ||||
|  | ||||
| /** The data structure representing a key slot, containing key material | ||||
|   | ||||
		Reference in New Issue
	
	Block a user