24 #ifndef TFM_CRYPTO_CONC_OPER_NUM
25 #define TFM_CRYPTO_CONC_OPER_NUM (8)
52 static void memset_operation_context(uint32_t index)
56 uint8_t *mem_ptr = (uint8_t *) &(operation[index].operation);
58 switch(operation[index].
type) {
90 (void)
tfm_memset(operation, 0,
sizeof(operation));
99 int32_t partition_id = 0;
121 operation[i].owner = partition_id;
122 operation[i].type =
type;
124 *ctx = (
void *) &(operation[i].operation);
134 uint32_t h_val = *handle;
135 int32_t partition_id = 0;
146 (operation[h_val - 1].
owner == partition_id)) {
148 memset_operation_context(h_val - 1);
151 operation[h_val - 1].owner = 0;
163 int32_t partition_id = 0;
174 (operation[handle - 1].type == type) &&
175 (operation[handle - 1].
owner == partition_id)) {
177 *ctx = (
void *) &(operation[handle - 1].operation);
__STATIC_INLINE void * tfm_memset(void *ptr, int value, size_t num)
psa_status_t tfm_crypto_operation_alloc(enum tfm_crypto_operation_type type, uint32_t *handle, void **ctx)
Allocate an operation context in the backend.
#define TFM_CRYPTO_INVALID_HANDLE
This value is used to mark an handle as invalid.
psa_status_t tfm_crypto_get_caller_id(int32_t *id)
Returns the ID of the caller.
psa_status_t tfm_crypto_operation_release(uint32_t *handle)
Release an operation context in the backend.
#define PSA_ERROR_INVALID_ARGUMENT
#define PSA_ERROR_NOT_PERMITTED
struct psa_hash_operation_s psa_hash_operation_t
union tfm_crypto_operation_s::@8 operation
struct psa_key_derivation_s psa_key_derivation_operation_t
struct psa_cipher_operation_s psa_cipher_operation_t
psa_status_t tfm_crypto_init_alloc(void)
Initialise the Alloc module.
psa_cipher_operation_t cipher
tfm_crypto_operation_type
List of possible operation types supported by the TFM based implementation. This type is needed by th...
#define PSA_ERROR_BAD_STATE
psa_hash_operation_t hash
psa_key_derivation_operation_t key_deriv
psa_status_t tfm_crypto_operation_lookup(enum tfm_crypto_operation_type type, uint32_t handle, void **ctx)
Look up an operation context in the backend for the corresponding frontend operation.
int32_t psa_status_t
Function return status.
struct psa_mac_operation_s psa_mac_operation_t
#define TFM_CRYPTO_CONC_OPER_NUM
This is the default value for the maximum number of concurrent operations that can be active (allocat...
enum tfm_crypto_operation_type type