Crypto: Add option to disable separate modules
This patch introduces the configuration option in
the Crypto service to allow disabling at build time
of different submodules, such as Cipher, Hash, Mac,
Generator, Aead and Asymmetric.
Change-Id: I3ccfde15cfe2cb6fd540815ad4a47fb24a98ada9
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/secure_fw/services/crypto/crypto_aead.c b/secure_fw/services/crypto/crypto_aead.c
index 383b0eb..80fc205 100644
--- a/secure_fw/services/crypto/crypto_aead.c
+++ b/secure_fw/services/crypto/crypto_aead.c
@@ -29,6 +29,9 @@
psa_outvec out_vec[],
size_t out_len)
{
+#if (TFM_CRYPTO_AEAD_MODULE_DISABLED != 0)
+ return PSA_ERROR_NOT_SUPPORTED;
+#else
psa_status_t status = PSA_SUCCESS;
if ( !((in_len == 2) || (in_len == 3)) || (out_len != 1)) {
@@ -70,6 +73,7 @@
}
return status;
+#endif /* TFM_CRYPTO_AEAD_MODULE_DISABLED */
}
psa_status_t tfm_crypto_aead_decrypt(psa_invec in_vec[],
@@ -77,6 +81,9 @@
psa_outvec out_vec[],
size_t out_len)
{
+#if (TFM_CRYPTO_AEAD_MODULE_DISABLED != 0)
+ return PSA_ERROR_NOT_SUPPORTED;
+#else
psa_status_t status = PSA_SUCCESS;
if ( !((in_len == 2) || (in_len == 3)) || (out_len > 1)) {
@@ -118,5 +125,6 @@
}
return status;
+#endif /* TFM_CRYPTO_AEAD_MODULE_DISABLED */
}
/*!@}*/