Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
psa_drv_se_context_t Struct Reference
[Secure element driver initialization]
Driver context structure. More...
#include <crypto_se_driver.h>
Data Fields | |
| const void *const | persistent_data |
| A read-only pointer to the driver's persistent data. | |
| const size_t | persistent_data_size |
The size of persistent_data in bytes. | |
| uintptr_t | transient_data |
| Driver transient data. | |
Detailed Description
Driver context structure.
Driver functions receive a pointer to this structure. Each registered driver has one instance of this structure.
Implementations must include the fields specified here and may include other fields.
Definition at line 55 of file crypto_se_driver.h.
Field Documentation
| const void* const persistent_data |
A read-only pointer to the driver's persistent data.
Drivers typically use this persistent data to keep track of which slot numbers are available. This is only a guideline: drivers may use the persistent data for any purpose, keeping in mind the restrictions on when the persistent data is saved to storage: the persistent data is only saved after calling certain functions that receive a writable pointer to the persistent data.
The core allocates a memory buffer for the persistent data. The pointer is guaranteed to be suitably aligned for any data type, like a pointer returned by `malloc` (but the core can use any method to allocate the buffer, not necessarily `malloc`).
The size of this buffer is in the persistent_data_size field of this structure.
Before the driver is initialized for the first time, the content of the persistent data is all-bits-zero. After a driver upgrade, if the size of the persistent data has increased, the original data is padded on the right with zeros; if the size has decreased, the original data is truncated to the new size.
This pointer is to read-only data. Only a few driver functions are allowed to modify the persistent data. These functions receive a writable pointer. These functions are:
The PSA Cryptography core saves the persistent data from one session to the next. It does this before returning from API functions that call a driver method that is allowed to modify the persistent data, specifically:
- psa_crypto_init() causes a call to psa_drv_se_t::p_init, and may call psa_drv_se_key_management_t::p_destroy to complete an action that was interrupted by a power failure.
- Key creation functions cause a call to psa_drv_se_key_management_t::p_allocate, and may cause a call to psa_drv_se_key_management_t::p_destroy in case an error occurs.
- psa_destroy_key() causes a call to psa_drv_se_key_management_t::p_destroy.
Definition at line 100 of file crypto_se_driver.h.
| const size_t persistent_data_size |
The size of persistent_data in bytes.
This is always equal to the value of the `persistent_data_size` field of the psa_drv_se_t structure when the driver is registered.
Definition at line 107 of file crypto_se_driver.h.
| uintptr_t transient_data |
Driver transient data.
The core initializes this value to 0 and does not read or modify it afterwards. The driver may store whatever it wants in this field.
Definition at line 114 of file crypto_se_driver.h.
Generated on Tue Jul 12 2022 13:55:35 by
1.7.2