Crypto: Enable CC312 runtime library
Enable in cmake. Update mbedtls config to use hardware functions. Add
init function.
Change-Id: I874999056d62c8855c1d934a33d4ab4c5c74c569
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/secure_fw/services/crypto/crypto_init.c b/secure_fw/services/crypto/crypto_init.c
index bdb99e4..b3acd55 100644
--- a/secure_fw/services/crypto/crypto_init.c
+++ b/secure_fw/services/crypto/crypto_init.c
@@ -20,6 +20,10 @@
#include "tfm_secure_api.h"
#endif
+#ifdef CRYPTO_HW_ACCELERATOR
+#include "crypto_hw.h"
+#endif /* CRYPTO_HW_ACCLERATOR */
+
#ifdef TFM_PSA_API
#include "psa/service.h"
#include "psa_manifest/tfm_crypto.h"
@@ -282,6 +286,13 @@
mbedtls_memory_buffer_alloc_init(mbedtls_mem_buf,
TFM_CRYPTO_ENGINE_BUF_SIZE);
+ /* Initialise the crypto accelerator if one is enabled */
+#ifdef CRYPTO_HW_ACCELERATOR
+ if (crypto_hw_accelerator_init() != 0) {
+ return PSA_ERROR_HARDWARE_FAILURE;
+ }
+#endif /* CRYPTO_HW_ACCELERATOR */
+
/* Previous function does not return any value, so just call the
* initialisation function of the Mbed Crypto layer
*/