Mbed OS Reference
Loading...
Searching...
No Matches
tfm_plat_device_id.h File Reference

The interfaces defined in this file are meant to provide the following attributes of the device: More...

#include <stdint.h>
#include "tfm_plat_defs.h"

Go to the source code of this file.

Macros

#define INSTANCE_ID_MAX_SIZE   (33u)
 Maximum size of instance ID in bytes. More...
 
#define IMPLEMENTATION_ID_MAX_SIZE   (32u)
 Maximum size of implementation ID in bytes. More...
 
#define HW_VERSION_MAX_SIZE   (18u)
 Maximum size of hardware version in bytes. More...
 

Functions

enum tfm_plat_err_t tfm_plat_get_instance_id (uint32_t *size, uint8_t *buf)
 Get the UEID of the device. More...
 
enum tfm_plat_err_t tfm_plat_get_implementation_id (uint32_t *size, uint8_t *buf)
 Get the Implementation ID of the device. More...
 
enum tfm_plat_err_t tfm_plat_get_hw_version (uint32_t *size, uint8_t *buf)
 Get the hardware version of the device. More...
 

Detailed Description

The interfaces defined in this file are meant to provide the following attributes of the device:

  • Instance ID: Unique identifier of the device.
  • Implementation ID: Original implementation signer of the attestation key.
  • Hardware version: Identify the GDSII that went to fabrication.

Definition in file tfm_plat_device_id.h.

Macro Definition Documentation

◆ INSTANCE_ID_MAX_SIZE

#define INSTANCE_ID_MAX_SIZE   (33u)

Maximum size of instance ID in bytes.

Note
The interfaces defined in this file must be implemented for each SoC.

Definition at line 37 of file tfm_plat_device_id.h.

◆ IMPLEMENTATION_ID_MAX_SIZE

#define IMPLEMENTATION_ID_MAX_SIZE   (32u)

Maximum size of implementation ID in bytes.

Definition at line 44 of file tfm_plat_device_id.h.

◆ HW_VERSION_MAX_SIZE

#define HW_VERSION_MAX_SIZE   (18u)

Maximum size of hardware version in bytes.

Recommended to use the European Article Number format: EAN-13+5

Definition at line 53 of file tfm_plat_device_id.h.

Function Documentation

◆ tfm_plat_get_instance_id()

enum tfm_plat_err_t tfm_plat_get_instance_id ( uint32_t *  size,
uint8_t *  buf 
)

Get the UEID of the device.

This mandatory claim represents the unique identifier of the instance. In the PSA definition is a hash of the public attestation key of the instance. The claim will be represented by the EAT standard claim UEID of type GUID. The EAT definition of a GUID type is that it will be between 128 & 256 bits but this implementation will use the full 256 bits to accommodate a hash result.

Parameters
[in,out]sizeAs an input value it indicates the size of the caller allocated buffer (in bytes) to store the UEID. At return its value is updated with the exact size of the UEID.
[out]bufPointer to the buffer to store the UEID
Returns
Returns error code specified in tfm_plat_err_t

◆ tfm_plat_get_implementation_id()

enum tfm_plat_err_t tfm_plat_get_implementation_id ( uint32_t *  size,
uint8_t *  buf 
)

Get the Implementation ID of the device.

This mandatory claim represents the original implementation signer of the attestation key and identifies the contract between the report and verification. A verification service will use this claim to locate the details of the verification process. The claim will be represented by a custom EAT claim with a value consisting of a CBOR byte string. The size of this string will normally be 32 bytes to accommodate a 256 bit hash.

Parameters
[in,out]sizeAs an input value it indicates the size of the caller allocated buffer (in bytes) to store the implementation ID. At return its value is updated with the exact size of the implementation ID.
[out]bufPointer to the buffer to store the implementation ID
Returns
Returns error code specified in tfm_plat_err_t

◆ tfm_plat_get_hw_version()

enum tfm_plat_err_t tfm_plat_get_hw_version ( uint32_t *  size,
uint8_t *  buf 
)

Get the hardware version of the device.

This optional claim provides metadata linking the token to the GDSII that went to fabrication for this instance. It is represented as CBOR text string. It is recommended to use for identification the format of the European Article Number: EAN-13+5.

Parameters
[in,out]sizeAs an input value it indicates the size of the caller allocated buffer (in bytes) to store the HW version. At return its value is updated with the exact size of the HW version.
[out]bufPointer to the buffer to store the HW version
Returns
Returns error code specified in tfm_plat_err_t