1 /* Copyright (c) 2024 Nordic Semiconductor
2  * SPDX-License-Identifier: Apache-2.0
3  */
4 #ifndef SECURE_STORAGE_ITS_COMMON_H
5 #define SECURE_STORAGE_ITS_COMMON_H
6 
7 /** @file zephyr/secure_storage/its/common.h
8  * @brief Common definitions of the secure storage subsystem's ITS APIs.
9  */
10 #include "../common.h"
11 #include <zephyr/toolchain.h>
12 #include <psa/storage_common.h>
13 
14 /** @brief The ID of the caller from which the ITS API call originates.
15  * This is used to prevent ID collisions between different callers that are not aware
16  * of each other and so might use the same numerical IDs, e.g. PSA Crypto and PSA ITS.
17  */
18 typedef enum {
19 	SECURE_STORAGE_ITS_CALLER_PSA_ITS,
20 	SECURE_STORAGE_ITS_CALLER_PSA_PS,
21 	SECURE_STORAGE_ITS_CALLER_MBEDTLS,
22 	SECURE_STORAGE_ITS_CALLER_COUNT
23 } secure_storage_its_caller_id_t;
24 
25 /** The UID (caller + entry IDs) of an ITS entry. */
26 typedef struct {
27 	psa_storage_uid_t uid;
28 	secure_storage_its_caller_id_t caller_id;
29 } __packed secure_storage_its_uid_t;
30 
31 #endif
32