Crypto: Refine how crypto modules are selected
Crypto modules can be only enable/disable by setting the
CRYPTO_XXX_MODULE_DISABLED to 0/1.
This patch refines how the modules are selected. With this patch,
the crypto modules can be enabled/disabled by setting the
CRYPTO_XXX_MODULE_DISABLED to 0/1, OFF/ON or FALSE/TRUE, not
limited to 0/1 anymore.
Change-Id: I4f5ea82805760883639950cd6031cbf658cb0bfc
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/services/crypto/crypto_hash.c b/secure_fw/services/crypto/crypto_hash.c
index 42e8a2b..97d7ad2 100644
--- a/secure_fw/services/crypto/crypto_hash.c
+++ b/secure_fw/services/crypto/crypto_hash.c
@@ -29,7 +29,7 @@
psa_outvec out_vec[],
size_t out_len)
{
-#if (TFM_CRYPTO_HASH_MODULE_DISABLED != 0)
+#ifdef TFM_CRYPTO_HASH_MODULE_DISABLED
return PSA_ERROR_NOT_SUPPORTED;
#else
psa_status_t status = PSA_SUCCESS;
@@ -77,7 +77,7 @@
psa_outvec out_vec[],
size_t out_len)
{
-#if (TFM_CRYPTO_HASH_MODULE_DISABLED != 0)
+#ifdef TFM_CRYPTO_HASH_MODULE_DISABLED
return PSA_ERROR_NOT_SUPPORTED;
#else
psa_status_t status = PSA_SUCCESS;
@@ -124,7 +124,7 @@
psa_outvec out_vec[],
size_t out_len)
{
-#if (TFM_CRYPTO_HASH_MODULE_DISABLED != 0)
+#ifdef TFM_CRYPTO_HASH_MODULE_DISABLED
return PSA_ERROR_NOT_SUPPORTED;
#else
psa_status_t status = PSA_SUCCESS;
@@ -176,7 +176,7 @@
psa_outvec out_vec[],
size_t out_len)
{
-#if (TFM_CRYPTO_HASH_MODULE_DISABLED != 0)
+#ifdef TFM_CRYPTO_HASH_MODULE_DISABLED
return PSA_ERROR_NOT_SUPPORTED;
#else
psa_status_t status = PSA_SUCCESS;
@@ -225,7 +225,7 @@
psa_outvec out_vec[],
size_t out_len)
{
-#if (TFM_CRYPTO_HASH_MODULE_DISABLED != 0)
+#ifdef TFM_CRYPTO_HASH_MODULE_DISABLED
return PSA_ERROR_NOT_SUPPORTED;
#else
psa_status_t status = PSA_SUCCESS;
@@ -273,7 +273,7 @@
psa_outvec out_vec[],
size_t out_len)
{
-#if (TFM_CRYPTO_HASH_MODULE_DISABLED != 0)
+#ifdef TFM_CRYPTO_HASH_MODULE_DISABLED
return PSA_ERROR_NOT_SUPPORTED;
#else
psa_status_t status = PSA_SUCCESS;