![]() |
![]() |
#include "inc/hw_types.h"
#include "driverlib/5xx_6xx/debug.h"
#include "driverlib/5xx_6xx/aes.h"
#include "deprecated/CCS/msp430xgeneric.h"
Functions | |
unsigned char | AES_setCipherKey (unsigned int baseAddress, const unsigned char *CipherKey) |
unsigned char | AES_encryptData (unsigned int baseAddress, const unsigned char *Data, unsigned char *encryptedData) |
unsigned char | AES_decryptDataUsingEncryptionKey (unsigned int baseAddress, const unsigned char *Data, unsigned char *decryptedData) |
unsigned char | AES_decryptData (unsigned int baseAddress, const unsigned char *Data, unsigned char *decryptedData) |
unsigned char | AES_generateFirstRoundKey (unsigned int baseAddress, const unsigned char *CipherKey) |
void | AES_clearInterruptFlag (unsigned int baseAddress) |
unsigned long | AES_getInterruptFlagStatus (unsigned int baseAddress) |
void | AES_enableInterrupt (unsigned int baseAddress) |
void | AES_disableInterrupt (unsigned int baseAddress) |
void | AES_reset (unsigned int baseAddress) |
unsigned char | AES_startEncryptData (unsigned int baseAddress, const unsigned char *Data, unsigned char *encryptedData) |
unsigned char | AES_startDecryptDataUsingEncryptionKey (unsigned int baseAddress, const unsigned char *Data) |
unsigned char | AES_startDecryptData (unsigned int baseAddress, const unsigned char *Data) |
unsigned char | AES_startGenerateFirstRoundKey (unsigned int baseAddress, const unsigned char *CipherKey) |
unsigned char | AES_getDataOut (unsigned int baseAddress, unsigned char *OutputData) |
unsigned char | AES_isBusy (unsigned int baseAddress) |
void | AES_clearErrorFlag (unsigned int baseAddress) |
unsigned long | AES_getErrorFlagStatus (unsigned int baseAddress) |
unsigned char AES_setCipherKey | ( | unsigned int | baseAddress, |
const unsigned char * | CipherKey | ||
) |
Loads a 128 bit cipher key to AES module.
baseAddress | is the base address of the AES module. |
CipherKey | is a pointer to an unsigned char array with a length of 16 bytes that contains a 128 bit cipher key. |
References HWREG, and STATUS_SUCCESS.
unsigned char AES_encryptData | ( | unsigned int | baseAddress, |
const unsigned char * | Data, | ||
unsigned char * | 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 unsigned char array with a length of 16 bytes that contains data to be encrypted. |
encryptedData | is a pointer to an unsigned char array with a length of 16 bytes in that the encrypted data will be written. |
References HWREG, and STATUS_SUCCESS.
unsigned char AES_decryptDataUsingEncryptionKey | ( | unsigned int | baseAddress, |
const unsigned char * | Data, | ||
unsigned char * | decryptedData | ||
) |
Decryptes 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 unsigned char array with a length of 16 bytes that contains encrypted data to be decrypted. |
decryptedData | is a pointer to an unsigned char array with a length of 16 bytes in that the decrypted data will be written. |
References HWREG, and STATUS_SUCCESS.
unsigned char AES_decryptData | ( | unsigned int | baseAddress, |
const unsigned char * | Data, | ||
unsigned char * | decryptedData | ||
) |
Decryptes a block of data using the AES module. This function requires a pregenerated decryption key. A key can be loaded and pregenerated by using function
AES_generateFirstRoundKey() | . The decryption takes 167 MCLK. |
baseAddress | is the base address of the AES module. |
Data | is a pointer to an unsigned char array with a length of 16 bytes that contains encrypted data to be decrypted. |
decryptedData | is a pointer to an unsigned char array with a length of 16 bytes in that the decrypted data will be written. |
References HWREG, and STATUS_SUCCESS.
unsigned char AES_generateFirstRoundKey | ( | unsigned int | baseAddress, |
const unsigned char * | CipherKey | ||
) |
Loads and generates first round key required for decryption
baseAddress | is the base address of the AES module. |
CipherKey | is a pointer to an unsigned char array with a length of 16 bytes that contains the initial AES key. |
References HWREG, and STATUS_SUCCESS.
void AES_clearInterruptFlag | ( | unsigned int | baseAddress | ) |
Clears the AES ready interrupt flag.
baseAddress | is the base address of the AES module. |
Modified bit is AESRDYIFG of AESACTL0 register.
References HWREGB.
unsigned long AES_getInterruptFlagStatus | ( | unsigned int | baseAddress | ) |
Gets the AES ready interrupt flag status.
baseAddress | is the base address of the AES module. |
References HWREGB.
void AES_enableInterrupt | ( | unsigned int | baseAddress | ) |
Enables AES ready interrupt.
baseAddress | is the base address of the AES module. Modified bit is AESRDYIE of AESACTL0 register. |
References HWREGB.
void AES_disableInterrupt | ( | unsigned int | baseAddress | ) |
Disables AES ready interrupt.
baseAddress | is the base address of the AES module. |
Modified bit is AESRDYIE of AESACTL0 register.
References HWREGB.
void AES_reset | ( | unsigned int | baseAddress | ) |
Resets AES Module immediately.
baseAddress | is the base address of the AES module. |
Modified bit is AESSWRST of AESACTL0 register.
References HWREGB.
unsigned char AES_startEncryptData | ( | unsigned int | baseAddress, |
const unsigned char * | Data, | ||
unsigned char * | encryptedData | ||
) |
Starts an encryption process on the AES module. This is the non-blocking equivalant of AES_encryptData. The cipher key that is used for decryption 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 unsigned char array with a length of 16 bytes that contains data to be encrypted. |
encryptedData | is a pointer to an unsigned char array with a length of 16 bytes in that the encrypted data will be written. |
References HWREG, and STATUS_SUCCESS.
unsigned char AES_startDecryptDataUsingEncryptionKey | ( | unsigned int | baseAddress, |
const unsigned char * | Data | ||
) |
Starts an decryption process on the AES module. This is the non-blocking equivalant 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 unsigned char array with a length of 16 bytes that contains encrypted data to be decrypted. |
References HWREG, and STATUS_SUCCESS.
unsigned char AES_startDecryptData | ( | unsigned int | baseAddress, |
const unsigned char * | Data | ||
) |
Decryptes a block of data using the AES module. This is the non-blocking equivalant of AES_decryptData. This function requires a pregenerated decryption key. A key can be loaded and pregenerated by using function
AES_generateFirstRoundKey() | . The decryption takes 167 MCLK. |
baseAddress | is the base address of the AES module. |
Data | is a pointer to an unsigned char array with a length of 16 bytes that contains encrypted data to be decrypted. |
References HWREG, and STATUS_SUCCESS.
unsigned char AES_startGenerateFirstRoundKey | ( | unsigned int | baseAddress, |
const unsigned char * | CipherKey | ||
) |
Loads and generates first round key required for decryption This is the non-blocking equivalant of AES_generateFirstRoundKey.
baseAddress | is the base address of the AES module. |
CipherKey | is a pointer to an unsigned char array with a length of 16 bytes that contains the initial AES key. |
References HWREG, and STATUS_SUCCESS.
unsigned char AES_getDataOut | ( | unsigned int | baseAddress, |
unsigned char * | 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.
baseAddress | is the base address of the AES module. |
References HWREG, STATUS_FAIL, and STATUS_SUCCESS.
unsigned char AES_isBusy | ( | unsigned int | baseAddress | ) |
Gets the AES module busy status.
baseAddress | is the base address of the AES module. |
References HWREG.
void AES_clearErrorFlag | ( | unsigned int | baseAddress | ) |
Clears the AES error flag.
baseAddress | is the base address of the AES module. |
Modified bit is AESERRFG of AESACTL0 register.
References HWREGB.
unsigned long AES_getErrorFlagStatus | ( | unsigned int | baseAddress | ) |
Gets the AES error flag status.
baseAddress | is the base address of the AES module. |
References HWREGB.