Functions | |
uint8_t | AES_setCipherKey (uint16_t baseAddress, const uint8_t *CipherKey) |
Loads a 128 bit cipher key to AES module. More... | |
uint8_t | AES_encryptData (uint16_t baseAddress, const uint8_t *Data, uint8_t *encryptedData) |
Encrypts a block of data using the AES module. More... | |
uint8_t | AES_decryptData (uint16_t baseAddress, const uint8_t *Data, uint8_t *decryptedData) |
Decrypts a block of data using the AES module. More... | |
uint8_t | AES_setDecipherKey (uint16_t baseAddress, const uint8_t *CipherKey) |
Sets the decipher key The API. More... | |
void | AES_clearInterrupt (uint16_t baseAddress) |
Clears the AES ready interrupt flag. More... | |
uint32_t | AES_getInterruptStatus (uint16_t baseAddress) |
Gets the AES ready interrupt flag status. More... | |
void | AES_enableInterrupt (uint16_t baseAddress) |
Enables AES ready interrupt. More... | |
void | AES_disableInterrupt (uint16_t baseAddress) |
Disables AES ready interrupt. More... | |
void | AES_reset (uint16_t baseAddress) |
Resets AES Module immediately. More... | |
uint8_t | AES_startEncryptData (uint16_t baseAddress, const uint8_t *Data, uint8_t *encryptedData) |
Starts an encryption process on the AES module. More... | |
uint8_t | AES_startDecryptData (uint16_t baseAddress, const uint8_t *Data) |
Decrypts a block of data using the AES module. More... | |
uint8_t | AES_startSetDecipherKey (uint16_t baseAddress, const uint8_t *CipherKey) |
Loads the decipher key. More... | |
uint8_t | AES_getDataOut (uint16_t baseAddress, uint8_t *OutputData) |
Reads back the output data from AES module. More... | |
uint8_t | AES_isBusy (uint16_t baseAddress) |
Gets the AES module busy status. More... | |
void | AES_clearErrorFlag (uint16_t baseAddress) |
Clears the AES error flag. More... | |
uint32_t | AES_getErrorFlagStatus (uint16_t baseAddress) |
Gets the AES error flag status. More... | |
uint8_t | AES_startDecryptDataUsingEncryptionKey (uint16_t baseAddress, const uint8_t *Data) |
DEPRECATED Starts an decryption process on the AES module. More... | |
uint8_t | AES_decryptDataUsingEncryptionKey (uint16_t baseAddress, const uint8_t *Data, uint8_t *decryptedData) |
DEPRECATED Decrypts a block of data using the AES module. More... | |
void AES_clearErrorFlag | ( | uint16_t | baseAddress | ) |
Clears the AES error flag.
Clears the AES error flag that results from a key or data being written while the AES module is busy. Modified bit is AESERRFG of AESACTL0 register.
baseAddress | is the base address of the AES module. |
Modified bits are AESERRFG of AESACTL0 register.
void AES_clearInterrupt | ( | uint16_t | baseAddress | ) |
Clears the AES ready interrupt flag.
This function clears the AES ready interrupt flag. This flag is automatically cleared when AESADOUT is read, or when AESAKEY or AESADIN is written. This function should be used when the flag needs to be reset and it has not been automatically cleared by one of the previous actions.
baseAddress | is the base address of the AES module. |
Modified bits are AESRDYIFG of AESACTL0 register.
uint8_t AES_decryptData | ( | uint16_t | baseAddress, |
const uint8_t * | Data, | ||
uint8_t * | decryptedData | ||
) |
Decrypts a block of data using the AES module.
This function requires a pre-generated decryption key. A key can be loaded and pre-generated by using function AES_startSetDecipherKey() or AES_setDecipherKey(). The decryption takes 167 MCLK.
baseAddress | is the base address of the AES module. |
Data | is a pointer to an uint8_t array with a length of 16 bytes that contains encrypted data to be decrypted. |
decryptedData | is a pointer to an uint8_t array with a length of 16 bytes in that the decrypted data will be written. |
uint8_t AES_decryptDataUsingEncryptionKey | ( | uint16_t | baseAddress, |
const uint8_t * | Data, | ||
uint8_t * | decryptedData | ||
) |
DEPRECATED Decrypts a block of data using the AES module.
This function can be used to decrypt data by using the same key as used for a previous performed encryption. The decryption takes 214 MCLK.
baseAddress | is the base address of the AES module. |
Data | is a pointer to an uint8_t array with a length of 16 bytes that contains encrypted data to be decrypted. |
decryptedData | is a pointer to an uint8_t array with a length of 16 bytes in that the decrypted data will be written. |
void AES_disableInterrupt | ( | uint16_t | baseAddress | ) |
Disables AES ready interrupt.
Disables AES ready interrupt. This interrupt is reset by a PUC, but not reset by AES_reset.
baseAddress | is the base address of the AES module. |
Modified bits are AESRDYIE of AESACTL0 register.
void AES_enableInterrupt | ( | uint16_t | baseAddress | ) |
Enables AES ready interrupt.
Enables AES ready interrupt. This interrupt is reset by a PUC, but not reset by AES_reset. Does not clear interrupt flags.
baseAddress | is the base address of the AES module. |
Modified bits are AESRDYIE of AESACTL0 register.
uint8_t AES_encryptData | ( | uint16_t | baseAddress, |
const uint8_t * | Data, | ||
uint8_t * | encryptedData | ||
) |
Encrypts a block of data using the AES module.
The cipher key that is used for encryption should be loaded in advance by using function AES_setCipherKey()
baseAddress | is the base address of the AES module. |
Data | is a pointer to an uint8_t array with a length of 16 bytes that contains data to be encrypted. |
encryptedData | is a pointer to an uint8_t array with a length of 16 bytes in that the encrypted data will be written. |
uint8_t AES_getDataOut | ( | uint16_t | baseAddress, |
uint8_t * | OutputData | ||
) |
Reads back the output data from AES module.
This function is meant to use after an encryption or decryption process that was started and finished by initiating an interrupt by use of the AES_startEncryptData() or AES_startDecryptData() functions.
baseAddress | is the base address of the AES module. |
OutputData | is a pointer to an uint8_t array with a length of 16 bytes in which the output data of the AES module is available. If AES module is busy returns NULL. |
uint32_t AES_getErrorFlagStatus | ( | uint16_t | baseAddress | ) |
Gets the AES error flag status.
Checks the AES error flag that results from a key or data being written while the AES module is busy. If the flag is set, it needs to be cleared using AES_clearErrorFlag.
baseAddress | is the base address of the AES module. |
uint32_t AES_getInterruptStatus | ( | uint16_t | baseAddress | ) |
Gets the AES ready interrupt flag status.
This function checks the AES ready interrupt flag. This flag is automatically cleared when AESADOUT is read, or when AESAKEY or AESADIN is written. This function can be used to confirm that this has been done.
baseAddress | is the base address of the AES module. |
uint8_t AES_isBusy | ( | uint16_t | baseAddress | ) |
Gets the AES module busy status.
Gets the AES module busy status. If a key or data are written while the AES module is busy, an error flag will be thrown.
baseAddress | is the base address of the AES module. |
void AES_reset | ( | uint16_t | baseAddress | ) |
Resets AES Module immediately.
This function performs a software reset on the AES Module, note that this does not affect the AES ready interrupt.
baseAddress | is the base address of the AES module. |
Modified bits are AESSWRST of AESACTL0 register.
uint8_t AES_setCipherKey | ( | uint16_t | baseAddress, |
const uint8_t * | CipherKey | ||
) |
Loads a 128 bit cipher key to AES module.
This function loads a 128 bit cipher key to AES module.
baseAddress | is the base address of the AES module. |
CipherKey | is a pointer to an uint8_t array with a length of 16 bytes that contains a 128 bit cipher key. |
uint8_t AES_setDecipherKey | ( | uint16_t | baseAddress, |
const uint8_t * | CipherKey | ||
) |
Sets the decipher key The API.
The API AES_startSetDecipherKey() or AES_setDecipherKey() must be invoked before invoking AES_setDecipherKey().
baseAddress | is the base address of the AES module. |
CipherKey | is a pointer to an uint8_t array with a length of 16 bytes that contains the initial AES key. |
uint8_t AES_startDecryptData | ( | uint16_t | baseAddress, |
const uint8_t * | Data | ||
) |
Decrypts a block of data using the AES module.
This is the non-blocking equivalent of AES_decryptData(). This function requires a pre-generated decryption key. A key can be loaded and pre- generated by using function AES_setDecipherKey() or AES_startSetDecipherKey(). The decryption takes 167 MCLK. It is recommended to use interrupt to check for procedure completion then using AES_getDataOut() API to retrieve the decrypted data.
baseAddress | is the base address of the AES module. |
Data | is a pointer to an uint8_t array with a length of 16 bytes that contains encrypted data to be decrypted. |
uint8_t AES_startDecryptDataUsingEncryptionKey | ( | uint16_t | baseAddress, |
const uint8_t * | Data | ||
) |
DEPRECATED Starts an decryption process on the AES module.
This is the non-blocking equivalent of AES_decryptDataUsingEncryptionKey(). This function can be used to decrypt data by using the same key as used for a previous performed encryption. The decryption takes 214 MCLK.
baseAddress | is the base address of the AES module. |
Data | is a pointer to an uint8_t array with a length of 16 bytes that contains encrypted data to be decrypted. |
uint8_t AES_startEncryptData | ( | uint16_t | baseAddress, |
const uint8_t * | Data, | ||
uint8_t * | encryptedData | ||
) |
Starts an encryption process on the AES module.
This is the non-blocking equivalent of AES_encryptData(). The cipher key that is used for decryption should be loaded in advance by using function AES_setCipherKey(). It is recommended to use interrupt to check for procedure completion then using AES_getDataOut() API to retrieve the encrypted data.
baseAddress | is the base address of the AES module. |
Data | is a pointer to an uint8_t array with a length of 16 bytes that contains data to be encrypted. |
encryptedData | is a pointer to an uint8_t array with a length of 16 bytes in that the encrypted data will be written. |
uint8_t AES_startSetDecipherKey | ( | uint16_t | baseAddress, |
const uint8_t * | CipherKey | ||
) |
Loads the decipher key.
This is the non-blocking equivalent of AES_setDecipherKey(). The API AES_startSetDecipherKey() or AES_setDecipherKey() must be invoked before invoking AES_startSetDecipherKey().
baseAddress | is the base address of the AES module. |
CipherKey | is a pointer to an uint8_t array with a length of 16 bytes that contains the initial AES key. |