|
TI OAD API Documentation
9.14.00
|
Interface to The HSM IP in a BareMetal-based implementation. More...
Go to the source code of this file.
Data Structures | |
| struct | HSMBareMetal_AESOperationStruct |
| Struct containing the parameters required for AES operations. More... | |
| struct | HSMBareMetal_AssetOperationStruct |
| Struct containing the parameters required for asset create and plaintext key load operations. More... | |
| struct | HSMBareMetal_AssetPairKeyBlobStruct |
| Struct containing the two buffers for symmetric key blob data. More... | |
| struct | HSMBareMetal_AssetPairStruct |
| Struct containing the two asset IDs returned for usage in a symmetric operation. More... | |
| struct | HSMBareMetal_AsymAssetPairStruct |
| Struct containing the two asset IDs returned for ECC operations. More... | |
| struct | HSMBareMetal_CryptoKeyAssetStoreStruct |
| Struct containing the AssetStore-based crypto key data. More... | |
| struct | HSMBareMetal_CryptoKeyPlaintextStruct |
| Struct containing the Plaintext-based crypto key data. More... | |
| struct | HSMBareMetal_CryptoKeyStruct |
| Struct containing the parameters required for AES operations. More... | |
| struct | HSMBareMetal_ECCOperationStruct |
| Struct containing the parameters required for ECC operations. More... | |
| struct | HSMBareMetal_HASHOperationStruct |
| Struct containing the parameters required for Hash operations. More... | |
| struct | HSMBareMetal_MACOperationStruct |
| Struct containing the parameters required for MAC operations. More... | |
| struct | HSMBareMetal_RNGOperationStruct |
| Struct containing the parameters required for RNG operations. More... | |
| struct | HSMBareMetal_systemInfoVersionStruct |
| Struct to store HSM system versions. More... | |
Macros | |
| #define | HSM_KEYBLOB_SIZE(keyLength) (HSMBAREMETAL_AES_BLOCK_SIZE + keyLength) |
| The expected size of an AES-SIV keyblob. More... | |
| #define | HSMBAREMETAL_AES_BLOCK_SIZE 16 |
| The size of an HSM block for symmetric operations. | |
| #define | HSMBAREMETAL_HUK_ASSET_NUMBER 0x61 |
| The Hardware Unique key (HUK) asset number in the HSM. | |
| #define | HSMBAREMETAL_STATUS_ERROR ((int_fast16_t)-1) |
| Generic error status code. More... | |
| #define | HSMBAREMETAL_STATUS_FEATURE_NOT_SUPPORTED ((int_fast16_t)-13) |
| The combination of parameters passed filtered to a feature that exists but is not supported yet. | |
| #define | HSMBAREMETAL_STATUS_HSM_ALREADY_INITIALIZED ((int_fast16_t)-4) |
| HSM IP is already initialized. | |
| #define | HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED ((int_fast16_t)-2) |
| HSM IP has not been initialized yet. Call HSMBareMetal_init() | |
| #define | HSMBAREMETAL_STATUS_HUK_ALREADY_PROVISIONED ((int_fast16_t)-12) |
| This device has already been provisioned with a Hardware Unique Key (HUK). | |
| #define | HSMBAREMETAL_STATUS_HW_ERROR ((int_fast16_t)-3) |
| HSM IP reported a Hardware error. This renders the IP non-functional. More... | |
| #define | HSMBAREMETAL_STATUS_INVALID_INPUT_DATA_LENGTH ((int_fast16_t)-14) |
| The input data length is not block aligned. | |
| #define | HSMBAREMETAL_STATUS_INVALID_INPUT_PARAMETERS ((int_fast16_t)-6) |
| One or more of the provided parameter(s) do not match the supported features. | |
| #define | HSMBAREMETAL_STATUS_INVALID_MAC ((int_fast16_t)-5) |
| The MAC verification failed. More... | |
| #define | HSMBAREMETAL_STATUS_INVALID_MAC_LENGTH ((int_fast16_t)-15) |
| The mac length is invalid. | |
| #define | HSMBAREMETAL_STATUS_INVALID_PRIVATE_KEY_SIZE ((int_fast16_t)-8) |
| Private key size is invalid. | |
| #define | HSMBAREMETAL_STATUS_INVALID_PUBLIC_KEY_OCTET_VALUE ((int_fast16_t)-10) |
| The public key's first byte is an invalid value. | |
| #define | HSMBAREMETAL_STATUS_INVALID_PUBLIC_KEY_SIZE ((int_fast16_t)-9) |
| Public key size is invalid. | |
| #define | HSMBAREMETAL_STATUS_INVALID_SHARED_SECRET_KEY_SIZE ((int_fast16_t)-11) |
| Shared secret key size is invalid. | |
| #define | HSMBAREMETAL_STATUS_NRBG_ALREADY_IN_MODE ((int_fast16_t)-7) |
| the NRBG engine is already in mode. | |
| #define | HSMBAREMETAL_STATUS_SUCCESS ((int_fast16_t)0) |
| Successful status code. More... | |
| #define | HSMBareMetal_WAIT_FOREVER ~(0) |
| Wait forever for a result token define. | |
Enumerations | |
| enum | HSMBareMetal_AESOperationMode { HSMBareMetal_AES_MODE_ECB = 0, HSMBareMetal_AES_MODE_CBC = 1, HSMBareMetal_AES_MODE_CTR = 2, HSMBareMetal_AES_MODE_CCM = 5, HSMBareMetal_AES_MODE_GCM = 7 } |
| Enum for AES operation modes. | |
| enum | HSMBareMetal_AssetOperationType { HSMBareMetal_ASSET_OPERATION_TYPE_LOAD_PLAINTEXT = 0, HSMBareMetal_ASSET_OPERATION_TYPE_LOAD_IMPORT_KEY_BLOB = 1, HSMBareMetal_ASSET_OPERATION_TYPE_LOAD_EXPORT_KEY_BLOB = 2 } |
| Enum for the Asset operation type. | |
| enum | HSMBareMetal_ECCOperationCurveLength { HSMBareMetal_PK_CURVE_LENGTH_224 = 224, HSMBareMetal_PK_CURVE_LENGTH_255 = 255, HSMBareMetal_PK_CURVE_LENGTH_256 = 256, HSMBareMetal_PK_CURVE_LENGTH_384 = 384, HSMBareMetal_PK_CURVE_LENGTH_512 = 512, HSMBareMetal_PK_CURVE_LENGTH_521 = 521 } |
| Enum for ECC operation curve lengths. | |
| enum | HSMBareMetal_ECCOperationCurveType { HSMBareMetal_PK_CURVE_TYPE_SEC_P_224_R1 = 1, HSMBareMetal_PK_CURVE_TYPE_SEC_P_256_R1 = 2, HSMBareMetal_PK_CURVE_TYPE_SEC_P_384_R1 = 3, HSMBareMetal_PK_CURVE_TYPE_SEC_P_521_R1 = 4, HSMBareMetal_PK_CURVE_TYPE_BRP_P_256_R1 = 5, HSMBareMetal_PK_CURVE_TYPE_BRP_P_384_R1 = 6, HSMBareMetal_PK_CURVE_TYPE_BRP_P_512_R1 = 7, HSMBareMetal_PK_CURVE_TYPE_25519 = 8 } |
| Enum for ECC operation curve types. | |
| enum | HSMBareMetal_ECCOperationDigestLength { HSMBareMetal_PK_DIGEST_LENGTH_224 = 224, HSMBareMetal_PK_DIGEST_LENGTH_256 = 256, HSMBareMetal_PK_DIGEST_LENGTH_384 = 384, HSMBareMetal_PK_DIGEST_LENGTH_512 = 512 } |
| Enum for ECC operation digest lengths. | |
| enum | HSMBareMetal_ECCOperationMode { HSMBareMetal_PK_MODE_ECDH_GEN_PUB_KEY = 1, HSMBareMetal_PK_MODE_ECDH_GEN_SHRD_SCRT = 2, HSMBareMetal_PK_MODE_ECDSA_SIGN = 3, HSMBareMetal_PK_MODE_ECDSA_VERIFY = 4 } |
| Enum for ECC operation modes. | |
| enum | HSMBareMetal_entropyType { ENTROPY_TYPE_DRBG = 0x0000, ENTROPY_TYPE_CRNG = 0x7264, ENTROPY_TYPE_TRNG = 0x5244 } |
| Enum for entropy type. More... | |
| enum | HSMBareMetal_HASHOperationMode { HSMBareMetal_HASH_MODE_SHA2_224 = 2, HSMBareMetal_HASH_MODE_SHA2_256 = 3, HSMBareMetal_HASH_MODE_SHA2_384 = 4, HSMBareMetal_HASH_MODE_SHA2_512 = 5 } |
| Enum for Hash operation modes (algorithms). | |
| enum | HSMBareMetal_HASHOperationType { HSMBareMetal_HASH_TYPE_INIT_TO_FINAL = 0, HSMBareMetal_HASH_TYPE_CONT_TO_FINAL = 1, HSMBareMetal_HASH_TYPE_INIT_TO_CONT = 2, HSMBareMetal_HASH_TYPE_CONT_TO_CONT = 3 } |
| Enum for Hash operation types (hash mode). | |
| enum | HSMBareMetal_KeyInput { HSMBareMetal_KEY_INPUT_PLAINTEXT = 0, HSMBareMetal_KEY_INPUT_ASSETSTORE = 1 } |
| Enum for the AES operation mode. | |
| enum | HSMBareMetal_MACOperationMode { HSMBareMetal_MAC_MODE_HMAC_224 = 2, HSMBareMetal_MAC_MODE_HMAC_256 = 3, HSMBareMetal_MAC_MODE_HMAC_384 = 4, HSMBareMetal_MAC_MODE_HMAC_512 = 5, HSMBareMetal_MAC_MODE_CMAC = 8, HSMBareMetal_MAC_MODE_CBC_MAC = 9 } |
| Enum for the MAC operation mode. | |
| enum | HSMBareMetal_NRBGMode { NRBG_TYPE_CRNG = 1, NRBG_TYPE_TRNG = 0 } |
| Enum for the current NRBG IP for the HSM to pull entropy from. More... | |
| enum | HSMBareMetal_operationAlgorithm { HSMBareMetal_OPERATION_ALGO_AES = 1, HSMBareMetal_OPERATION_ALGO_MAC = 2, HSMBareMetal_OPERATION_ALGO_HASH = 3, HSMBareMetal_OPERATION_ALGO_ECC = 4 } |
| Enum for operation algorithm. More... | |
| enum | HSMBareMetal_operationDirection { HSMBareMetal_OPERATION_DIR_ENC_GEN = 1, HSMBareMetal_OPERATION_DIR_DEC_VRFY = 2 } |
| Enum for the direction of an AES operation. More... | |
Functions | |
| int_fast16_t | HSMBareMetal_AESOperation (HSMBareMetal_AESOperationStruct *operationStruct) |
| Perform a Bare Metal AES Operation. More... | |
| void | HSMBareMetal_AESOperation_init (HSMBareMetal_AESOperationStruct *operationStruct) |
| Function to initialize an HSMBareMetal_AESOperation struct to its default (all zeroes) | |
| int_fast16_t | HSMBareMetal_AssetOperation (HSMBareMetal_AssetOperationStruct *operationStruct) |
| Perform a Bare Metal Asset Create and Load Operations. More... | |
| void | HSMBareMetal_AssetOperation_init (HSMBareMetal_AssetOperationStruct *operationStruct) |
| Function to initialize an HSMBareMetal_AssetOperation struct to its default (all zeroes) | |
| int_fast16_t | HSMBareMetal_checkHSMStatus (void) |
| Check HSM HW status. More... | |
| void | HSMBareMetal_CryptoKeyPlaintext_initKey (HSMBareMetal_CryptoKeyStruct *cryptoKey, uint8_t *key, size_t keyLength) |
| Initializes a CryptoKey with plaintext encoding. More... | |
| int_fast16_t | HSMBareMetal_deInit (void) |
| Close the HSMBareMetal Module. More... | |
| int_fast16_t | HSMBareMetal_ECCOperation (HSMBareMetal_ECCOperationStruct *operationStruct) |
| Perform a Bare Metal Public Key Operation. More... | |
| void | HSMBareMetal_ECCOperation_init (HSMBareMetal_ECCOperationStruct *operationStruct) |
| Function to initialize an HSMBareMetal_ECCOperation struct to its default (all zeroes) | |
| int_fast16_t | HSMBareMetal_freeAssetPair (HSMBareMetal_AssetPairStruct keyAssetPair) |
| Perform a Bare Metal Asset Delete Operations. More... | |
| int_fast16_t | HSMBareMetal_freeKeyAsset (uint32_t *keyAssetID) |
| Perform a Bare Metal Asset Delete Operation. More... | |
| int_fast16_t | HSMBareMetal_getHSMFirmwareVersion (HSMBareMetal_systemInfoVersionStruct *firmwareVersionStruct) |
| Returns the HSM FW image version number (major, minor, and patch) More... | |
| int_fast16_t | HSMBareMetal_HASHOperation (HSMBareMetal_HASHOperationStruct *operationStruct) |
| Perform a Bare Metal Hash Operation. More... | |
| void | HSMBareMetal_HASHOperation_init (HSMBareMetal_HASHOperationStruct *operationStruct) |
| Function to initialize an HSMBareMetal_HASHOperation struct to its default (all zeroes) | |
| int_fast16_t | HSMBareMetal_init (void) |
| Initialize HSMBareMetal Module. More... | |
| int_fast16_t | HSMBareMetal_MACOperation (HSMBareMetal_MACOperationStruct *operationStruct) |
| Perform a Bare Metal MAC Operation. More... | |
| void | HSMBareMetal_MACOperation_init (HSMBareMetal_MACOperationStruct *operationStruct) |
| Function to initialize an HSMBareMetal_MACOperation struct to its default (all zeroes) | |
| int_fast16_t | HSMBareMetal_provisionHUK (void) |
| Provision the Hardware Unique Key (HUK) for this device. More... | |
| int_fast16_t | HSMBareMetal_RNGOperation (HSMBareMetal_RNGOperationStruct *operationStruct) |
| Perform a Bare Metal Random Number Generation Operation. More... | |
| void | HSMBareMetal_RNGOperation_init (HSMBareMetal_RNGOperationStruct *operationStruct) |
| Function to initialize an HSMBareMetal_RNGOperation struct to its default (all zeroes) | |
| int_fast16_t | HSMBareMetal_RNGSwitchNRBGMode (HSMBareMetal_NRBGMode NRBGMode) |
| Switch the current NRBG engine: CRNG -> TRNG or vice-versa. More... | |
| int_fast16_t | HSMBareMetal_searchStaticAsset (uint32_t assetNumber, uint32_t *assetId) |
| Perform an HSM OTP search for static asset. More... | |
Interface to The HSM IP in a BareMetal-based implementation.
This module provides cryptographic functions for use of the Hardware Security Module.
Summary and List of Features:
NOTE: The above features do not support segmented operations. All operations are performed as a 'one-shot' operation. NOTE: the above features and their APIs are synchonous and conduct their operations in a polling return behavior-like fashion.
Before starting a BareMetal operation
The HSMBareMetal implementation provides a simplified approach to leverage the Hardware Security Module (HSM) functional capability while also bypassing the complex SW architecture of the HSM and the RTOS while offering a centralized suit of APIs to conduct all major cryptographic operations.
This implementation delivers multiple features in a switch-like approach. For example, it allows multiple modes of an Advanced Encryption Standard (AES) operations in one API by simply choosing from an Enum for all AEAD operations such as (CCM, GCM, CBC, CTR, ECB, CMAC, CBC-MAC), (ENC, DEC).
| #define HSM_KEYBLOB_SIZE | ( | keyLength | ) | (HSMBAREMETAL_AES_BLOCK_SIZE + keyLength) |
The expected size of an AES-SIV keyblob.
Note: keyLength is the size of the Asset in octects (bytes).
| #define HSMBAREMETAL_STATUS_ERROR ((int_fast16_t)-1) |
Generic error status code.
Functions return HSMBAREMETAL_STATUS_ERROR if the function was not executed successfully and no more specific error is applicable.
| #define HSMBAREMETAL_STATUS_HW_ERROR ((int_fast16_t)-3) |
HSM IP reported a Hardware error. This renders the IP non-functional.
To fix this, a hard reset must be performed on the device.
| #define HSMBAREMETAL_STATUS_INVALID_MAC ((int_fast16_t)-5) |
The MAC verification failed.
A MAC operation-related error code.
Functions return HSMBAREMETAL_STATUS_INVALID_MAC if the MAC computed for the provided (key, message) pair did not match the MAC provided.
| #define HSMBAREMETAL_STATUS_SUCCESS ((int_fast16_t)0) |
Successful status code.
Functions return HSMBAREMETAL_STATUS_SUCCESS if the function was executed successfully.
Enum for entropy type.
For key generation, users MUST choose #ENTROPY_TYPE_DRBG.
Enum for the current NRBG IP for the HSM to pull entropy from.
By default, the HSM is set to use the #NRBG_TYPE_CRNG.
Enum for operation algorithm.
These values to be used in Dynamic asset creation to determine the proper asset Policy for an HSM Key.
Enum for the direction of an AES operation.
| int_fast16_t HSMBareMetal_AESOperation | ( | HSMBareMetal_AESOperationStruct * | operationStruct | ) |
Perform a Bare Metal AES Operation.
| [in] | operationStruct | Pointer to the operation's structure. |
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| HSMBAREMETAL_STATUS_INVALID_INPUT_PARAMETERS | One or more of the input parameters is incorrect. |
| int_fast16_t HSMBareMetal_AssetOperation | ( | HSMBareMetal_AssetOperationStruct * | operationStruct | ) |
Perform a Bare Metal Asset Create and Load Operations.
!!!!Important!!!! When operationStruct.isKeyGenerated is set to true, the HSMBareMetal module will IGNORE the key input parameter and instead generate a random key internally and use that as the data for an asset create and load operations.
The user MUST specify buffers for both #HSMBareMetal_AssetPairStruct.encGenKeyAssetID and #HSMBareMetal_AssetPairStruct.decVrfyKeyAssetID inside of HSMBareMetal_AssetPairStruct. This API creates TWO assets and returns the corresponding asset IDs for them.
| [in] | operationStruct | Pointer to the operation's structure. |
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| HSMBAREMETAL_STATUS_INVALID_INPUT_PARAMETERS | One or more of the input parameters is incorrect. |
| int_fast16_t HSMBareMetal_checkHSMStatus | ( | void | ) |
Check HSM HW status.
| HSMBAREMETAL_STATUS_HSM_ALREADY_INITIALIZED | HSM is initialized properly and ready for use. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| void HSMBareMetal_CryptoKeyPlaintext_initKey | ( | HSMBareMetal_CryptoKeyStruct * | cryptoKey, |
| uint8_t * | key, | ||
| size_t | keyLength | ||
| ) |
Initializes a CryptoKey with plaintext encoding.
| [in] | cryptoKey | Pointer to a CryptoKey which will be initialized to type HSMBareMetal_KEY_INPUT_PLAINTEXT and ready for use |
| [in] | key | Pointer to keying material |
| [in] | keyLength | Length of keying material in bytes |
| int_fast16_t HSMBareMetal_deInit | ( | void | ) |
Close the HSMBareMetal Module.
This operation turns off the HSM and clears all static objects.
| int_fast16_t HSMBareMetal_ECCOperation | ( | HSMBareMetal_ECCOperationStruct * | operationStruct | ) |
Perform a Bare Metal Public Key Operation.
!!!!Important!!!! For ECC operations:
| [in] | operationStruct | Pointer to the operation's structure. |
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| HSMBAREMETAL_STATUS_INVALID_INPUT_PARAMETERS | One or more of the input parameters is incorrect. |
| int_fast16_t HSMBareMetal_freeAssetPair | ( | HSMBareMetal_AssetPairStruct | keyAssetPair | ) |
Perform a Bare Metal Asset Delete Operations.
| [in] | keyAssetPair | ENC/GEN and DEC/VRFY asset IDs |
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| HSMBAREMETAL_STATUS_INVALID_INPUT_PARAMETERS | One or more of the input parameters is incorrect. |
| int_fast16_t HSMBareMetal_freeKeyAsset | ( | uint32_t * | keyAssetID | ) |
Perform a Bare Metal Asset Delete Operation.
| [in] | keyAssetID | Asset ID |
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| int_fast16_t HSMBareMetal_getHSMFirmwareVersion | ( | HSMBareMetal_systemInfoVersionStruct * | firmwareVersionStruct | ) |
Returns the HSM FW image version number (major, minor, and patch)
This function sends a system info token and extracts HSM version numbers and returns the FW version.
| [in] | firmwareVersionStruct | firmware version structure |
| HSMBAREMETAL_STATUS_SUCCESS | System info token returned data successfully. |
| HSMBAREMETAL_STATUS_ERROR | Error. System info failed or HSMBareMetal is not initialized. |
| int_fast16_t HSMBareMetal_HASHOperation | ( | HSMBareMetal_HASHOperationStruct * | operationStruct | ) |
Perform a Bare Metal Hash Operation.
| [in] | operationStruct | Pointer to the operation's structure. |
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| HSMBAREMETAL_STATUS_INVALID_INPUT_PARAMETERS | One or more of the input parameters is incorrect. |
| int_fast16_t HSMBareMetal_init | ( | void | ) |
Initialize HSMBareMetal Module.
The initialization process include:
| HSMBAREMETAL_STATUS_SUCCESS | Initialization process was successful |
| HSMBAREMETAL_STATUS_ERROR | Initialization process was unsuccessful. |
| HSMBAREMETAL_STATUS_HSM_ALREADY_INITIALIZED | HSM already initialized. |
| int_fast16_t HSMBareMetal_MACOperation | ( | HSMBareMetal_MACOperationStruct * | operationStruct | ) |
Perform a Bare Metal MAC Operation.
| [in] | operationStruct | Pointer to the operation's structure. |
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| HSMBAREMETAL_STATUS_INVALID_INPUT_PARAMETERS | One or more of the input parameters is incorrect. |
| int_fast16_t HSMBareMetal_provisionHUK | ( | void | ) |
Provision the Hardware Unique Key (HUK) for this device.
This is an operation that should be done only once per device lifetime.
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_HUK_ALREADY_PROVISIONED | HUK already provisioned. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| int_fast16_t HSMBareMetal_RNGOperation | ( | HSMBareMetal_RNGOperationStruct * | operationStruct | ) |
Perform a Bare Metal Random Number Generation Operation.
!!!!IMPORTANT!!!!
For symmetric key generation, users MUST choose #ENTROPY_TYPE_DRBG. However, the HSMBareMetal_AssetOperation() API provide an In-API key generation feature that generates a key, creates two assets (ENC/GEN and DEC/VRFY) and loads the key into both assets and returns an a pair of asset IDs.
| [in] | operationStruct | Pointer to the operation's structure. |
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| HSMBAREMETAL_STATUS_INVALID_INPUT_PARAMETERS | One or more of the input parameters is incorrect. |
| int_fast16_t HSMBareMetal_RNGSwitchNRBGMode | ( | HSMBareMetal_NRBGMode | NRBGMode | ) |
Switch the current NRBG engine: CRNG -> TRNG or vice-versa.
| [in] | NRBGMode | Used to select which NRBG noise source to use. |
| HSMBAREMETAL_STATUS_SUCCESS | The operation succeeded. |
| HSMBAREMETAL_STATUS_ERROR | The operation failed. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
| HSMBAREMETAL_STATUS_INVALID_INPUT_PARAMETERS | One or more of the input parameters is incorrect. |
| int_fast16_t HSMBareMetal_searchStaticAsset | ( | uint32_t | assetNumber, |
| uint32_t * | assetId | ||
| ) |
Perform an HSM OTP search for static asset.
This API searches the HSM OTP for the specified asset number and returns found or not found.
| [in] | assetNumber | Static asset number |
| [out] | assetId | The corresponding asset ID |
| HSMBAREMETAL_STATUS_SUCCESS | Asset found. |
| HSMBAREMETAL_STATUS_ERROR | Asset not found. |
| HSMBAREMETAL_STATUS_HSM_NOT_INITIALIZED | Call HSMBareMetal_init() first. |
| HSMBAREMETAL_STATUS_HW_ERROR | HSM in fatal mode. Reset Device. |
1.8.12