The section has a list of all the internal functions used by the driver.
More...
|
void | AES_processData (AESRegs *baseAddress, const uint8_t *ptrInput, uint8_t *ptrOutput, uint32_t dataLen) |
|
void | AES_generateDataMAC (AESRegs *baseAddress, const uint8_t *ptrInput, uint8_t *ptrTag, uint32_t dataLen) |
|
void | AES_processDataAE (AESRegs *baseAddress, const uint8_t *ptrInput, uint8_t *ptrOutput, uint32_t dataLen, const uint8_t *ptrAuthInput, uint8_t *ptrTag, uint32_t authDataLen) |
|
static uint32_t | Crypto_getAesConfig (Crypto_AESMode mode, Crypto_EncryptParams *ptrParams) |
|
static int32_t | Crypto_aesProcess (Crypto_Config *ptrCryptoConfig, Crypto_AESMode mode, uint32_t cryptoDirection, uint8_t *ptrInput, uint32_t dataLength, uint8_t *ptrOutput, Crypto_EncryptParams *ptrParams) |
|
static int32_t | Crypto_hmacProcess (Crypto_Config *ptrCryptoConfig, uint32_t cryptoConfig, uint8_t *ptrInput, uint32_t dataLength, uint8_t *ptrSignature, Crypto_HmacParams *ptrParams) |
|
void | HMAC_writeDataMultiple (SHARegs *hmacBaseAddress, const uint8_t *ptrData, uint32_t dataLength) |
|
void | HMAC_computeHash (SHARegs *hmacBaseAddress, const uint8_t *ptrData, uint32_t dataLength, uint8_t *ptrHashResult) |
|
void | HMAC_generateHMACPPKey (SHARegs *hmacBaseAddress, const uint8_t *ptrKey, uint32_t keySize, uint8_t *ptrPPKey) |
|
The section has a list of all the internal functions used by the driver.
void AES_generateDataMAC |
( |
AESRegs * |
baseAddress, |
|
|
const uint8_t * |
ptrInput, |
|
|
uint8_t * |
ptrTag, |
|
|
uint32_t |
dataLen |
|
) |
| |
Description
The function generates the MAC(message authentication code) using CBC-MAC and F9 mode. Note: The AES module must be configured for mode(CBC-MAC or F9), keys etc. before calling this function.
- Parameters
-
[in] | baseAddress | Base address of AES module memory mapped registers. |
[in] | ptrInput | Pointer to the input data buffer. |
[out] | ptrTag | Pointer to the 16 byte tag data buffer. |
[in] | dataLen | Data length of the input buffer in bytes. |
- Return values
-
void AES_processData |
( |
AESRegs * |
baseAddress, |
|
|
const uint8_t * |
ptrInput, |
|
|
uint8_t * |
ptrOutput, |
|
|
uint32_t |
dataLen |
|
) |
| |
Description
The function processes(encrypt or decrypt) a block of input data and stores the output data into a user specified output buffer. The function chunks the block of data into 16 byte chunks for processing. Note: The AES module must be configured for mode, keys etc. before calling this function.
- Parameters
-
[in] | baseAddress | Base address of AES module memory mapped registers. |
[in] | ptrInput | Pointer to the input data buffer. |
[out] | ptrOutput | Pointer to the output data buffer. |
[in] | dataLen | Data length in bytes. Valid values are 1 to less than 2^32. |
- Return values
-
void AES_processDataAE |
( |
AESRegs * |
baseAddress, |
|
|
const uint8_t * |
ptrInput, |
|
|
uint8_t * |
ptrOutput, |
|
|
uint32_t |
dataLen, |
|
|
const uint8_t * |
ptrAuthInput, |
|
|
uint8_t * |
ptrTag, |
|
|
uint32_t |
authDataLen |
|
) |
| |
Description
The function processes(encrypt or decrypt) and authenticates a block of input data and stores the output data into a user specified output buffer. It also generates the MAC(message authentication code). Note: The AES module MUST be configured for mode(Only CCM and GCM modes should be used), keys etc. before calling this function. Note: The input data, output data and authentication data MUST be padded to the 16-byte boundary.
- Parameters
-
[in] | baseAddress | Base address of AES module memory mapped registers. |
[in] | ptrInput | Pointer to the input data buffer. |
[out] | ptrOutput | Pointer to the output data buffer. |
[in] | dataLen | Data length of the input buffer in bytes. |
[in] | ptrAuthInput | Pointer to the authentication input data buffer. |
[out] | ptrTag | Pointer to the 16 byte hash tag data buffer. |
[in] | authDataLen | Data length of the authentication input data buffer in bytes. |
- Return values
-
Description
The function is called to encrypt, decrypt or authenticate data based on a specified AES mode. The additional result is stored in the encrypt output parameters.
- Parameters
-
[in] | ptrCryptoConfig | Pointer to the Crypto Driver configuration |
[in] | mode | AES encrypt mode. |
[in] | cryptoDirection | Direction of crypto - Encrypt or Decrypt. |
[in] | ptrInput | Pointer to the input data buffer. |
[in] | dataLength | Data length in bytes. Valid values are 1 to less than 2^32. |
[out] | ptrOutput | Pointer to the output data buffer. |
[in] | ptrParams | Pointer AES parameters. This structure contains both input and output parameters based on the mode. |
- Return values
-
Success | - 0 |
Error | - Crypto Error code |
Description
The function figures out the AES module configuration based on the crypto mode.
- Parameters
-
[in] | mode | AES crypto mode. |
[in] | ptrParams | Pointer AES encrypt parameters. |
- Return values
-
Success | - AES module configuration values |
Error | - AES_CFG_MODE_INVALID |
static int32_t Crypto_hmacProcess |
( |
Crypto_Config * |
ptrCryptoConfig, |
|
|
uint32_t |
cryptoConfig, |
|
|
uint8_t * |
ptrInput, |
|
|
uint32_t |
dataLength, |
|
|
uint8_t * |
ptrSignature, |
|
|
Crypto_HmacParams * |
ptrParams |
|
) |
| |
|
static |
Description
The function is used to process the HMAC params and configure the HMAC engine. It sets the HMAC key, processes the input data and produces the hash.
- Parameters
-
[in] | handle | Handle to the Crypto Driver |
[in] | cryptoConfig | HMAC hash algorithm. |
[in] | ptrInput | Pointer to the input data buffer. |
[in] | dataLength | Data length in bytes. |
[in] | ptrSignature | Pointer 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] | ptrParams | Pointer HMAC parameters. |
- Return values
-
Success | - 0 |
Error | - Crypto Error code |
void HMAC_computeHash |
( |
SHARegs * |
hmacBaseAddress, |
|
|
const uint8_t * |
ptrData, |
|
|
uint32_t |
dataLength, |
|
|
uint8_t * |
ptrHashResult |
|
) |
| |
Description
This function computes the hash using the algorithm and modes that are configured in the Mode register.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | ptrData | Pointer to the data buffer. |
[in] | dataLen | Data length in bytes. |
[out] | ptrHashResult | Pointer to buffer where hash result is stored. |
- Return values
-
void HMAC_generateHMACPPKey |
( |
SHARegs * |
hmacBaseAddress, |
|
|
const uint8_t * |
ptrKey, |
|
|
uint32_t |
keySize, |
|
|
uint8_t * |
ptrPPKey |
|
) |
| |
Description
This function is used to pre process a HMAC key. The pre-processed key can then be used with further HMAC operations to speed up processing time.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | ptrKey | Pointer to the key. |
[in] | keySize | Key Size in bytes. If the key size is less than 512 bits(64 bytes), the function will be padded with zeros. |
[out] | ptrPPKey | Pointer to the pre-processed key. Must be 64 bytes longs. |
- Return values
-
void HMAC_writeDataMultiple |
( |
SHARegs * |
hmacBaseAddress, |
|
|
const uint8_t * |
ptrData, |
|
|
uint32_t |
dataLength |
|
) |
| |
Description
This function writes multiple words of data into the data register. The function waits for each block of data to be processed before another block is written.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | ptrData | Pointer to the data buffer. |
[in] | dataLength | Length of the data in bytes. |
- Return values
-
Loop through all the blocks and write them into the data registers.
If there are bytes that do not make up a whole block, then write them separately.