Zephyr API Documentation 4.0.0-rc3
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
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
19#define ITS_UID (secure_storage_its_uid_t){.uid = uid, .caller_id = ITS_CALLER_ID}
22#include <psa/storage_common.h>
23
24#define PSA_ITS_API_VERSION_MAJOR 1
25#define PSA_ITS_API_VERSION_MINOR 0
26
48static ALWAYS_INLINE
51 const void *p_data, psa_storage_create_flags_t create_flags)
52{
53 return secure_storage_its_set(ITS_UID, data_length, p_data, create_flags);
54}
55
74static ALWAYS_INLINE
77 size_t data_size, void *p_data, size_t *p_data_length)
78{
79 return secure_storage_its_get(ITS_UID, data_offset, data_size, p_data, p_data_length);
80}
81
95static ALWAYS_INLINE
98{
99 return secure_storage_its_get_info(ITS_UID, p_info);
100}
101
116static ALWAYS_INLINE
122
123#undef ITS_UID
124#undef ITS_CALLER_ID
125
126#endif
#define ALWAYS_INLINE
Definition common.h:129
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:50
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:76
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_uid_t uid)
See psa_its_remove(), to which this function is analogous.
psa_status_t secure_storage_its_set(secure_storage_its_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.
psa_status_t secure_storage_its_get(secure_storage_its_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_uid_t uid, struct psa_storage_info_t *p_info)
See psa_its_get_info(), 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:26
uint64_t psa_storage_uid_t
UID type for identifying entries.
Definition storage_common.h:23
Metadata associated with a specific entry.
Definition storage_common.h:38
int32_t psa_status_t
Definition error.h:13