Functions
Crypto Driver External Functions

The section has a list of all the exported API which the applications need to invoke in order to use the Crypto driver. More...

Functions

int32_t Crypto_close (Crypto_Handle handle)
 
void Crypto_init (void)
 
Crypto_Handle Crypto_open (Crypto_Type cryptoType)
 
int32_t Crypto_hmacParams_init (Crypto_HmacParams *params)
 
int32_t Crypto_encrypt (Crypto_Handle handle, Crypto_AESMode mode, uint8_t *ptrInput, uint32_t dataLength, uint8_t *ptrOutput, Crypto_EncryptParams *ptrParams)
 
int32_t Crypto_decrypt (Crypto_Handle handle, Crypto_AESMode mode, uint8_t *ptrInput, uint32_t dataLength, uint8_t *ptrOutput, Crypto_EncryptParams *ptrParams)
 
int32_t Crypto_sign (Crypto_Handle handle, Crypto_HmacMode mode, uint8_t *ptrInput, uint32_t dataLength, uint8_t *ptrSignature, Crypto_HmacParams *ptrParams)
 
int32_t Crypto_verify (Crypto_Handle handle, Crypto_HmacMode mode, uint8_t *ptrInput, uint32_t dataLength, uint8_t *ptrSignature, Crypto_HmacParams *ptrParams)
 

Detailed Description

The section has a list of all the exported API which the applications need to invoke in order to use the Crypto driver.

Function Documentation

int32_t Crypto_close ( Crypto_Handle  handle)

Description
The function is the Crypto driver close function called close a Crypto Driver instance is being closed

Parameters
[in]handleHandle to the Crypto Driver
Return values
Success- 0
Error- Crypto Error code
int32_t Crypto_decrypt ( Crypto_Handle  handle,
Crypto_AESMode  mode,
uint8_t *  ptrInput,
uint32_t  dataLength,
uint8_t *  ptrOutput,
Crypto_EncryptParams ptrParams 
)

Description
The function is called to decrypt ciphered text data using a specific AES mode. Depending on the mode the data is encrypted and or authenticated. The additional result is stored in the encrypt output parameters.

Parameters
[in]handleHandle to the Crypto Driver
[in]modeAES encrypt mode.
[in]ptrInputPointer to the input data buffer.
[in]dataLengthData length in bytes. Valid values are 1 to less than 2^32.
[out]ptrOutputPointer to the output data buffer.
[in]ptrParamsPointer AES parameters. This structure contains both input and output parameters based on the mode.
Return values
Success- 0
Error- Crypto Error code
int32_t Crypto_encrypt ( Crypto_Handle  handle,
Crypto_AESMode  mode,
uint8_t *  ptrInput,
uint32_t  dataLength,
uint8_t *  ptrOutput,
Crypto_EncryptParams ptrParams 
)

Description
The function is called to encrypt plain text data using a specific AES mode. Depending on the mode the data is encrypted and or authenticated. The additional result is stored in the encrypt output parameters.

Parameters
[in]handleHandle to the Crypto Driver
[in]modeAES encrypt mode.
[in]ptrInputPointer to the input data buffer.
[in]dataLengthData length in bytes. Valid values are 1 to less than 2^32.
[out]ptrOutputPointer to the output data buffer.
[in]ptrParamsPointer AES parameters. This structure contains both input and output parameters based on the mode.
Return values
Success- 0
Error- Crypto Error code
int32_t Crypto_hmacParams_init ( Crypto_HmacParams params)

Description
The function is initializes the HMAC default parameters.

Parameters
[in]paramsPointer to HMAC params.
Return values
Success- 0
Error- Crypto Error code
void Crypto_init ( void  )

Description
The function is the Crypto driver initialization function.

Return values
Notapplicable
Crypto_Handle Crypto_open ( Crypto_Type  cryptoType)

Description
The function is the registered callback function which is invoked when the Crypto Driver instance is being opened with a specific application supplied arguments.

Parameters
[in]typeType of Crypto instance that is opened. Valid values are Crypto_AES - AES Crypto engine Crypto_HMAC - HMAC Crypto engine
Return values
Success- Driver Handle
Error- NULL
int32_t Crypto_sign ( Crypto_Handle  handle,
Crypto_HmacMode  mode,
uint8_t *  ptrInput,
uint32_t  dataLength,
uint8_t *  ptrSignature,
Crypto_HmacParams ptrParams 
)

Description
The function is called to generate the HMAC Hash value of given plain Text.

Parameters
[in]handleHandle to the Crypto Driver
[in]modeHMAC hash algorithm.
[in]ptrInputPointer to the input data buffer.
[in]dataLengthData length in bytes.
[in]ptrSignaturePointer to the HMAC Hash. input pointer - If HMAC flag was set, the ptrSignature pointer is used as the input HMAC Hash value. output pointer - For the generated Hash value.
[in]ptrParamsPointer HMAC parameters.
Return values
Success- 0
Error- Crypto Error code
int32_t Crypto_verify ( Crypto_Handle  handle,
Crypto_HmacMode  mode,
uint8_t *  ptrInput,
uint32_t  dataLength,
uint8_t *  ptrSignature,
Crypto_HmacParams ptrParams 
)

Description
The function is called to verify the HMAC Hash value of given input Text.

Parameters
[in]handleHandle to the Crypto Driver
[in]modeHMAC hash algorithm.
[in]ptrInputPointer to the input data buffer.
[in]dataLengthData length in bytes.
[in]ptrSignaturePointer to the HMAC Hash. input pointer - If HMAC flag was set, the ptrSignature pointer is used as the input HMAC Hash value. output pointer - For the generated Hash value.
[in]ptrParamsPointer HMAC parameters.
Return values
Success- 0
Error- Crypto Error code

Copyright 2018, Texas Instruments Incorporated