Escolar Documentos
Profissional Documentos
Cultura Documentos
32 bytes.
Returns:
Returns true if data was processed successfully. Returns false if data processing failed.
5.2.2.5 AESDataProcessAuth
Processes and authenticates blocks of data, either encrypt it or decrypts it.
February 07, 2014 51
AES
Prototype:
bool
AESDataProcessAuth(uint32_t ui32Base,
uint32_t
*
pui32Src,
uint32_t
*
pui32Dest,
uint32_t ui32Length,
uint32_t
*
pui32AuthSrc,
uint32_t ui32AuthLength,
uint32_t
*
pui32Tag)
Parameters:
ui32Base is the base address of the AES module.
pui32Src is a pointer to the memory location where the input data is stored. The data must
be padded to the 16-byte boundary.
pui32Dest is a pointer to the memory location output is written. The space for written data
must be rounded up to the 16-byte boundary.
ui32Length is the length of the cryptographic data in bytes.
pui32AuthSrc is a pointer to the memory location where the additional authentication data is
stored. The data must be padded to the 16-byte boundary.
ui32AuthLength is the length of the additional authentication data in bytes.
pui32Tag is a pointer to a 4-word array where the hash tag is written.
Description:
This function encrypts or decrypts blocks of data in addition to authentication data. A hash
tag is also produced. Before calling this function, ensure that the AES module is properly
congured the key, data size, mode, etc. Only CCM and GCM modes should be used.
Returns:
Returns true if data was processed successfully. Returns false if data processing failed.
5.2.2.6 AESDataRead
Reads plaintext/ciphertext from data registers with blocking.
Prototype:
void
AESDataRead(uint32_t ui32Base,
uint32_t
*
pui32Dest)
Parameters:
ui32Base is the base address of the AES module.
pui32Dest is a pointer to an array of words.
Description:
This function reads a block of either plaintext or ciphertext out of the AES module. If the output
is not ready, the function waits until it is ready. A block is 16 bytes or 4 words.
Returns:
None.
52 February 07, 2014
AES
5.2.2.7 AESDataReadNonBlocking
Reads plaintext/ciphertext from data registers without blocking.
Prototype:
bool
AESDataReadNonBlocking(uint32_t ui32Base,
uint32_t
*
pui32Dest)
Parameters:
ui32Base is the base address of the AES module.
pui32Dest is a pointer to an array of words of data.
Description:
This function reads a block of either plaintext or ciphertext out of the AES module. If the output
data is not ready, the function returns false. If the read completed successfully, the function
returns true. A block is 16 bytes or 4 words.
Returns:
true or false.
5.2.2.8 AESDataWrite
Writes plaintext/ciphertext to data registers with blocking.
Prototype:
void
AESDataWrite(uint32_t ui32Base,
uint32_t
*
pui32Src)
Parameters:
ui32Base is the base address of the AES module.
pui32Src is a pointer to an array of bytes.
Description:
This function writes a block of either plaintext or ciphertext into the AES module. If the input is
not ready, the function waits until it is ready before performing the write. A block is 16 bytes or
4 words.
Returns:
None.
5.2.2.9 AESDataWriteNonBlocking
Writes plaintext/ciphertext to data registers without blocking.
Prototype:
bool
AESDataWriteNonBlocking(uint32_t ui32Base,
uint32_t
*
pui32Src)
February 07, 2014 53
AES
Parameters:
ui32Base is the base address of the AES module.
pui32Src is a pointer to an array of words of data.
Description:
This function writes a block of either plaintext or ciphertext into the AES module. If the input
is not ready, the function returns false. If the write completed successfully, the function returns
true. A block is 16 bytes or 4 words.
Returns:
True or false.
5.2.2.10 AESDMADisable
Disables uDMA requests for the AES module.
Prototype:
void
AESDMADisable(uint32_t ui32Base,
uint32_t ui32Flags)
Parameters:
ui32Base is the base address of the AES module.
ui32Flags is a bit mask of the uDMA requests to be disabled.
Description:
This function disables the uDMA request sources in the AES module. The ui32Flags parameter
is the logical OR of any of the following:
AES_DMA_DATA_IN
AES_DMA_DATA_OUT
AES_DMA_CONTEXT_IN
AES_DMA_CONTEXT_OUT
Returns:
None.
5.2.2.11 AESDMAEnable
Enables uDMA requests for the AES module.
Prototype:
void
AESDMAEnable(uint32_t ui32Base,
uint32_t ui32Flags)
Parameters:
ui32Base is the base address of the AES module.
ui32Flags is a bit mask of the uDMA requests to be enabled.
54 February 07, 2014
AES
Description:
This function enables the uDMA request sources in the AES module. The ui32Flags parameter
is the logical OR of any of the following:
AES_DMA_DATA_IN
AES_DMA_DATA_OUT
AES_DMA_CONTEXT_IN
AES_DMA_CONTEXT_OUT
Returns:
None.
5.2.2.12 AESIntClear
Clears AES module interrupts.
Prototype:
void
AESIntClear(uint32_t ui32Base,
uint32_t ui32IntFlags)
Parameters:
ui32Base is the base address of the AES module.
ui32IntFlags is a bit mask of the interrupt sources to disable.
Description:
This function clears the interrupt sources in the AES module. The ui32IntFlags parameter is
the logical OR of any of the following:
AES_INT_DMA_CONTEXT_IN - Context DMA done interrupt
AES_INT_DMA_CONTEXT_OUT - Authentication tag (and IV) DMA done interrupt
AES_INT_DMA_DATA_IN - Data input DMA done interrupt
AES_INT_DMA_DATA_OUT - Data output DMA done interrupt
Note:
Only the DMA done interrupts can be cleared. The remaining interrupts should be disabled
with AESIntDisable().
Returns:
None.
5.2.2.13 AESIntDisable
Disables AES module interrupts.
Prototype:
void
AESIntDisable(uint32_t ui32Base,
uint32_t ui32IntFlags)
February 07, 2014 55
AES
Parameters:
ui32Base is the base address of the AES module.
ui32IntFlags is a bit mask of the interrupt sources to disable.
Description:
This function disables the interrupt sources in the AES module. The ui32IntFlags parameter is
the logical OR of any of the following:
AES_INT_CONTEXT_IN - Context interrupt
AES_INT_CONTEXT_OUT - Authentication tag (and IV) interrupt
AES_INT_DATA_IN - Data input interrupt
AES_INT_DATA_OUT - Data output interrupt
AES_INT_DMA_CONTEXT_IN - Context DMA done interrupt
AES_INT_DMA_CONTEXT_OUT - Authentication tag (and IV) DMA done interrupt
AES_INT_DMA_DATA_IN - Data input DMA done interrupt
AES_INT_DMA_DATA_OUT - Data output DMA done interrupt
Note:
The DMA done interrupts are the only interrupts that can be cleared. The remaining interrupts
can be disabled instead using AESIntDisable().
Returns:
None.
5.2.2.14 AESIntEnable
Enables AES module interrupts.
Prototype:
void
AESIntEnable(uint32_t ui32Base,
uint32_t ui32IntFlags)
Parameters:
ui32Base is the base address of the AES module.
ui32IntFlags is a bit mask of the interrupt sources to enable.
Description:
This function enables the interrupts in the AES module. The ui32IntFlags parameter is the
logical OR of any of the following:
AES_INT_CONTEXT_IN - Context interrupt
AES_INT_CONTEXT_OUT - Authentication tag (and IV) interrupt
AES_INT_DATA_IN - Data input interrupt
AES_INT_DATA_OUT - Data output interrupt
AES_INT_DMA_CONTEXT_IN - Context DMA done interrupt
AES_INT_DMA_CONTEXT_OUT - Authentication tag (and IV) DMA done interrupt
AES_INT_DMA_DATA_IN - Data input DMA done interrupt
AES_INT_DMA_DATA_OUT - Data output DMA done interrupt
56 February 07, 2014
AES
Note:
Interrupts that have been previously been enabled are not disabled when this function is called.
Returns:
None.
5.2.2.15 AESIntRegister
Registers an interrupt handler for the AES module.
Prototype:
void
AESIntRegister(uint32_t ui32Base,
void (
*
pfnHandler)(void))
Parameters:
ui32Base is the base address of the AES module.
pfnHandler is a pointer to the function to be called when the enabled AES interrupts occur.
Description:
This function registers the interrupt handler in the interrupt vector table, and enables AES
interrupts on the interrupt controller; specic AES interrupt sources must be enabled using
AESIntEnable(). The interrupt handler being registered must clear the source of the interrupt
using AESIntClear().
If the application is using a static interrupt vector table stored in ash, then it is not necessary
to register the interrupt handler this way. Instead, IntEnable() is used to enable AES interrupts
on the interrupt controller.
See also:
IntRegister() for important information about registering interrupt handlers.
Returns:
None.
5.2.2.16 AESIntStatus
Returns the current AES module interrupt status.
Prototype:
uint32_t
AESIntStatus(uint32_t ui32Base,
bool bMasked)
Parameters:
ui32Base is the base address of the AES module.
bMasked is false if the raw interrupt status is required and true if the masked interrupt status
is required.
Returns:
Returns a bit mask of the interrupt sources, which is a logical OR of any of the following:
February 07, 2014 57
AES
AES_INT_CONTEXT_IN - Context interrupt
AES_INT_CONTEXT_OUT - Authentication tag (and IV) interrupt.
AES_INT_DATA_IN - Data input interrupt
AES_INT_DATA_OUT - Data output interrupt
AES_INT_DMA_CONTEXT_IN - Context DMA done interrupt
AES_INT_DMA_CONTEXT_OUT - Authentication tag (and IV) DMA done interrupt
AES_INT_DMA_DATA_IN - Data input DMA done interrupt
AES_INT_DMA_DATA_OUT - Data output DMA done interrupt
5.2.2.17 void AESIntUnregister (uint32_t ui32Base)
Unregisters an interrupt handler for the AES module.
Parameters:
ui32Base is the base address of the AES module.
Description:
This function unregisters the previously registered interrupt handler and disables the interrupt
in the interrupt controller.
See also:
IntRegister() for important information about registering interrupt handlers.
Returns:
None.
5.2.2.18 AESIVRead
Saves the Initial Vector (IV) registers to a user-dened location.
Prototype:
void
AESIVRead(uint32_t ui32Base,
uint32_t
*
pui32IVData)
Parameters:
ui32Base is the base address of the AES module.
pui32IVData is pointer to the location that stores the IV data.
Description:
This function stores the IV for use with authenticated encryption and decryption operations. It
is assumed that the AES_CTRL_SAVE_CONTEXT bit is set in the AES_CTRL register.
Returns:
None.
58 February 07, 2014
AES
5.2.2.19 AESIVSet
Writes the Initial Vector (IV) register, needed in some of the AES Modes.
Prototype:
void
AESIVSet(uint32_t ui32Base,
uint32_t
*
pui32IVdata)
Parameters:
ui32Base is the base address of the AES module.
pui32IVdata is an array of 4 words (128 bits), containing the IV value to be congured. The
least signicant word is in the 0th index.
Description:
This functions writes the initial vector registers in the AES module.
Returns:
None.
5.2.2.20 AESKey1Set
Writes the key 1 conguration registers, which are used for encryption or decryption.
Prototype:
void
AESKey1Set(uint32_t ui32Base,
uint32_t
*
pui32Key,
uint32_t ui32Keysize)
Parameters:
ui32Base is the base address for the AES module.
pui32Key is an array of 32-bit words, containing the key to be congured. The least signicant
word in the 0th index.
ui32Keysize is the size of the key, which must be one of the following values:
AES_CFG_KEY_SIZE_128, AES_CFG_KEY_SIZE_192, or AES_CFG_KEY_SIZE_256.
Description:
This function writes key 1 conguration registers based on the key size. This function is used
in all modes.
Returns:
None.
5.2.2.21 AESKey2Set
Writes the key 2 conguration registers, which are used for encryption or decryption.
Prototype:
void
AESKey2Set(uint32_t ui32Base,
February 07, 2014 59
AES
uint32_t
*
pui32Key,
uint32_t ui32Keysize)
Parameters:
ui32Base is the base address for the AES module.
pui32Key is an array of 32-bit words, containing the key to be congured. The least signicant
word in the 0th index.
ui32Keysize is the size of the key, which must be one of the following values:
AES_CFG_KEY_SIZE_128, AES_CFG_KEY_SIZE_192, or AES_CFG_KEY_SIZE_256.
Description:
This function writes the key 2 conguration registers based on the key size. This function is
used in the F8, F9, XTS, CCM, and CBC-MAC modes.
Returns:
None.
5.2.2.22 AESKey3Set
Writes key 3 conguration registers, which are used for encryption or decryption.
Prototype:
void
AESKey3Set(uint32_t ui32Base,
uint32_t
*
pui32Key)
Parameters:
ui32Base is the base address for the AES module.
pui32Key is a pointer to an array of 4 words (128 bits), containing the key to be congured.
The least signicant word is in the 0th index.
Description:
This function writes the key 2 conguration registers with key 3 data used in CBC-MAC and F8
modes. This key is always 128 bits.
Returns:
None.
5.2.2.23 AESLengthSet
Used to set the write crypto data length in the AES module.
Prototype:
void
AESLengthSet(uint32_t ui32Base,
uint64_t ui64Length)
Parameters:
ui32Base is the base address of the AES module.
ui64Length is the crypto data length in bytes.
60 February 07, 2014
AES
Description:
This function stores the cryptographic data length in blocks for all modes. Data lengths up to
(2