blob: cbf8338ed53fed4b18a6ca55c3a5f63e5458a719 [file] [log] [blame]
Tamas Ban38e17312018-11-22 15:26:35 +00001/*
Tamas Ban2318feb2019-01-02 16:50:51 +00002 * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
Tamas Ban38e17312018-11-22 15:26:35 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __TFM_PLAT_DEVICE_ID_H__
9#define __TFM_PLAT_DEVICE_ID_H__
10/**
11 * \file tfm_plat_device_id.h
Tamas Ban2318feb2019-01-02 16:50:51 +000012 *
13 * The interfaces defined in this file are meant to provide the following
14 * attributes of the device:
15 * - Instance ID: Unique identifier of the device.
Tamas Ban38e17312018-11-22 15:26:35 +000016 */
17
18/**
19 * \note The interfaces defined in this file must be implemented for each
20 * SoC.
21 */
22
23#include <stdint.h>
24#include "tfm_plat_defs.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/**
Tamas Ban2318feb2019-01-02 16:50:51 +000031 * \def INSTANCE_ID_MAX_SIZE
Tamas Ban38e17312018-11-22 15:26:35 +000032 *
Tamas Ban2318feb2019-01-02 16:50:51 +000033 * \brief Maximum size of instance ID in bytes
Tamas Ban38e17312018-11-22 15:26:35 +000034 */
Tamas Ban2318feb2019-01-02 16:50:51 +000035#define INSTANCE_ID_MAX_SIZE (33u)
Tamas Ban38e17312018-11-22 15:26:35 +000036
37/**
38 * \brief Get the UEID of the device.
39 *
Tamas Ban2318feb2019-01-02 16:50:51 +000040 * This mandatory claim represents the unique identifier of the instance.
41 * In the PSA definition is a hash of the public attestation key of the
42 * instance. The claim will be represented by the EAT standard claim UEID
43 * of type GUID. The EAT definition of a GUID type is that it will be between
44 * 128 & 256 bits but this implementation will use the full 256 bits to
45 * accommodate a hash result.
Tamas Ban38e17312018-11-22 15:26:35 +000046 *
Tamas Ban2318feb2019-01-02 16:50:51 +000047 * \param[in/out] size As an input value it indicates the size of the caller
48 * allocated buffer (in bytes) to store the UEID. At return
49 * its value is updated with the exact size of the UEID.
50 * \param[out] buf Pointer to the buffer to store the UEID
51 *
52 * \return Returns error code specified in \ref tfm_plat_err_t
Tamas Ban38e17312018-11-22 15:26:35 +000053 */
Tamas Ban2318feb2019-01-02 16:50:51 +000054enum tfm_plat_err_t tfm_plat_get_instance_id(uint32_t *size, uint8_t *buf);
Tamas Ban38e17312018-11-22 15:26:35 +000055
56#ifdef __cplusplus
57}
58#endif
59
60#endif /* __TFM_PLAT_DEVICE_ID_H__ */