TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_crypto_api.h File Reference
#include <stdint.h>
#include "tfm_crypto_defs.h"
#include "psa/crypto_client_struct.h"
Include dependency graph for tfm_crypto_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define UNIFORM_SIGNATURE_API(api_name)   psa_status_t api_name(psa_invec[], size_t, psa_outvec[], size_t)
 
#define LIST_TFM_CRYPTO_UNIFORM_SIGNATURE_API
 
#define X(api_name)   UNIFORM_SIGNATURE_API(api_name);
 

Enumerations

enum  tfm_crypto_operation_type {
  TFM_CRYPTO_OPERATION_NONE = 0, TFM_CRYPTO_CIPHER_OPERATION = 1, TFM_CRYPTO_MAC_OPERATION = 2, TFM_CRYPTO_HASH_OPERATION = 3,
  TFM_CRYPTO_KEY_DERIVATION_OPERATION = 4, TFM_CRYPTO_OPERATION_TYPE_MAX = INT_MAX
}
 List of possible operation types supported by the TFM based implementation. This type is needed by the operation allocation, lookup and release functions. More...
 

Functions

psa_status_t tfm_crypto_init (void)
 Initialise the service. More...
 
psa_status_t tfm_crypto_init_alloc (void)
 Initialise the Alloc module. More...
 
psa_status_t tfm_crypto_get_caller_id (int32_t *id)
 Returns the ID of the caller. More...
 
psa_status_t tfm_crypto_key_attributes_from_client (const struct psa_client_key_attributes_s *client_key_attr, int32_t client_id, psa_key_attributes_t *key_attributes)
 Gets key attributes from client key attributes. More...
 
psa_status_t tfm_crypto_key_attributes_to_client (const psa_key_attributes_t *key_attributes, struct psa_client_key_attributes_s *client_key_attr)
 Converts key attributes to client key attributes. More...
 
psa_status_t tfm_crypto_check_handle_owner (psa_key_handle_t handle, uint32_t *index)
 Checks that the requested handle belongs to the requesting partition. More...
 
psa_status_t tfm_crypto_check_key_storage (uint32_t *index)
 Checks that there is enough local storage in RAM to keep another key, and returns the index of the storage to use. More...
 
psa_status_t tfm_crypto_set_key_storage (uint32_t index, psa_key_handle_t key_handle)
 Sets the index of the local storage in use with a key requested by the calling partition, and stores the corresponding key_handle. More...
 
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. More...
 
psa_status_t tfm_crypto_operation_release (uint32_t *handle)
 Release an operation context in the backend. More...
 
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. More...
 
psa_status_t tfm_crypto_get_key_attributes (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_reset_key_attributes (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_open_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_close_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_import_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_destroy_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_export_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_export_public_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_copy_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_hash_compute (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_hash_compare (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_hash_setup (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_hash_update (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_hash_finish (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_hash_verify (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_hash_abort (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_hash_clone (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_mac_compute (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_mac_verify (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_mac_sign_setup (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_mac_verify_setup (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_mac_update (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_mac_sign_finish (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_mac_verify_finish (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_mac_abort (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_cipher_encrypt (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_cipher_decrypt (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_cipher_encrypt_setup (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_cipher_decrypt_setup (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_cipher_generate_iv (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_cipher_set_iv (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_cipher_update (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_cipher_finish (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_cipher_abort (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_encrypt (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_decrypt (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_encrypt_setup (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_decrypt_setup (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_generate_nonce (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_set_nonce (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_set_lengths (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_update_ad (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_update (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_finish (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_verify (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_aead_abort (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_sign_hash (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_verify_hash (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_asymmetric_encrypt (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_asymmetric_decrypt (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_key_derivation_setup (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_key_derivation_get_capacity (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_key_derivation_set_capacity (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_key_derivation_input_bytes (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_key_derivation_input_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_key_derivation_key_agreement (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_key_derivation_output_bytes (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_key_derivation_output_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_key_derivation_abort (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_raw_key_agreement (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_generate_random (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_generate_key (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_set_key_domain_parameters (psa_invec[], size_t, psa_outvec[], size_t)
 
psa_status_t tfm_crypto_get_key_domain_parameters (psa_invec[], size_t, psa_outvec[], size_t)
 

Macro Definition Documentation

#define LIST_TFM_CRYPTO_UNIFORM_SIGNATURE_API

Definition at line 168 of file tfm_crypto_api.h.

#define UNIFORM_SIGNATURE_API (   api_name)    psa_status_t api_name(psa_invec[], size_t, psa_outvec[], size_t)

Definition at line 29 of file tfm_crypto_api.h.

#define X (   api_name)    UNIFORM_SIGNATURE_API(api_name);

Definition at line 234 of file tfm_crypto_api.h.

Enumeration Type Documentation

List of possible operation types supported by the TFM based implementation. This type is needed by the operation allocation, lookup and release functions.

Enumerator
TFM_CRYPTO_OPERATION_NONE 
TFM_CRYPTO_CIPHER_OPERATION 
TFM_CRYPTO_MAC_OPERATION 
TFM_CRYPTO_HASH_OPERATION 
TFM_CRYPTO_KEY_DERIVATION_OPERATION 
TFM_CRYPTO_OPERATION_TYPE_MAX 

Definition at line 38 of file tfm_crypto_api.h.

Function Documentation

psa_status_t tfm_crypto_get_caller_id ( int32_t *  id)

Returns the ID of the caller.

Parameters
[out]idPointer to hold the ID of the caller
Returns
Return values as described in psa_status_t

Definition at line 314 of file crypto_init.c.

Here is the call graph for this function:

Here is the caller graph for this function:

psa_status_t tfm_crypto_init ( void  )

Initialise the service.

Returns
Return values as described in psa_status_t

Definition at line 330 of file crypto_init.c.