RTEMS 6.1-rc4
|
Data Structures | |
struct | puf_config_t |
Functions | |
void | PUF_GetDefaultConfig (puf_config_t *conf) |
Sets the default configuration of PUF. | |
status_t | PUF_Init (PUF_Type *base, puf_config_t *conf) |
Initialize PUF. | |
void | PUF_Deinit (PUF_Type *base, puf_config_t *conf) |
Denitialize PUF. | |
status_t | PUF_Enroll (PUF_Type *base, uint8_t *activationCode, size_t activationCodeSize) |
Enroll PUF. | |
status_t | PUF_Start (PUF_Type *base, const uint8_t *activationCode, size_t activationCodeSize) |
Start PUF. | |
status_t | PUF_SetIntrinsicKey (PUF_Type *base, puf_key_index_register_t keyIndex, size_t keySize, uint8_t *keyCode, size_t keyCodeSize) |
Set intrinsic key. | |
status_t | PUF_SetUserKey (PUF_Type *base, puf_key_index_register_t keyIndex, const uint8_t *userKey, size_t userKeySize, uint8_t *keyCode, size_t keyCodeSize) |
Set user key. | |
status_t | PUF_GetKey (PUF_Type *base, const uint8_t *keyCode, size_t keyCodeSize, uint8_t *key, size_t keySize) |
Reconstruct key from a key code. | |
status_t | PUF_GetHwKey (PUF_Type *base, const uint8_t *keyCode, size_t keyCodeSize, puf_key_slot_t keySlot, uint32_t keyMask) |
Reconstruct hw bus key from a key code. | |
status_t | PUF_Zeroize (PUF_Type *base) |
Zeroize PUF. | |
bool | PUF_IsGetKeyAllowed (PUF_Type *base) |
Checks if Get Key operation is allowed. | |
status_t | PUF_PowerCycle (PUF_Type *base, puf_config_t *conf) |
Powercycle PUF. | |
Variables | |
uint32_t | puf_config_t::dischargeTimeMsec |
uint32_t | puf_config_t::coreClockFrequencyHz |
Driver version | |
enum | _puf_key_index_register { kPUF_KeyIndex_00 = 0x00U , kPUF_KeyIndex_01 = 0x01U , kPUF_KeyIndex_02 = 0x02U , kPUF_KeyIndex_03 = 0x03U , kPUF_KeyIndex_04 = 0x04U , kPUF_KeyIndex_05 = 0x05U , kPUF_KeyIndex_06 = 0x06U , kPUF_KeyIndex_07 = 0x07U , kPUF_KeyIndex_08 = 0x08U , kPUF_KeyIndex_09 = 0x09U , kPUF_KeyIndex_10 = 0x0AU , kPUF_KeyIndex_11 = 0x0BU , kPUF_KeyIndex_12 = 0x0CU , kPUF_KeyIndex_13 = 0x0DU , kPUF_KeyIndex_14 = 0x0EU , kPUF_KeyIndex_15 = 0x0FU } |
enum | _puf_min_max { kPUF_KeySizeMin = 8u , kPUF_KeySizeMax = 512u , kPUF_KeyIndexMax = kPUF_KeyIndex_15 } |
enum | _puf_key_slot { kPUF_KeySlot0 = 0U , kPUF_KeySlot1 = 1U } |
PUF key slot. More... | |
enum | { kStatus_EnrollNotAllowed = MAKE_STATUS(kStatusGroup_PUF, 1) , kStatus_StartNotAllowed = MAKE_STATUS(kStatusGroup_PUF, 2) } |
typedef enum _puf_key_index_register | puf_key_index_register_t |
typedef enum _puf_min_max | puf_min_max_t |
typedef enum _puf_key_slot | puf_key_slot_t |
PUF key slot. | |
#define | FSL_PUF_DRIVER_VERSION (MAKE_VERSION(2, 1, 6)) |
PUF driver version. Version 2.1.6. | |
#define | PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(x) ((160u + (((((x) << 3) + 255u) >> 8) << 8)) >> 3) |
Get Key Code size in bytes from key size in bytes at compile time. | |
#define | PUF_MIN_KEY_CODE_SIZE PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(8UL) |
#define | PUF_ACTIVATION_CODE_SIZE 1192U |
#define | KEYSTORE_PUF_DISCHARGE_TIME_FIRST_TRY_MS 50 |
#define | KEYSTORE_PUF_DISCHARGE_TIME_MAX_MS 400 |
#define FSL_PUF_DRIVER_VERSION (MAKE_VERSION(2, 1, 6)) |
PUF driver version. Version 2.1.6.
Current version: 2.1.6
Change log:
anonymous enum |
PUF status return codes.
enum _puf_key_slot |
void PUF_Deinit | ( | PUF_Type * | base, |
puf_config_t * | conf | ||
) |
Denitialize PUF.
This function disables power to PUF SRAM and peripheral clock.
base | PUF peripheral base address |
conf | PUF configuration structure |
brief Denitialize PUF
This function disables power to PUF SRAM and peripheral clock.
param base PUF peripheral base address param conf PUF configuration structure
Enroll PUF.
This function derives a digital fingerprint, generates the corresponding Activation Code (AC) and returns it to be stored in an NVM or a file. This step needs to be performed only once for each device. This function may be permanently disallowed by a fuse.
base | PUF peripheral base address | |
[out] | activationCode | Word aligned address of the resulting activation code. |
activationCodeSize | Size of the activationCode buffer in bytes. Shall be 1192 bytes. |
brief Enroll PUF
This function derives a digital fingerprint, generates the corresponding Activation Code (AC) and returns it to be stored in an NVM or a file. This step needs to be performed only once for each device. This function may be permanently disallowed by a fuse.
param base PUF peripheral base address param[out] activationCode Word aligned address of the resulting activation code. param activationCodeSize Size of the activationCode buffer in bytes. Shall be 1192 bytes. return Status of enroll operation.
void PUF_GetDefaultConfig | ( | puf_config_t * | conf | ) |
Sets the default configuration of PUF.
This function initialize PUF config structure to default values.
conf | PUF configuration structure |
brief Sets the default configuration of PUF
This function initialize PUF config structure to default values.
param conf PUF configuration structure
status_t PUF_GetHwKey | ( | PUF_Type * | base, |
const uint8_t * | keyCode, | ||
size_t | keyCodeSize, | ||
puf_key_slot_t | keySlot, | ||
uint32_t | keyMask | ||
) |
Reconstruct hw bus key from a key code.
The digital fingerprint generated during the Start operation and the KC generated during a Set Key operation (Set intrinsic key or Set user key) are used to retrieve a stored key. This operation needs to be done every time a key is needed. This function accepts only Key Codes created for PUF index register kPUF_KeyIndex_00. Such a key is output directly to a dedicated hardware bus. The reconstructed key is not exposed to system memory.
base | PUF peripheral base address |
keyCode | Word aligned address of the input key code. |
keyCodeSize | Size of the keyCode buffer in bytes. Shall be PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(keySize). |
keySlot | key slot to output on hw bus. Parameter is ignored on devices with less than two key slots. |
keyMask | key masking value. Shall be random for each POR/reset. Value does not have to be cryptographicaly secure. |
brief Reconstruct hw bus key from a key code
The digital fingerprint generated during the Start operation and the KC generated during a Set Key operation (Set intrinsic key or Set user key) are used to retrieve a stored key. This operation needs to be done every time a key is needed. This function accepts only Key Codes created for PUF index register kPUF_KeyIndex_00. Such a key is output directly to a dedicated hardware bus. The reconstructed key is not exposed to system memory.
param base PUF peripheral base address param keyCode Word aligned address of the input key code. param keyCodeSize Size of the keyCode buffer in bytes. Shall be PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(keySize). param keySlot key slot to output on hw bus. Parameter is ignored on devices with less than two key slots. param keyMask key masking value. Shall be random for each POR/reset. Value does not have to be cryptographicaly secure. return Status of get key operation.
status_t PUF_GetKey | ( | PUF_Type * | base, |
const uint8_t * | keyCode, | ||
size_t | keyCodeSize, | ||
uint8_t * | key, | ||
size_t | keySize | ||
) |
Reconstruct key from a key code.
The digital fingerprint generated during the Start operation and the KC generated during a Set Key operation (Set intrinsic key or Set user key) are used to retrieve a stored key. This operation needs to be done every time a key is needed. This function accepts only Key Codes created for PUF index registers kPUF_KeyIndex_01 to kPUF_KeyIndex_15.
base | PUF peripheral base address | |
keyCode | Word aligned address of the input key code. | |
keyCodeSize | Size of the keyCode buffer in bytes. Shall be PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(keySize). | |
[out] | key | Word aligned address of output key. |
keySize | Size of the output key in bytes. |
brief Reconstruct key from a key code
The digital fingerprint generated during the Start operation and the KC generated during a Set Key operation (Set intrinsic key or Set user key) are used to retrieve a stored key. This operation needs to be done every time a key is needed. This function accepts only Key Codes created for PUF index registers kPUF_KeyIndex_01 to kPUF_KeyIndex_15.
param base PUF peripheral base address param keyCode Word aligned address of the input key code. param keyCodeSize Size of the keyCode buffer in bytes. Shall be PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(keySize). param[out] key Word aligned address of output key. param keySize Size of the output key in bytes. return Status of get key operation.
status_t PUF_Init | ( | PUF_Type * | base, |
puf_config_t * | conf | ||
) |
Initialize PUF.
This function enables power to PUF block and waits until the block initializes.
base | PUF peripheral base address |
conf | PUF configuration structure |
brief Initialize PUF
This function enables power to PUF block and waits until the block initializes.
param base PUF peripheral base address param conf PUF configuration structure return Status of the init operation
bool PUF_IsGetKeyAllowed | ( | PUF_Type * | base | ) |
Checks if Get Key operation is allowed.
This function returns true if get key operation is allowed.
base | PUF peripheral base address |
brief Checks if Get Key operation is allowed.
This function returns true if get key operation is allowed.
param base PUF peripheral base address return true if get key operation is allowed
status_t PUF_PowerCycle | ( | PUF_Type * | base, |
puf_config_t * | conf | ||
) |
Powercycle PUF.
This function make powercycle.
base | PUF peripheral base address |
conf | PUF configuration structure |
brief Powercycle PUF
This function make powercycle of PUF.
param base PUF peripheral base address param conf PUF configuration structure return Status of the powercycle operation.
status_t PUF_SetIntrinsicKey | ( | PUF_Type * | base, |
puf_key_index_register_t | keyIndex, | ||
size_t | keySize, | ||
uint8_t * | keyCode, | ||
size_t | keyCodeSize | ||
) |
Set intrinsic key.
The digital fingerprint generated during the Enroll/Start operations is used to generate a Key Code (KC) that defines a unique intrinsic key. This KC is returned to be stored in an NVM or a file. This operation needs to be done only once for each intrinsic key. Each time a Set Intrinsic Key operation is executed a new unique key is generated.
base | PUF peripheral base address | |
keyIndex | PUF key index register | |
keySize | Size of the intrinsic key to generate in bytes. | |
[out] | keyCode | Word aligned address of the resulting key code. |
keyCodeSize | Size of the keyCode buffer in bytes. Shall be PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(keySize). |
brief Set intrinsic key
The digital fingerprint generated during the Enroll/Start operations is used to generate a Key Code (KC) that defines a unique intrinsic key. This KC is returned to be stored in an NVM or a file. This operation needs to be done only once for each intrinsic key. Each time a Set Intrinsic Key operation is executed a new unique key is generated.
param base PUF peripheral base address param keyIndex PUF key index register param keySize Size of the intrinsic key to generate in bytes. param[out] keyCode Word aligned address of the resulting key code. param keyCodeSize Size of the keyCode buffer in bytes. Shall be PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(keySize). return Status of set intrinsic key operation.
status_t PUF_SetUserKey | ( | PUF_Type * | base, |
puf_key_index_register_t | keyIndex, | ||
const uint8_t * | userKey, | ||
size_t | userKeySize, | ||
uint8_t * | keyCode, | ||
size_t | keyCodeSize | ||
) |
Set user key.
The digital fingerprint generated during the Enroll/Start operations and a user key (UK) provided as input are used to generate a Key Code (KC). This KC is sent returned to be stored in an NVM or a file. This operation needs to be done only once for each user key.
base | PUF peripheral base address | |
keyIndex | PUF key index register | |
userKey | Word aligned address of input user key. | |
userKeySize | Size of the input user key in bytes. | |
[out] | keyCode | Word aligned address of the resulting key code. |
keyCodeSize | Size of the keyCode buffer in bytes. Shall be PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(userKeySize). |
brief Set user key
The digital fingerprint generated during the Enroll/Start operations and a user key (UK) provided as input are used to generate a Key Code (KC). This KC is sent returned to be stored in an NVM or a file. This operation needs to be done only once for each user key.
param base PUF peripheral base address param keyIndex PUF key index register param userKey Word aligned address of input user key. param userKeySize Size of the input user key in bytes. param[out] keyCode Word aligned address of the resulting key code. param keyCodeSize Size of the keyCode buffer in bytes. Shall be PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(userKeySize). return Status of set user key operation.
Start PUF.
The Activation Code generated during the Enroll operation is used to reconstruct the digital fingerprint. This needs to be done after every power-up and reset.
base | PUF peripheral base address |
activationCode | Word aligned address of the input activation code. |
activationCodeSize | Size of the activationCode buffer in bytes. Shall be 1192 bytes. |
brief Start PUF
The Activation Code generated during the Enroll operation is used to reconstruct the digital fingerprint. This needs to be done after every power-up and reset.
param base PUF peripheral base address param activationCode Word aligned address of the input activation code. param activationCodeSize Size of the activationCode buffer in bytes. Shall be 1192 bytes. return Status of start operation.
Zeroize PUF.
This function clears all PUF internal logic and puts the PUF to error state.
base | PUF peripheral base address |
brief Zeroize PUF
This function clears all PUF internal logic and puts the PUF to error state.
param base PUF peripheral base address return Status of the zeroize operation.