Allow alternative backends for crypto provider

The crypto service provider is refactored to make it easy to add
alternative backends.  There is still only a single backend that
uses the mbedcrypto library from MbedTLS.  However, all dependencies
from the crypto provider on mbedcrypto have been removed, allowing
the crypto provider to be used with alternative implementations
of the PSA Crypto API.

Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: Ic5d1d9d47d149b634d147712749fdee48f260d85
diff --git a/components/service/crypto/backend/mbedcrypto/component.cmake b/components/service/crypto/backend/mbedcrypto/component.cmake
new file mode 100644
index 0000000..4b531b7
--- /dev/null
+++ b/components/service/crypto/backend/mbedcrypto/component.cmake
@@ -0,0 +1,26 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+if (NOT DEFINED TGT)
+	message(FATAL_ERROR "mandatory parameter TGT is not defined.")
+endif()
+
+target_sources(${TGT} PRIVATE
+	"${CMAKE_CURRENT_LIST_DIR}/mbedcrypto_backend.c"
+	)
+
+# Force use of the mbed crypto configuration required by the crypto service
+# provider.  This configuration includes enabling the use of the PSA ITS API
+# for persistent key storage which is realised by the its client adapter
+# for the secure storage service.
+set(MBEDTLS_USER_CONFIG_FILE
+	"${CMAKE_CURRENT_LIST_DIR}/config_mbedtls_user.h"
+	CACHE STRING "Configuration file for Mbed TLS" FORCE)
+
+set(MBEDTLS_EXTRA_INCLUDES
+	"${TS_ROOT}/components/service/common/include"
+	"${TS_ROOT}/components/service/secure_storage/include"
+	CACHE STRING "PSA ITS for Mbed TLS" FORCE)