Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
internal_trusted_storage.h
Go to the documentation of this file.
1/* Copyright (c) 2024 Nordic Semiconductor
2 * SPDX-License-Identifier: Apache-2.0
3 */
4#ifndef PSA_INTERNAL_TRUSTED_STORAGE_H
5#define PSA_INTERNAL_TRUSTED_STORAGE_H
6
11
14#ifdef BUILDING_MBEDTLS_CRYPTO
15#define ITS_CALLER_ID SECURE_STORAGE_ITS_CALLER_MBEDTLS
16#else
17#define ITS_CALLER_ID SECURE_STORAGE_ITS_CALLER_PSA_ITS
18#endif
20
21#include <psa/storage_common.h>
22
23#define PSA_ITS_API_VERSION_MAJOR 1
24#define PSA_ITS_API_VERSION_MINOR 0
25
47static ALWAYS_INLINE
50 const void *p_data, psa_storage_create_flags_t create_flags)
51{
52 return secure_storage_its_set(ITS_CALLER_ID, uid, data_length, p_data, create_flags);
53}
54
73static ALWAYS_INLINE
76 size_t data_size, void *p_data, size_t *p_data_length)
77{
78 return secure_storage_its_get(ITS_CALLER_ID, uid, data_offset,
79 data_size, p_data, p_data_length);
80}
81
95static ALWAYS_INLINE
98{
99 return secure_storage_its_get_info(ITS_CALLER_ID, uid, p_info);
100}
101
116static ALWAYS_INLINE
119{
120 return secure_storage_its_remove(ITS_CALLER_ID, uid);
121}
122
123#undef ITS_UID
124#undef ITS_CALLER_ID
125
126#endif
#define ALWAYS_INLINE
Definition common.h:160
psa_status_t psa_its_set(psa_storage_uid_t uid, size_t data_length, const void *p_data, psa_storage_create_flags_t create_flags)
Creates a new or modifies an existing entry.
Definition internal_trusted_storage.h:49
psa_status_t psa_its_get(psa_storage_uid_t uid, size_t data_offset, size_t data_size, void *p_data, size_t *p_data_length)
Retrieves data associated with the provided uid.
Definition internal_trusted_storage.h:75
psa_status_t psa_its_remove(psa_storage_uid_t uid)
Removes the provided uid and its associated data.
Definition internal_trusted_storage.h:118
psa_status_t psa_its_get_info(psa_storage_uid_t uid, struct psa_storage_info_t *p_info)
Retrieves the metadata of a given entry.
Definition internal_trusted_storage.h:97
The secure storage ITS implementation.
psa_status_t secure_storage_its_remove(secure_storage_its_caller_id_t caller_id, psa_storage_uid_t uid)
See psa_its_remove(), to which this function is analogous.
psa_status_t secure_storage_its_get(secure_storage_its_caller_id_t caller_id, psa_storage_uid_t uid, size_t data_offset, size_t data_size, void *p_data, size_t *p_data_length)
See psa_its_get(), to which this function is analogous.
psa_status_t secure_storage_its_get_info(secure_storage_its_caller_id_t caller_id, psa_storage_uid_t uid, struct psa_storage_info_t *p_info)
See psa_its_get_info(), to which this function is analogous.
psa_status_t secure_storage_its_set(secure_storage_its_caller_id_t caller_id, psa_storage_uid_t uid, size_t data_length, const void *p_data, psa_storage_create_flags_t create_flags)
See psa_its_set(), to which this function is analogous.
Common definitions of the PSA Secure Storage API.
uint32_t psa_storage_create_flags_t
Flags used when creating an entry.
Definition storage_common.h:30
uint32_t psa_storage_uid_t
UID type for identifying entries.
Definition storage_common.h:26
Metadata associated with a specific entry.
Definition storage_common.h:42
int32_t psa_status_t
Definition error.h:13