TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
attest_symmetric_key.c File Reference
#include <stddef.h>
#include <stdint.h>
#include "attest_key.h"
#include "tfm_plat_crypto_keys.h"
#include "psa/crypto.h"
#include "tfm_memory_utils.h"
Include dependency graph for attest_symmetric_key.c:

Go to the source code of this file.

Macros

#define SYMMETRIC_IAK_MAX_SIZE   PSA_MAC_MAX_SIZE
 
#define INSTANCE_ID_HASH_ALG   PSA_ALG_SHA_256
 
#define KID_BUF_LEN   32
 

Functions

enum psa_attest_err_t attest_register_initial_attestation_key (void)
 Register the initial attestation private key to Crypto service. Loads the public key if the key has not already been loaded. More...
 
enum psa_attest_err_t attest_unregister_initial_attestation_key (void)
 Unregister the initial attestation private key from Crypto service to do not occupy key slot. More...
 
enum psa_attest_err_t attest_get_signing_key_handle (psa_key_handle_t *key_handle)
 Get the handle of the key for signing token In asymmetric key algorithm based initial attestation, it is the handle of the initial attestation private key. In symmetric key algorithm based initial attestation, it is the handle of symmetric initial attestation key. More...
 
enum psa_attest_err_t attest_get_instance_id (struct q_useful_buf_c *id_buf)
 Get the buffer of Instance ID data. More...
 

Macro Definition Documentation

#define INSTANCE_ID_HASH_ALG   PSA_ALG_SHA_256

Definition at line 21 of file attest_symmetric_key.c.

#define KID_BUF_LEN   32

Definition at line 24 of file attest_symmetric_key.c.

#define SYMMETRIC_IAK_MAX_SIZE   PSA_MAC_MAX_SIZE

Definition at line 18 of file attest_symmetric_key.c.

Function Documentation

enum psa_attest_err_t attest_get_instance_id ( struct q_useful_buf_c *  id_buf)

Get the buffer of Instance ID data.

Parameters
[out]id_bufAddress and length of Instance ID buffer
Return values
PSA_ATTEST_ERR_SUCCESSInstance ID was successfully returned.
PSA_ATTEST_ERR_CLAIM_UNAVAILABLEInstance ID is unavailable
PSA_ATTEST_ERR_GENERALInstance ID could not be returned.

Definition at line 240 of file attest_symmetric_key.c.

enum psa_attest_err_t attest_get_signing_key_handle ( psa_key_handle_t key_handle)

Get the handle of the key for signing token In asymmetric key algorithm based initial attestation, it is the handle of the initial attestation private key. In symmetric key algorithm based initial attestation, it is the handle of symmetric initial attestation key.

Parameters
[out]key_handleThe handle of the key for signing token.
Return values
PSA_ATTEST_ERR_SUCCESSKey handle was successfully returned.
PSA_ATTEST_ERR_GENERALKey handle could not be returned.

Definition at line 228 of file attest_symmetric_key.c.

enum psa_attest_err_t attest_register_initial_attestation_key ( )

Register the initial attestation private key to Crypto service. Loads the public key if the key has not already been loaded.

Note
Private key MUST be present on the device, otherwise initial attestation token cannot be signed.
Return values
PSA_ATTEST_ERR_SUCCESSKey(s) was registered.
PSA_ATTEST_ERR_GENERALKey(s) could not be registered.

Definition at line 134 of file attest_symmetric_key.c.

enum psa_attest_err_t attest_unregister_initial_attestation_key ( )

Unregister the initial attestation private key from Crypto service to do not occupy key slot.

Return values
PSA_ATTEST_ERR_SUCCESSKey(s) was unregistered.
PSA_ATTEST_ERR_GENERALKey(s) could not be unregistered.

Definition at line 208 of file attest_symmetric_key.c.