23#ifndef PSA_CRYPTO_SLOT_MANAGEMENT_H
24#define PSA_CRYPTO_SLOT_MANAGEMENT_H
27#include "psa_crypto_core.h"
28#include "psa_crypto_se.h"
32#define PSA_KEY_SLOT_COUNT 32
44#define PSA_KEY_ID_VOLATILE_MIN ( PSA_KEY_ID_VENDOR_MAX - \
45 PSA_KEY_SLOT_COUNT + 1 )
49#define PSA_KEY_ID_VOLATILE_MAX PSA_KEY_ID_VENDOR_MAX
60static inline int psa_key_id_is_volatile(
psa_key_id_t key_id )
148 if( slot->lock_count >= SIZE_MAX )
207 psa_se_drv_table_entry_t **p_drv );
Platform Security Architecture cryptography module.
int32_t psa_status_t
Function return status.
#define PSA_ERROR_CORRUPTION_DETECTED
A tampering attempt was detected.
#define PSA_SUCCESS
The action was completed successfully.
uint32_t psa_key_id_t
Encoding of identifiers of persistent keys.
#define PSA_KEY_LOCATION_LOCAL_STORAGE
The local storage area for persistent keys.
#define PSA_KEY_LIFETIME_GET_LOCATION(lifetime)
Get the location (see psa_key_location_t) from a psa_key_lifetime_t.
uint32_t psa_key_lifetime_t
Encoding of key lifetimes.
psa_key_id_t mbedtls_svc_key_id_t
Identifier for persistent keys.
#define PSA_KEY_ID_VOLATILE_MAX
The maximum value for a volatile key identifier.
psa_status_t psa_get_and_lock_key_slot(mbedtls_svc_key_id_t key, psa_key_slot_t **p_slot)
Get the description of a key given its identifier and lock it.
psa_status_t psa_validate_key_persistence(psa_key_lifetime_t lifetime)
Validate the persistence of a key.
#define PSA_KEY_ID_VOLATILE_MIN
Range of volatile key identifiers.
psa_status_t psa_unlock_key_slot(psa_key_slot_t *slot)
Unlock a key slot.
psa_status_t psa_validate_key_location(psa_key_lifetime_t lifetime, psa_se_drv_table_entry_t **p_drv)
Validate a key's location.
psa_status_t psa_validate_key_id(mbedtls_svc_key_id_t key, int vendor_ok)
Validate a key identifier.
void psa_wipe_all_key_slots(void)
Delete all data from key slots in memory.
psa_status_t psa_initialize_key_slots(void)
Initialize the key slot structures.
psa_status_t psa_get_empty_key_slot(psa_key_id_t *volatile_key_id, psa_key_slot_t **p_slot)
Find a free key slot.
The data structure representing a key slot, containing key material and metadata for one key.