Skip to content

Commit eb65181

Browse files
adeaarmtomi-font
authored andcommitted
Crypto: Add psa_can_do_cipher()
Similarly to what has been done for psa_can_do_hash() and for the same root cause, exposing the same behaviour. Signed-off-by: Antonio de Angelis <[email protected]> Change-Id: I09e6adfb718951b17c6d3bf77e6b7f5cd1135e0d (cherry picked from commit df80fc236f57050fd47a257beb16ad1f5a54b6cb)
1 parent 6a536fa commit eb65181

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

interface/src/tfm_crypto_api.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ TFM_CRYPTO_API(int, psa_can_do_hash)(psa_algorithm_t hash_alg)
7474
return (int)true;
7575
}
7676

77+
TFM_CRYPTO_API(int, psa_can_do_cipher)(psa_key_type_t key_type, psa_algorithm_t cipher_alg)
78+
{
79+
(void)cipher_alg;
80+
(void)key_type;
81+
/* There isn't any cipher algorithm that would not be ready
82+
* to be used after TF-M has booted up, hence this function
83+
* just returns success all the time
84+
*/
85+
return (int)true;
86+
}
87+
7788
TFM_CRYPTO_API(psa_status_t, psa_open_key)(psa_key_id_t id,
7889
psa_key_id_t *key)
7990
{

secure_fw/partitions/crypto/crypto_spe.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2021, Arm Limited. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
33
*
44
* SPDX-License-Identifier: BSD-3-Clause
55
*
@@ -26,6 +26,8 @@
2626
PSA_FUNCTION_NAME(psa_crypto_init)
2727
#define psa_can_do_hash \
2828
PSA_FUNCTION_NAME(psa_can_do_hash)
29+
#define psa_can_do_cipher \
30+
PSA_FUNCTION_NAME(psa_can_do_cipher)
2931
#define psa_key_derivation_get_capacity \
3032
PSA_FUNCTION_NAME(psa_key_derivation_get_capacity)
3133
#define psa_key_derivation_set_capacity \

0 commit comments

Comments
 (0)