Profiles: Optimize Crypto memory footprint in Profile Small
Optimize the memory footprint required by Crypto service in Profile
Small.
- Decrease the MAX number of concurrent multi-part operations to 4.
- Decrease the heap size used in backend crypto library since asymmetric
cryptography is disabled.
Change-Id: If1b8d4b6cef098e132bd891a140be278993bf6c2
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/config/profile/profile_small.cmake b/config/profile/profile_small.cmake
index 587db62..ab71cc0f 100644
--- a/config/profile/profile_small.cmake
+++ b/config/profile/profile_small.cmake
@@ -19,6 +19,12 @@
set(ITS_BUF_SIZE 32 CACHE STRING "Size of the ITS internal data transfer buffer (defaults to ITS_MAX_ASSET_SIZE if not set)")
+set(CRYPTO_CONC_OPER_NUM 4 CACHE STRING "The max number of concurrent operations that can be active (allocated) at any time in Crypto")
+# Profile Small assigns a much smller heap size for backend crypto library as
+# asymmetric cryptography is not enabled.
+# Assign 0x200 bytes for each operation and totally 0x800 byets for max 4
+# concurrent operation as set in CRYPTO_CONC_OPER_NUM above
+set(CRYPTO_ENGINE_BUF_SIZE 0x800 CACHE STRING "Heap size for the crypto backend")
set(CRYPTO_ASYM_SIGN_MODULE_DISABLED ON CACHE BOOL "Disable PSA Crypto asymmetric key signature module")
set(CRYPTO_ASYM_ENCRYPT_MODULE_DISABLED ON CACHE BOOL "Disable PSA Crypto asymmetric key encryption module")