Crypto: Add alternatives of mbed-crypto implementations
Select MBEDTLS_AES_SETKEY_DEC_ALT and MBEDTLS_AES_DECRYPT_ALTA when
AES-CCM is selected.
Add emtpy wrappers of mbedtls_internal_aes_decrypt() and
mbedtls_aes_setkey_dec() to replace mbed-crypto implementation when
the MBEDTLS_AES_SETKEY_DEC_ALT and MBEDTLS_AES_DECRYPT_ALTA are
enabled in AES-CCM mode. It can decrease memory footprint.
Add description of tfm_mbedcrypto_alt.c in Crypto document.
Change-Id: I3b9071735bfd6bafea8189dfde153d6050aefe27
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/secure_fw/services/crypto/CMakeLists.inc b/secure_fw/services/crypto/CMakeLists.inc
index c6bb1f8..09c53bb 100644
--- a/secure_fw/services/crypto/CMakeLists.inc
+++ b/secure_fw/services/crypto/CMakeLists.inc
@@ -53,6 +53,10 @@
"${CRYPTO_DIR}/tfm_crypto_secure_api.c"
)
+ if (CRYPTO_ENGINE_MBEDTLS)
+ list(APPEND CRYPTO_C_SRC "${CRYPTO_DIR}/tfm_mbedcrypto_alt.c")
+ endif()
+
#Append all our source files to global lists.
list(APPEND ALL_SRC_C ${CRYPTO_C_SRC})
unset(CRYPTO_C_SRC)