The section has a list of all the HMAC functions used internally by the driver.
More...
|
void | HMAC_init (DTHERegs *dtheBaseAddress, SHARegs *hmacBaseAddress) |
|
void | HMAC_setConfig (SHARegs *hmacBaseAddress, uint32_t cryptoMode, uint8_t useAlgoConstant, uint8_t closeHash, uint8_t useHMACKey, uint8_t HMACOuterHash) |
|
uint32_t | HMAC_isReady (const SHARegs *hmacBaseAddress, uint32_t flag) |
|
void | HMAC_setDataLength (SHARegs *hmacBaseAddress, uint32_t dataLength) |
|
void | HMAC_writeData (SHARegs *hmacBaseAddress, const uint8_t *ptrData) |
|
uint32_t | HMAC_getDigestSize (uint32_t config) |
|
void | HMAC_readResult (SHARegs *hmacBaseAddress, uint8_t *ptrData) |
|
void | HMAC_writeResult (SHARegs *hmacBaseAddress, uint8_t *ptrData) |
|
uint32_t | HMAC_readDigestCount (SHARegs *hmacBaseAddress) |
|
void | HMAC_writeDigestCount (SHARegs *hmacBaseAddress, uint32_t digestCount) |
|
void | HMAC_setHMACKey (SHARegs *hmacBaseAddress, const uint8_t *ptrKey) |
|
void | HMAC_setHMACPPKey (SHARegs *hmacBaseAddress, const uint8_t *ptrKey) |
|
void | HMAC_enableInterrupt (DTHERegs *dtheBaseAddress, SHARegs *hmacBaseAddress, uint32_t intFlags) |
|
void | HMAC_disableInterrupt (DTHERegs *dtheBaseAddress, SHARegs *hmacBaseAddress, uint32_t intFlags) |
|
void | HMAC_clearInterrupt (DTHERegs *dtheBaseAddress, uint32_t intFlags) |
|
uint32_t | HMAC_getInterruptStatus (DTHERegs *dtheBaseAddress, SHARegs *hmacBaseAddress, uint8_t masked) |
|
The section has a list of all the HMAC functions used internally by the driver.
void HMAC_clearInterrupt |
( |
DTHERegs * |
dtheBaseAddress, |
|
|
uint32_t |
intFlags |
|
) |
| |
Description
The function clears the HMAC interrupts.
- Note
- The DMA done interrupts are the only interrupts that can be cleared using this function. The remaining interrupts can be disabled using the HMAC_disableInterrupt() function.
- Parameters
-
[in] | dtheBaseAddress | Base address of DTHE module memory mapped registers. |
[in] | intFlags | Bit mask for the following interrupt sources. HMAC_INT_DMA_CONTEXT_IN - Context DMA done interrupt HMAC_INT_DMA_CONTEXT_OUT - Authentication tag (and IV) DMA done interrupt HMAC_INT_DMA_DATA_IN - Data input DMA done interrupt HMAC_INT_DMA_DATA_OUT - Data output DMA done interrupt |
- Return values
-
void HMAC_disableInterrupt |
( |
DTHERegs * |
dtheBaseAddress, |
|
|
SHARegs * |
hmacBaseAddress, |
|
|
uint32_t |
intFlags |
|
) |
| |
Description
The function disables the HMAC interrupts.
- Parameters
-
[in] | dtheBaseAddress | Base address of DTHE module memory mapped registers. |
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | intFlags | Bit mask for the following interrupt sources. HMAC_INT_CONTEXT_READY - Context input registers are ready. HMAC_INT_PARTHASH_READY - Context output registers are ready after a context switch. HMAC_INT_INPUT_READY - Data FIFO is ready to receive data. HMAC_INT_OUTPUT_READY - Context output registers are ready. |
- Return values
-
void HMAC_enableInterrupt |
( |
DTHERegs * |
dtheBaseAddress, |
|
|
SHARegs * |
hmacBaseAddress, |
|
|
uint32_t |
intFlags |
|
) |
| |
Description
The function enables the HMAC interrupts.
- Parameters
-
[in] | dtheBaseAddress | Base address of DTHE module memory mapped registers. |
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | intFlags | Bit mask for the following interrupt sources. HMAC_INT_CONTEXT_READY - Context input registers are ready. HMAC_INT_PARTHASH_READY - Context output registers are ready after a context switch. HMAC_INT_INPUT_READY - Data FIFO is ready to receive data. HMAC_INT_OUTPUT_READY - Context output registers are ready. |
- Return values
-
uint32_t HMAC_getDigestSize |
( |
uint32_t |
config | ) |
|
Description
This function returns the number of bytes of digest for the specified hash algorithm.
- Parameters
-
[in] | config | Bit values for the algorithm as specified in the mode register. |
- Return values
-
Number | of bytes in the digest. |
Return without reading a result since the hardware appears to be misconfigured.
uint32_t HMAC_getInterruptStatus |
( |
DTHERegs * |
dtheBaseAddress, |
|
|
SHARegs * |
hmacBaseAddress, |
|
|
uint8_t |
masked |
|
) |
| |
Description
The function returns the interrupt status.
- Parameters
-
[in] | dtheBaseAddress | Base address of DTHE module memory mapped registers. |
[in] | hmacBaseAddress | Base address of SHA module memory mapped registers. |
[in] | masked | 0 - Raw interrupt status is read. 1 - Masked interrupt status is read. |
- Return values
-
Bit | mask for the following interrupt sources. HMAC_INT_CONTEXT_READY - Context input registers are ready. HMAC_INT_PARTHASH_READY - Context output registers are ready after a context switch. HMAC_INT_INPUT_READY - Data FIFO is ready to receive data. HMAC_INT_OUTPUT_READY - Context output registers are ready. |
Description
The function Initialize the HMAC module.
- Return values
-
uint32_t HMAC_isReady |
( |
const SHARegs * |
hmacBaseAddress, |
|
|
uint32_t |
flag |
|
) |
| |
Description
The function checks if the interrupt register is ready for operation indicated by flag.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | flag | Indicates the bit positions to check if ready. |
- Return values
-
0 | - Not ready for access >0 - Ready for access |
uint32_t HMAC_readDigestCount |
( |
SHARegs * |
hmacBaseAddress | ) |
|
Description
This function reads the byte count of the current hashing operation.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[out] | ptrDigestCount | Pointer to a location to return the digest count. |
- Return values
-
void HMAC_readResult |
( |
SHARegs * |
hmacBaseAddress, |
|
|
uint8_t * |
ptrData |
|
) |
| |
Description
This function reads the result of a hash operation.The length of hash or digest depends on the algorithm used for hashing.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | ptrData | Pointer to a data buffer where the data is stored. |
- Return values
-
void HMAC_setConfig |
( |
SHARegs * |
hmacBaseAddress, |
|
|
uint32_t |
cryptoMode, |
|
|
uint8_t |
useAlgoConstant, |
|
|
uint8_t |
closeHash, |
|
|
uint8_t |
useHMACKey, |
|
|
uint8_t |
HMACOuterHash |
|
) |
| |
Description
The function configures the HMAC module with input configuration parameters.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | cryptoMode | Specifies the Hash algorithm. Valid values are: HMAC_ALGO_MD5 HMAC_ALGO_SHA1 HMAC_ALGO_SHA224 HMAC_ALGO_SHA256 |
[in] | useAlgoConstant | If set to 1, The initial digest register will be overwritten with the algorithm constants for the selected algorithm |
[in] | closeHash | Specifies if the hash is closed or not. 1 - hash/HMAC will be 'closed' at the end of the block and appropriate padding is added. 0 - hash/HMAC will not be closed and can be continued later. |
[in] | useHMACKey | The hash core will perform HMAC key processing on the 512 bit HMAC key loaded in the digest registers. |
[in] | HMACOuterHash | 1 - The HMAC Outer Hash is performed on the hash digest when the inner hash hash finished. |
- Return values
-
void HMAC_setDataLength |
( |
SHARegs * |
hmacBaseAddress, |
|
|
uint32_t |
dataLength |
|
) |
| |
Description
The function configures the data length of the the block to be processed.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | dataLength | Length of the block in bytes. Note: The value must be a multiple of 64 if the close hash is not set in the mode register. |
- Return values
-
void HMAC_setHMACKey |
( |
SHARegs * |
hmacBaseAddress, |
|
|
const uint8_t * |
ptrKey |
|
) |
| |
Description
This function writes HMAC key to the inner or outer digest registers.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | ptrKey | Pointer to the key. Note: Key MUST be 64 bytes long. |
- Return values
-
void HMAC_setHMACPPKey |
( |
SHARegs * |
hmacBaseAddress, |
|
|
const uint8_t * |
ptrKey |
|
) |
| |
Description
This function writes a pre-processed HMAC key to the inner or outer digest registers.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | ptrKey | Pointer to the key. Note: Key MUST be 64 bytes long. |
- Return values
-
void HMAC_writeData |
( |
SHARegs * |
hmacBaseAddress, |
|
|
const uint8_t * |
ptrData |
|
) |
| |
Description
This function writes 16 words of data into the data register. If the data registers are not ready, the function will block the caller.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | ptrData | Pointer to the data buffer. |
- Return values
-
void HMAC_writeDigestCount |
( |
SHARegs * |
hmacBaseAddress, |
|
|
uint32_t |
digestCount |
|
) |
| |
Description
This function writes the byte count of the current hashing operation.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[in] | digestCount | Number of bytes to write. |
- Return values
-
void HMAC_writeResult |
( |
SHARegs * |
hmacBaseAddress, |
|
|
uint8_t * |
ptrData |
|
) |
| |
Description
This function writes the result of a hash operation.The length of hash or digest depends on the algorithm used for hashing.
- Parameters
-
[in] | hmacBaseAddress | Base address of HMAC module memory mapped registers. |
[out] | ptrData | Pointer to a data buffer where the data is stored. |
- Return values
-