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/platform/ext/common/cc312/crypto_hw.h b/platform/ext/common/cc312/crypto_hw.h
index 163070d..f0675dd 100644
--- a/platform/ext/common/cc312/crypto_hw.h
+++ b/platform/ext/common/cc312/crypto_hw.h
@@ -12,6 +12,13 @@
extern "C" {
#endif /* __cplusplus */
+/* The CC312 uses some the MBEDTLS heap buffer, so it needs increasing in size
+ * to allow attest crypto operations to still function.
+ */
+#ifndef TFM_CRYPTO_ENGINE_BUF_SIZE
+#define TFM_CRYPTO_ENGINE_BUF_SIZE (0x4000) /* 16KB for EC signing in attest */
+#endif
+
/**
* \brief Initialize the CC312 crypto accelerator
*
diff --git a/platform/ext/common/tfm_mbedcrypto_config.h b/platform/ext/common/tfm_mbedcrypto_config.h
index a63e471..13c6f14 100644
--- a/platform/ext/common/tfm_mbedcrypto_config.h
+++ b/platform/ext/common/tfm_mbedcrypto_config.h
@@ -3364,6 +3364,10 @@
*/
//#define MBEDTLS_PLATFORM_GMTIME_R_ALT
+#ifdef CRYPTO_HW_ACCELERATOR
+#include "mbedtls_accelerator_config.h"
+#endif
+
/* \} name SECTION: Customisation configuration options */
/* Target and application specific configurations