blob: 4f6ba2a7d822c4f0e962b41e57341da146370a59 [file] [log] [blame]
Balint Dobszay8b6e6862020-11-23 18:12:54 +01001/*
2 * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef PSA_STORAGE_COMMON_H
8#define PSA_STORAGE_COMMON_H
9
10#include <psa/error.h>
11#include <stddef.h>
12#include <stdint.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/* Types */
19typedef uint64_t psa_storage_uid_t;
20typedef uint32_t psa_storage_create_flags_t;
21
22struct psa_storage_info_t {
23 size_t capacity;
24 size_t size;
25 psa_storage_create_flags_t flags;
26};
27
28/* Storage flags */
29#define PSA_STORAGE_FLAG_NONE (0u)
30#define PSA_STORAGE_FLAG_WRITE_ONCE (1u << 0)
31#define PSA_STORAGE_FLAG_NO_CONFIDENTIALITY (1u << 1)
32#define PSA_STORAGE_FLAG_NO_REPLAY_PROTECTION (1u << 2)
33#define PSA_STORAGE_SUPPORT_SET_EXTENDED (1u << 0)
34
35/* Status codes */
36#define PSA_ERROR_INVALID_SIGNATURE ((psa_status_t)-149)
37#define PSA_ERROR_DATA_CORRUPT ((psa_status_t)-152)
38
39#ifdef __cplusplus
40}
41#endif
42
43#endif /* PSA_STORAGE_COMMON_H */