Crypto: Use uniform signatures
This patch amends the Crypto service to use the
Uniform Signatures interfaces supported by TF-M.
Change-Id: Ia1e269075bf94e1d60281da789dd43bb2be3f265
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/secure_fw/services/crypto/crypto_init.c b/secure_fw/services/crypto/crypto_init.c
index 083ce84..1ec7dee 100644
--- a/secure_fw/services/crypto/crypto_init.c
+++ b/secure_fw/services/crypto/crypto_init.c
@@ -5,35 +5,31 @@
*
*/
-#include "tfm_crypto_defs.h"
-#include "crypto_engine.h"
#include "tfm_crypto_api.h"
+#include "crypto_engine.h"
-static enum tfm_crypto_err_t tfm_crypto_module_init(void)
+static psa_status_t tfm_crypto_module_init(void)
{
- enum tfm_crypto_err_t err;
+ psa_status_t status = PSA_SUCCESS;
/* Init the Key module */
- err = tfm_crypto_init_key();
- if (err != TFM_CRYPTO_ERR_PSA_SUCCESS) {
- return err;
+ status = tfm_crypto_init_key();
+ if (status != PSA_SUCCESS) {
+ return status;
}
/* Init the Alloc module */
- err = tfm_crypto_init_alloc();
-
- return err;
+ return tfm_crypto_init_alloc();
}
-enum tfm_crypto_err_t tfm_crypto_init(void)
+psa_status_t tfm_crypto_init(void)
{
psa_status_t status;
- enum tfm_crypto_err_t err;
/* Initialise other modules of the service */
- err = tfm_crypto_module_init();
- if (err != TFM_CRYPTO_ERR_PSA_SUCCESS) {
- return err;
+ status = tfm_crypto_module_init();
+ if (status != PSA_SUCCESS) {
+ return status;
}
/* Initialise the engine interface module */
@@ -44,8 +40,8 @@
* without triggering any TF-M recovery mechanism during boot-up if it
* recognises that a service has not completed booting correctly.
*/
- return TFM_CRYPTO_ERR_PSA_SUCCESS;
+ return PSA_SUCCESS;
}
- return TFM_CRYPTO_ERR_PSA_SUCCESS;
+ return PSA_SUCCESS;
}