MSP432E4 DriverLib API Guide
1.11.00.03
|
Functions | |
void | DESReset (uint32_t ui32Base) |
void | DESConfigSet (uint32_t ui32Base, uint32_t ui32Config) |
void | DESKeySet (uint32_t ui32Base, uint32_t *pui32Key) |
bool | DESIVSet (uint32_t ui32Base, uint32_t *pui32IVdata) |
void | DESLengthSet (uint32_t ui32Base, uint32_t ui32Length) |
bool | DESDataReadNonBlocking (uint32_t ui32Base, uint32_t *pui32Dest) |
void | DESDataRead (uint32_t ui32Base, uint32_t *pui32Dest) |
bool | DESDataWriteNonBlocking (uint32_t ui32Base, uint32_t *pui32Src) |
void | DESDataWrite (uint32_t ui32Base, uint32_t *pui32Src) |
bool | DESDataProcess (uint32_t ui32Base, uint32_t *pui32Src, uint32_t *pui32Dest, uint32_t ui32Length) |
uint32_t | DESIntStatus (uint32_t ui32Base, bool bMasked) |
void | DESIntEnable (uint32_t ui32Base, uint32_t ui32IntFlags) |
void | DESIntDisable (uint32_t ui32Base, uint32_t ui32IntFlags) |
void | DESIntClear (uint32_t ui32Base, uint32_t ui32IntFlags) |
void | DESIntRegister (uint32_t ui32Base, void(*pfnHandler)(void)) |
void | DESIntUnregister (uint32_t ui32Base) |
void | DESDMAEnable (uint32_t ui32Base, uint32_t ui32Flags) |
void | DESDMADisable (uint32_t ui32Base, uint32_t ui32Flags) |
The DES module driver provides a method for performing encryption and decryption operations on blocks of 64-bits of data. The configuration and feature highlights are:
The DES API consists of functions for configuring the DES module and processing data.
The following example sets up the DES module to perform an encryption operation on four blocks of data in CBC mode with an 64-bit key.
void DESReset | ( | uint32_t | ui32Base | ) |
Resets the DES Module.
ui32Base | is the base address of the DES module. |
This function performs a soft-reset sequence of the DES module.
References ASSERT, DES_O_SYSCONFIG, DES_O_SYSSTATUS, DES_SYSCONFIG_SOFTRESET, DES_SYSSTATUS_RESETDONE, and HWREG.
void DESConfigSet | ( | uint32_t | ui32Base, |
uint32_t | ui32Config | ||
) |
Configures the DES module for operation.
ui32Base | is the base address of the DES module. |
ui32Config | is the configuration of the DES module. |
This function configures the DES module for operation.
The ui32Config parameter is a bit-wise OR of a number of configuration flags. The valid flags are grouped below based on their function.
The direction of the operation is specified with one of the following two flags. Only one is permitted.
The operational mode of the DES engine is specified with one of the following flags. Only one is permitted.
The selection of single DES or triple DES is specified with one of the following two flags. Only one is permitted.
References ASSERT, DES_CTRL_CONTEXT, DES_O_CTRL, and HWREG.
void DESKeySet | ( | uint32_t | ui32Base, |
uint32_t * | pui32Key | ||
) |
Sets the key used for DES operations.
ui32Base | is the base address of the DES module. |
pui32Key | is a pointer to an array that holds the key |
This function sets the key used for DES operations.
pui32Key should be 64 bits long (2 words) if single DES is being used or 192 bits (6 words) if triple DES is being used.
References ASSERT, DES_CFG_TRIPLE, DES_O_CTRL, DES_O_KEY1_H, DES_O_KEY1_L, DES_O_KEY2_H, DES_O_KEY2_L, DES_O_KEY3_H, DES_O_KEY3_L, and HWREG.
bool DESIVSet | ( | uint32_t | ui32Base, |
uint32_t * | pui32IVdata | ||
) |
Sets the initialization vector in the DES module.
ui32Base | is the base address of the DES module. |
pui32IVdata | is a pointer to an array of 64 bits (2 words) of data to be written into the initialization vectors registers. |
This function sets the initialization vector in the DES module. It returns true if the registers were successfully written. If the context registers cannot be written at the time the function was called, then false is returned.
References ASSERT, DES_CTRL_CONTEXT, DES_O_CTRL, DES_O_IV_H, DES_O_IV_L, and HWREG.
void DESLengthSet | ( | uint32_t | ui32Base, |
uint32_t | ui32Length | ||
) |
Sets the crytographic data length in the DES module.
ui32Base | is the base address of the DES module. |
ui32Length | is the length of the data in bytes. |
This function writes the cryptographic data length into the DES module. When this register is written, the engine is triggered to start using this context.
References ASSERT, DES_O_LENGTH, and HWREG.
bool DESDataReadNonBlocking | ( | uint32_t | ui32Base, |
uint32_t * | pui32Dest | ||
) |
Reads plaintext/ciphertext from data registers without blocking
ui32Base | is the base address of the DES module. |
pui32Dest | is a pointer to an array of 2 words. |
This function returns true if the data was ready when the function was called. If the data was not ready, false is returned.
References ASSERT, DES_CTRL_OUTPUT_READY, DES_O_CTRL, DES_O_DATA_H, DES_O_DATA_L, and HWREG.
Referenced by DESDataProcess().
void DESDataRead | ( | uint32_t | ui32Base, |
uint32_t * | pui32Dest | ||
) |
Reads plaintext/ciphertext from data registers with blocking.
ui32Base | is the base address of the DES module. |
pui32Dest | is a pointer to an array of bytes. |
This function waits until the DES module is finished and encrypted or decrypted data is ready. The output data is then stored in the pui32Dest array.
References ASSERT, DES_CTRL_OUTPUT_READY, DES_O_CTRL, DES_O_DATA_H, DES_O_DATA_L, and HWREG.
bool DESDataWriteNonBlocking | ( | uint32_t | ui32Base, |
uint32_t * | pui32Src | ||
) |
Writes plaintext/ciphertext to data registers without blocking
ui32Base | is the base address of the DES module. |
pui32Src | is a pointer to an array of 2 words. |
This function returns false if the DES module is not ready to accept data. It returns true if the data was written successfully.
References ASSERT, DES_CTRL_INPUT_READY, DES_O_CTRL, DES_O_DATA_H, DES_O_DATA_L, and HWREG.
Referenced by DESDataProcess().
void DESDataWrite | ( | uint32_t | ui32Base, |
uint32_t * | pui32Src | ||
) |
Writes plaintext/ciphertext to data registers without blocking
ui32Base | is the base address of the DES module. |
pui32Src | is a pointer to an array of bytes. |
This function waits until the DES module is ready before writing the data contained in the pui32Src array.
References ASSERT, DES_CTRL_INPUT_READY, DES_O_CTRL, DES_O_DATA_H, DES_O_DATA_L, and HWREG.
bool DESDataProcess | ( | uint32_t | ui32Base, |
uint32_t * | pui32Src, | ||
uint32_t * | pui32Dest, | ||
uint32_t | ui32Length | ||
) |
Processes blocks of data through the DES module.
ui32Base | is the base address of the DES module. |
pui32Src | is a pointer to an array of words that contains the source data for processing. |
pui32Dest | is a pointer to an array of words consisting of the processed data. |
ui32Length | is the length of the cryptographic data in bytes. It must be a multiple of eight. |
This function takes the data contained in the pui32Src array and processes it using the DES engine. The resulting data is stored in the pui32Dest array. The function blocks until all of the data has been processed. If processing is successful, the function returns true.
References ASSERT, DES_CTRL_INPUT_READY, DES_CTRL_OUTPUT_READY, DES_O_CTRL, DES_O_LENGTH, DESDataReadNonBlocking(), DESDataWriteNonBlocking(), and HWREG.
uint32_t DESIntStatus | ( | uint32_t | ui32Base, |
bool | bMasked | ||
) |
Returns the current interrupt status of the DES module.
ui32Base | is the base address of the DES module. |
bMasked | is false if the raw interrupt status is required and true if the masked interrupt status is required. |
This function gets the current interrupt status of the DES module. The value returned is a logical OR of the following values:
References ASSERT, DES_O_DMAMIS, DES_O_DMARIS, DES_O_IRQENABLE, DES_O_IRQSTATUS, and HWREG.
void DESIntEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32IntFlags | ||
) |
Enables interrupts in the DES module.
ui32Base | is the base address of the DES module. |
ui32IntFlags | is a bit mask of the interrupts to be enabled. |
ui32IntFlags should be a logical OR of one or more of the following values:
References ASSERT, DES_INT_CONTEXT_IN, DES_INT_DATA_IN, DES_INT_DATA_OUT, DES_INT_DMA_CONTEXT_IN, DES_INT_DMA_DATA_IN, DES_INT_DMA_DATA_OUT, DES_O_DMAIM, DES_O_IRQENABLE, and HWREG.
void DESIntDisable | ( | uint32_t | ui32Base, |
uint32_t | ui32IntFlags | ||
) |
Disables interrupts in the DES module.
ui32Base | is the base address of the DES module. |
ui32IntFlags | is a bit mask of the interrupts to be disabled. |
This function disables interrupt sources in the DES module. ui32IntFlags should be a logical OR of one or more of the following values:
References ASSERT, DES_INT_CONTEXT_IN, DES_INT_DATA_IN, DES_INT_DATA_OUT, DES_INT_DMA_CONTEXT_IN, DES_INT_DMA_DATA_IN, DES_INT_DMA_DATA_OUT, DES_O_DMAIM, DES_O_IRQENABLE, and HWREG.
void DESIntClear | ( | uint32_t | ui32Base, |
uint32_t | ui32IntFlags | ||
) |
Clears interrupts in the DES module.
ui32Base | is the base address of the DES module. |
ui32IntFlags | is a bit mask of the interrupts to be disabled. |
This function disables interrupt sources in the DES module. ui32IntFlags should be a logical OR of one or more of the following values:
References ASSERT, DES_INT_DMA_CONTEXT_IN, DES_INT_DMA_DATA_IN, DES_INT_DMA_DATA_OUT, DES_O_DMAIC, and HWREG.
void DESIntRegister | ( | uint32_t | ui32Base, |
void(*)(void) | pfnHandler | ||
) |
Registers an interrupt handler for the DES module.
ui32Base | is the base address of the DES module. |
pfnHandler | is a pointer to the function to be called when the enabled DES interrupts occur. |
This function registers the interrupt handler in the interrupt vector table, and enables DES interrupts on the interrupt controller; specific DES interrupt sources must be enabled using DESIntEnable(). The interrupt handler being registered must clear the source of the interrupt using DESIntClear().
If the application is using a static interrupt vector table stored in flash, then it is not necessary to register the interrupt handler this way. Instead, IntEnable() should be used to enable DES interrupts on the interrupt controller.
References ASSERT, INT_DES0, IntEnable(), and IntRegister().
void DESIntUnregister | ( | uint32_t | ui32Base | ) |
Unregisters an interrupt handler for the DES module.
ui32Base | is the base address of the DES module. |
This function unregisters the previously registered interrupt handler and disables the interrupt in the interrupt controller.
References ASSERT, INT_DES0, IntDisable(), and IntUnregister().
void DESDMAEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32Flags | ||
) |
Enables DMA request sources in the DES module.
ui32Base | is the base address of the DES module. |
ui32Flags | is a bit mask of the DMA requests to be enabled. |
This function enables DMA request sources in the DES module. The ui32Flags parameter should be the logical OR of any of the following:
References ASSERT, DES_DMA_CONTEXT_IN, DES_DMA_DATA_IN, DES_DMA_DATA_OUT, DES_O_SYSCONFIG, and HWREG.
void DESDMADisable | ( | uint32_t | ui32Base, |
uint32_t | ui32Flags | ||
) |
Disables DMA request sources in the DES module.
ui32Base | is the base address of the DES module. |
ui32Flags | is a bit mask of the DMA requests to be disabled. |
This function disables DMA request sources in the DES module. The ui32Flags parameter should be the logical OR of any of the following:
References ASSERT, DES_DMA_CONTEXT_IN, DES_DMA_DATA_IN, DES_DMA_DATA_OUT, DES_O_SYSCONFIG, and HWREG.