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/crypto_init.c b/secure_fw/partitions/crypto/crypto_init.c
index ab02882..6a27117 100644
--- a/secure_fw/partitions/crypto/crypto_init.c
+++ b/secure_fw/partitions/crypto/crypto_init.c
@@ -455,12 +455,15 @@
out_vec,
&encoded_key);
} else if (TFM_CRYPTO_IS_GROUP_ID(
- iov->function_id, TFM_CRYPTO_GROUP_ID_ASYM_SIGN) ||
- TFM_CRYPTO_IS_GROUP_ID(
+ iov->function_id, TFM_CRYPTO_GROUP_ID_ASYM_SIGN)) {
+ status = tfm_crypto_asymmetric_sign_interface(in_vec,
+ out_vec,
+ &encoded_key);
+ } else if (TFM_CRYPTO_IS_GROUP_ID(
iov->function_id, TFM_CRYPTO_GROUP_ID_ASYM_ENCRYPT)) {
- status = tfm_crypto_asymmetric_interface(in_vec,
- out_vec,
- &encoded_key);
+ status = tfm_crypto_asymmetric_encrypt_interface(in_vec,
+ out_vec,
+ &encoded_key);
} else if (TFM_CRYPTO_IS_GROUP_ID(
iov->function_id, TFM_CRYPTO_GROUP_ID_KEY_DERIVATION)) {
status = tfm_crypto_key_derivation_interface(in_vec,