Skip to content

Commit 24bf3aa

Browse files
tomi-fontjukkar
authored andcommitted
[nrf fromlist] doc: secure_storage: document the 30-bit UID
Add a bullet point for this new, relatively important deviation from the official specification. Also, advertise the Zephyr-specific zephyr/psa/* header files as they are related and probably need more attention from end users. Signed-off-by: Tomi Fontanilles <[email protected]> Upstream PR #: 94171 (cherry picked from commit 804a1d5)
1 parent 15361d2 commit 24bf3aa

File tree

2 files changed

+11
-1
lines changed
  • doc/services/storage/secure_storage
  • subsys/secure_storage/include/internal/zephyr/secure_storage/its

2 files changed

+11
-1
lines changed

doc/services/storage/secure_storage/index.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,18 @@ The secure storage subsystem's implementation of the PSA Secure Storage API:
4343
Instead, the PS API directly calls into the Internal Trusted Storage (ITS) API
4444
(unless a `custom implementation <#whole-api>`_ of the PS API is provided).
4545

46-
Below are some ways the implementation deviates from the specification
46+
Below are some ways the implementation purposefully deviates from the specification
4747
and an explanation why. This is not an exhaustive list.
4848

49+
* The UID type is only 30 bits by default. (Against `2.5 UIDs <https://arm-software.github.io/psa-api/storage/1.0/overview/architecture.html#uids>`_.)
50+
51+
| This is an optimization done to make it more convenient to directly use the UIDs as
52+
storage entry IDs (e.g., with :ref:`ZMS <zms_api>` when
53+
:kconfig:option:`CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS` is enabled).
54+
| Zephyr defines numerical ranges to be used by different users of the API which guarantees that
55+
there are no collisions and that they all fit within 30 bits.
56+
See the header files in :zephyr_file:`include/zephyr/psa` for more information.
57+
4958
* The data stored in the ITS is by default encrypted and authenticated (Against ``1.`` in
5059
`3.2. Internal Trusted Storage requirements <https://arm-software.github.io/psa-api/storage/1.0/overview/requirements.html#internal-trusted-storage-requirements>`_.)
5160

subsys/secure_storage/include/internal/zephyr/secure_storage/its/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ typedef struct {
3939
* smaller IDs compared to the 64-bit ones that PSA Secure Storage specifies.
4040
* Zephyr defines ranges of IDs to be used by different users of the API (subsystems, application)
4141
* which guarantees 1. no collisions and 2. that the IDs used fit within `uid`.
42+
* @see @ref zephyr/psa/key_ids.h and the other header files under `zephyr/psa`.
4243
*/
4344
typedef struct {
4445
psa_storage_uid_t uid : SECURE_STORAGE_ITS_UID_BIT_SIZE;

0 commit comments

Comments
 (0)