82 #include <third_party/hsmddk/include/Kit/EIP130/TokenHelper/incl/eip130_token_common.h> 90 #define HSMLPF3_STATUS_SUCCESS ((int_fast16_t)0) 98 #define HSMLPF3_STATUS_ERROR ((int_fast16_t)-1) 107 #define HSMLPF3_STATUS_TIMEOUT ((int_fast16_t)-2) 172 #define AES_MODE_ENCRYPT 1U 173 #define AES_MODE_DECRYPT 0U 175 #define HSMLPF3_RETVAL_MASK MASK_8_BITS 286 uintptr_t driverHandle);
460 uint32_t inputLength);
bool HSMLPF3_acquireLock(uint32_t timeout, uintptr_t driverHandle)
Acquires the HSMLPF3_accessSemaphore.
void HSMLPF3_getResultDigest(uint32_t *digest, size_t digestLength)
Copies a hash operation's digest to user space.
TI Driver for Elliptic Curve Digital Signature Algorithm.
void HSMLPF3_releaseLock(void)
Releases the lock on HSM access.
void HSMLPF3_constructECDHnumSetPhysicalToken(uint8_t length)
Constructs a ECDH num set command token.
The CryptoKey type is an opaque representation of a cryptographic key.
void HSMLPF3_constructAESCMACUpdatePhysicalToken(AESCMACLPF3_Object *object, bool isInitWithDefault)
Constructs an AES-CMAC update command token.
void HSMLPF3_constructAESGCMOneStepPhysicalToken(AESGCMLPF3HSM_Object *object)
Constructs an AES-GCM one-step/segmented command token.
int_fast16_t HSMLPF3_waitForResult(void)
Waits for HSM response to previously submitted token.
void HSMLPF3_constructCreateAssetToken(uint64_t assetPolicy, uint32_t assetLength)
Constructs an asset create command token.
ECDSALPF3HSM Object.
Definition: ECDSALPF3HSM.h:102
int_fast16_t HSMLPF3_init(void)
Initializes the HSM and HSMLPF3 driver for token submissions.
void HSMLPF3_constructECDSASignPhysicalToken(ECDSALPF3HSM_Object *object)
Constructs a ECDSA sign/verify command token.
void HSMLPF3_constructECDHnumLoadPhysicalToken(const uint8_t *buffer, uint8_t index, uint8_t length)
Constructs a ECDH num load command token.
AESCMACLPF3 Object.
Definition: AESCMACLPF3.h:125
AESGCM driver implementation for the Low Power F3 family.
HSMLPF3_CallbackFxn callbackFxn
Definition: HSMLPF3.h:168
void HSMLPF3_getAESEncryptTag(uint8_t *mac)
Fetches the AES tag.
void HSMLPF3_constructDeleteAssetToken(uint32_t assetId)
Constructs an asset delete command token.
void HSMLPF3_constructAESCCMSegmentedDataPhysicalToken(const AESCCMLPF3_Object *object)
Populate the command token to reflect an AES-CCM segmented or final data operation.
void HSMLPF3_constructAESCBCOneStepPhysicalToken(AESCBCLPF3_Object *object)
HSMLPF3_ReturnBehavior returnBehavior
Definition: HSMLPF3.h:167
void HSMLPF3_constructAESECBOneStepPhysicalToken(AESECBLPF3_Object *object)
Constructs an AES-ECB one-step command token.
int_fast16_t HSMLPF3_submitToken(HSMLPF3_ReturnBehavior retBehavior, HSMLPF3_CallbackFxn callbackFxn, uintptr_t driverHandle)
Submits a token to the HSM mailbox.
HSMLPF3_ReturnBehavior
The way in which HSMLPF3_waitForResult() function calls return after performing an calling HSMLPF3_su...
Definition: HSMLPF3.h:124
int32_t HSMLPF3_getResultCode(void)
Get operation result code.
void HSMLPF3_getAESIV(uint8_t *iv)
Fetches the AES IV.
void HSMLPF3_constructRTOSObjects(void)
Initializes the HWI and semaphores for HSMLPF3.
Semaphore module for the RTOS Porting Interface.
AESCTRLPF3 Object.
Definition: AESCTRLPF3.h:138
AESCCMLPF3 Object.
Definition: AESCCMLPF3.h:101
Definition: HSMLPF3.h:133
Eip130Token_Result_t resultToken
Definition: HSMLPF3.h:166
void HSMLPF3_constructAESCCMSegmentedAADPhysicalToken(const AESCCMLPF3_Object *object)
Populate the command token to reflect an AES-CCM segmented AAD operation.
void HSMLPF3_constructLoadPlaintextAssetToken(const uint8_t *input_p, const uint32_t inputLength, uint32_t assetId)
Constructs an asset load plaintext command token.
AESCCM driver implementation for the Low Power F3 family.
void HSMLPF3_constructAESCCMOneStepPhysicalToken(const AESCCMLPF3_Object *object)
Constructs an AES-CCM one-step/segmented command token.
void(* HSMLPF3_CallbackFxn)(uintptr_t arg0)
Pointer to crypto driver post-processing functions.
Definition: HSMLPF3.h:154
void HSMLPF3_constructECDHPKAOperationPhysicalToken(uint8_t operation, uint8_t *input, uint8_t *output, uint32_t inputLength)
Constructs a ECDH PK command token.
AESECB driver implementation for the Low Power F3 family.
void HSMLPF3_constructAESGCMSegmentedDataPhysicalToken(AESGCMLPF3HSM_Object *object)
Populate the command token to reflect an AES-GCM segmented or final data operation.
int_fast16_t HSMLPF3_sleep(void)
Puts the HSM to sleep, lowering its power consumption.
void HSMLPF3_constructAESCTROneStepPhysicalToken(AESCTRLPF3_Object *object)
Constructs an AES-CTR one-step command token.
AESGCMLPF3HSM Object.
Definition: AESGCMLPF3HSM.h:95
AESECBLPF3 Object.
Definition: AESECBLPF3.h:110
Definition: HSMLPF3.h:139
ECDSA HSM IP driver implementation for the Low Power F3 family.
uintptr_t driverHandle
Definition: HSMLPF3.h:169
void HSMLPF3_disableClock(void)
Disables clock for HSM, effectively powering it off.
AESCMAC (CMAC and CBC-MAC) driver header.
Definition: HSMLPF3.h:126
AESCBC driver implementation for the Low Power F3 devices.
void HSMLPF3_getAESCMACSignMac(uint8_t *mac, uint8_t macLength)
Fetches the Final mac from result token.
Eip130Token_Command_t commandToken
Definition: HSMLPF3.h:165
int_fast16_t HSMLPF3_cancelOperation(void)
Cancels the operation currently in progress.
uint32_t HSMLPF3_getResultAssetID(void)
Fetches the asset ID from the HSM's result token.
bool HSMLPF3_isOperationInProgress(void)
returns the value of HSMLPF3_operationInProgress
AESCMAC (CMAC & CBC-MAC) driver implementation for the Low Power F3 family.
void HSMLPF3_constructSHA2PhysicalToken(SHA2LPF3HSM_Object *object)
Constructs a SHA2 onestep/segmented command token.
AESCBCLPF3 Object.
Definition: AESCBCLPF3.h:88
AESCTR driver implementation for the Low Power F3 family.
Struct to hold metadata for a crypto driver's operation.
Definition: HSMLPF3.h:163
void HSMLPF3_constructAESGCMSegmentedAADPhysicalToken(AESGCMLPF3HSM_Object *object)
Populate the command token to reflect an AES-GCM segmented AAD operation.
void HSMLPF3_constructAESCMACOneStepPhysicalToken(AESCMACLPF3_Object *object)
Constructs an AES-CMAC one-step command token.