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/mbedcrypto_backend.c b/components/service/crypto/backend/mbedcrypto/mbedcrypto_backend.c
new file mode 100644
index 0000000..d9596bb
--- /dev/null
+++ b/components/service/crypto/backend/mbedcrypto/mbedcrypto_backend.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <service/crypto/backend/mbedcrypto/trng_adapter/trng_adapter.h>
+#include <service/secure_storage/frontend/psa/its/its_frontend.h>
+#include <psa/crypto.h>
+
+
+psa_status_t mbedcrypto_backend_init(struct storage_backend *storage_backend,
+						int trng_instance_num)
+{
+	psa_status_t status;
+
+	status = trng_adapter_init(trng_instance_num);
+
+	if (status == PSA_SUCCESS)
+		status = psa_its_frontend_init(storage_backend);
+
+	if (status == PSA_SUCCESS)
+		status = psa_crypto_init();
+
+	return status;
+}
+
+void mbedcrypto_backend_deinit(void)
+{
+	trng_adapter_deinit();
+}