From 7976574f82897a0cb87a07ea121176e194f5ec5e Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Fri, 8 Jan 2021 18:16:47 +0100 Subject: [PATCH] Allow tweaking PSA_KEY_SLOT_COUNT Signed-off-by: Steven Cooreman --- ChangeLog.d/psa_allow_tweaking_library_configuration.txt | 5 +++++ library/psa_crypto_slot_management.h | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 ChangeLog.d/psa_allow_tweaking_library_configuration.txt diff --git a/ChangeLog.d/psa_allow_tweaking_library_configuration.txt b/ChangeLog.d/psa_allow_tweaking_library_configuration.txt new file mode 100644 index 0000000000..3ab88d6e39 --- /dev/null +++ b/ChangeLog.d/psa_allow_tweaking_library_configuration.txt @@ -0,0 +1,5 @@ +Features + * The PSA crypto subsystem can now be configured to use less static RAM by + tweaking the setting for the maximum amount of keys simultaneously in RAM. + PSA_KEY_SLOT_COUNT sets the maximum number of volatile keys that can + exist simultaneously. It has a sensible default if not overridden. diff --git a/library/psa_crypto_slot_management.h b/library/psa_crypto_slot_management.h index ef0814ac9e..32ccd4982b 100644 --- a/library/psa_crypto_slot_management.h +++ b/library/psa_crypto_slot_management.h @@ -27,7 +27,9 @@ /* Number of key slots (plus one because 0 is not used). * The value is a compile-time constant for now, for simplicity. */ +#if !defined(PSA_KEY_SLOT_COUNT) #define PSA_KEY_SLOT_COUNT 32 +#endif /** Range of volatile key identifiers. *