#include "inc/hw_types.h"
#include "driverlib/5xx_6xx/debug.h"
#include "driverlib/5xx_6xx/aes256.h"
#include "deprecated/CCS/msp430xgeneric.h"
Functions | |
unsigned char | AES256_setCipherKey (unsigned int baseAddress, const unsigned char *CipherKey, unsigned int KeyLength) |
unsigned char | AES256_encryptData (unsigned int baseAddress, const unsigned char *Data, unsigned char *encryptedData) |
unsigned char | AES256_decryptDataUsingEncryptionKey (unsigned int baseAddress, const unsigned char *Data, unsigned char *decryptedData) |
unsigned char | AES256_decryptData (unsigned int baseAddress, const unsigned char *Data, unsigned char *decryptedData) |
unsigned char | AES256_generateFirstRoundKey (unsigned int baseAddress, const unsigned char *CipherKey) |
void | AES256_clearInterruptFlag (unsigned int baseAddress) |
unsigned long | AES256_getInterruptFlagStatus (unsigned int baseAddress) |
void | AES256_enableInterrupt (unsigned int baseAddress) |
void | AES256_disableInterrupt (unsigned int baseAddress) |
void | AES256_reset (unsigned int baseAddress) |
unsigned char | AES256_startEncryptData (unsigned int baseAddress, const unsigned char *Data, unsigned char *encryptedData) |
unsigned char | AES256_startDecryptDataUsingEncryptionKey (unsigned int baseAddress, const unsigned char *Data) |
unsigned char | AES256_startDecryptData (unsigned int baseAddress, const unsigned char *Data) |
unsigned char | AES256_startGenerateFirstRoundKey (unsigned int baseAddress, const unsigned char *CipherKey) |
unsigned char | AES256_getDataOut (unsigned int baseAddress, unsigned char *OutputData) |
unsigned char | AES256_isBusy (unsigned int baseAddress) |
void | AES256_clearErrorFlag (unsigned int baseAddress) |
unsigned long | AES256_getErrorFlagStatus (unsigned int baseAddress) |
unsigned char AES256_setCipherKey | ( | unsigned int | baseAddress, |
const unsigned char * | CipherKey, | ||
unsigned int | KeyLength | ||
) |
Loads a 128, 192 or 256 bit cipher key to AES256 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, Key_128BIT, Key_192BIT, Key_256BIT, STATUS_FAIL, and STATUS_SUCCESS.
unsigned char AES256_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
AES256_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 AES256_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 AES256_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
AES256_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 AES256_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 AES256_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 AES256_getInterruptFlagStatus | ( | unsigned int | baseAddress | ) |
Gets the AES ready interrupt flag status.
baseAddress | is the base address of the AES module. |
References HWREGB.
void AES256_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 AES256_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 AES256_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 AES256_startEncryptData | ( | unsigned int | baseAddress, |
const unsigned char * | Data, | ||
unsigned char * | encryptedData | ||
) |
Starts an encryption process on the AES module. The cipher key that is used for decryption should be loaded in advance by using function
AES256_setCipherKey(). | This is the non-blocking equivalant of AES256_encryptData. |
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 AES256_startDecryptDataUsingEncryptionKey | ( | unsigned int | baseAddress, |
const unsigned char * | Data | ||
) |
Starts an decryption process on the AES module. This is the non-blocking equivalant of AES256_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 AES256_startDecryptData | ( | unsigned int | baseAddress, |
const unsigned char * | Data | ||
) |
Decryptes a block of data using the AES module. This is the non-blocking equivalant of AES256_decryptData. This function requires a pregenerated decryption key. A key can be loaded and pregenerated by using function
AES256_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 AES256_startGenerateFirstRoundKey | ( | unsigned int | baseAddress, |
const unsigned char * | CipherKey | ||
) |
Loads and generates first round key required for decryption This is the non-blocking equivalant of AES256_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 AES256_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 AES256_isBusy | ( | unsigned int | baseAddress | ) |
Gets the AES module busy status.
baseAddress | is the base address of the AES module. |
References HWREG.
void AES256_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 AES256_getErrorFlagStatus | ( | unsigned int | baseAddress | ) |
Gets the AES error flag status.
baseAddress | is the base address of the AES module. |
References HWREGB.