Crypto: The client side interface provides psa_can_do_hash()
Once TF-M Crypto has booted up, there isn't any hashing algorithm
that would require additional preparation steps hence everything
would be ready to be run, provided that the core or drivers are
built to support it, which could be investigated inspecting build
time options.
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: I0386e1c74589e8d48d35f2ad533f0ecfb966c7f4
diff --git a/interface/src/tfm_crypto_api.c b/interface/src/tfm_crypto_api.c
index f53fd1a..bd13bd1 100644
--- a/interface/src/tfm_crypto_api.c
+++ b/interface/src/tfm_crypto_api.c
@@ -1,10 +1,11 @@
/*
- * Copyright (c) 2018-2024, Arm Limited. All rights reserved.
+ * SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@@ -63,6 +64,16 @@
return PSA_SUCCESS;
}
+TFM_CRYPTO_API(int, psa_can_do_hash)(psa_algorithm_t hash_alg)
+{
+ (void)hash_alg;
+ /* There isn't any hashing algorithm that would not be ready
+ * to be used after TF-M has booted up, hence this function
+ * just returns success all the time
+ */
+ return (int)true;
+}
+
TFM_CRYPTO_API(psa_status_t, psa_open_key)(psa_key_id_t id,
psa_key_id_t *key)
{