![]() |
TF-M Reference Manual
1.2.0
TrustedFirmware-M
|
#include "ps_encrypted_object.h"
#include <stddef.h>
#include "crypto/ps_crypto_interface.h"
#include "psa/internal_trusted_storage.h"
#include "tfm_memory_utils.h"
#include "ps_object_defs.h"
#include "ps_utils.h"
Go to the source code of this file.
Macros | |
#define | PS_ENCRYPT_SIZE(plaintext_size) ((plaintext_size) + PS_OBJECT_HEADER_SIZE - sizeof(union ps_crypto_t)) |
#define | PS_OBJECT_START_POSITION 0 |
#define | PS_MAX_ENCRYPTED_OBJ_SIZE PS_ENCRYPT_SIZE(PS_MAX_OBJECT_DATA_SIZE) |
#define | PS_CRYPTO_BUF_LEN (PS_MAX_ENCRYPTED_OBJ_SIZE + PS_TAG_LEN_BYTES) |
Functions | |
psa_status_t | ps_encrypted_object_read (uint32_t fid, struct ps_object_t *obj) |
Reads object referenced by the object File ID. More... | |
psa_status_t | ps_encrypted_object_write (uint32_t fid, struct ps_object_t *obj) |
Creates and writes a new encrypted object based on the given ps_object_t structure data. More... | |
#define PS_CRYPTO_BUF_LEN (PS_MAX_ENCRYPTED_OBJ_SIZE + PS_TAG_LEN_BYTES) |
Definition at line 31 of file ps_encrypted_object.c.
#define PS_ENCRYPT_SIZE | ( | plaintext_size | ) | ((plaintext_size) + PS_OBJECT_HEADER_SIZE - sizeof(union ps_crypto_t)) |
Definition at line 19 of file ps_encrypted_object.c.
#define PS_MAX_ENCRYPTED_OBJ_SIZE PS_ENCRYPT_SIZE(PS_MAX_OBJECT_DATA_SIZE) |
Definition at line 26 of file ps_encrypted_object.c.
#define PS_OBJECT_START_POSITION 0 |
Definition at line 22 of file ps_encrypted_object.c.
psa_status_t ps_encrypted_object_read | ( | uint32_t | fid, |
struct ps_object_t * | obj | ||
) |
Reads object referenced by the object File ID.
[in] | fid | File ID |
[out] | obj | Pointer to the object structure to fill in |
Definition at line 135 of file ps_encrypted_object.c.
psa_status_t ps_encrypted_object_write | ( | uint32_t | fid, |
struct ps_object_t * | obj | ||
) |
Creates and writes a new encrypted object based on the given ps_object_t structure data.
[in] | fid | File ID |
[in,out] | obj | Pointer to the object structure to write. |
Note: The function will use obj to store the encrypted data before write it into the flash to reduce the memory requirements and the number of internal copies. So, this object will contain the encrypted object stored in the flash.
Definition at line 162 of file ps_encrypted_object.c.