Crypto: Implement each interface as empty if not used
If a Crypto module is disabled, implement its interface as empty to
return PSA_ERROR_NOT_SUPPORTED only, instead of still keeping the whole
switch/case block.
Split asymmetric interface into asymmetric signing and asymmetric
encryption to better optimize their interface.
Also fix the typo of asymmetric algorithm control flag.
Change-Id: Ic55a38e2d2fc0784d6ae1e45db3cbb0cfafc235c
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/secure_fw/partitions/crypto/tfm_crypto_api.h b/secure_fw/partitions/crypto/tfm_crypto_api.h
index ef26901..ca8b862 100644
--- a/secure_fw/partitions/crypto/tfm_crypto_api.h
+++ b/secure_fw/partitions/crypto/tfm_crypto_api.h
@@ -260,8 +260,9 @@
psa_status_t tfm_crypto_aead_interface(psa_invec in_vec[],
psa_outvec out_vec[],
mbedtls_svc_key_id_t *encoded_key);
+
/**
- * \brief This function acts as interface for the Asymmetric module
+ * \brief This function acts as interface for the Asymmetric signing module
*
* \param[in] in_vec Array of invec parameters
* \param[out] out_vec Array of outvec parameters
@@ -269,9 +270,23 @@
*
* \return Return values as described in \ref psa_status_t
*/
-psa_status_t tfm_crypto_asymmetric_interface(psa_invec in_vec[],
- psa_outvec out_vec[],
+psa_status_t tfm_crypto_asymmetric_sign_interface(psa_invec in_vec[],
+ psa_outvec out_vec[],
mbedtls_svc_key_id_t *encoded_key);
+
+/**
+ * \brief This function acts as interface for the Asymmetric encryption module
+ *
+ * \param[in] in_vec Array of invec parameters
+ * \param[out] out_vec Array of outvec parameters
+ * \param[in] encoded_key Key encoded with partition_id and key_id
+ *
+ * \return Return values as described in \ref psa_status_t
+ */
+psa_status_t tfm_crypto_asymmetric_encrypt_interface(psa_invec in_vec[],
+ psa_outvec out_vec[],
+ mbedtls_svc_key_id_t *encoded_key);
+
/**
* \brief This function acts as interface for the Key derivation module
*