![]() |
![]() |
Interface to initialize and shutdown the HSM.
This module provides functions for use of the Hardware Security Module.
The HSM initialization procedure must first enable the clock, then initialize the mailbox, and finally boot the device.
Crypto drivers that use the HSM may vary in usage of either HSMLPF3_Clock_Disable() or HSMLPF3_Sleep() when closing their handles.
Go to the source code of this file.
Macros | |
#define | HSMLPF3_STATUS_SUCCESS ((int_fast16_t)0) |
Successful status code. More... | |
#define | HSMLPF3_STATUS_ERROR ((int_fast16_t)-1) |
Generic error status code. More... | |
Functions | |
void | HSMLPF3_enableClock (void) |
Enables clock for HSM, readying it for boot. More... | |
void | HSMLPF3_disableClock (void) |
Disables clock for HSM, effectively powering it off. More... | |
int_fast16_t | HSMLPF3_boot (void) |
Boots the HSM, readying it for crypto operations. More... | |
void | HSMLPF3_initMbox (void) |
Initializes HSM mailbox, allowing token exchanges. More... | |
int_fast16_t | HSMLPF3_sleep (void) |
Puts the HSM to sleep, lowering its power consumption. More... | |
#define HSMLPF3_STATUS_SUCCESS ((int_fast16_t)0) |
Successful status code.
Functions return HSMLPF3_STATUS_SUCCESS if the function was executed successfully.
#define HSMLPF3_STATUS_ERROR ((int_fast16_t)-1) |
Generic error status code.
Functions return HSMLPF3_STATUS_ERROR if the function was not executed successfully and no more specific error is applicable.
void HSMLPF3_enableClock | ( | void | ) |
Enables clock for HSM, readying it for boot.
Calling this function is the first step to making use of the HSM for crypto operations.
void HSMLPF3_disableClock | ( | void | ) |
Disables clock for HSM, effectively powering it off.
This function provides an alternative to putting the HSM in sleep when it no longer needs to be used.
int_fast16_t HSMLPF3_boot | ( | void | ) |
Boots the HSM, readying it for crypto operations.
This function submits a boot token to the HSM, and waits for a successful token result and for the firmware image to be accepted.
Calling this function when the HSM is already booted should return successfully without an unnecessary token submission.
HSMLPF3_STATUS_SUCCESS | HSM booted successfully. |
HSMLPF3_STATUS_ERROR | Error. Error output token, or HSM in bad state. |
void HSMLPF3_initMbox | ( | void | ) |
Initializes HSM mailbox, allowing token exchanges.
Calling this function allows for the boot token and all future tokens to be sent to the HSM. HSMLPF3_initMbox() links to the mailbox(es), and specifies lockout and secure/non-secure access.
int_fast16_t HSMLPF3_sleep | ( | void | ) |
Puts the HSM to sleep, lowering its power consumption.
This function submits a sleep token to the HSM, and waits for a successful token result.
Calling this function when the HSM is already asleep will still submit a sleep token.
HSMLPF3_STATUS_SUCCESS | HSM put to sleep successfully. |
HSMLPF3_STATUS_ERROR | Error. Error output token, or HSM in bad state. |