mbedTLS AES example using the CRYPTO module in the EFM32PG in order to
accelerate the AES encryption and SHA hash functions of mbedTLS.

This example project uses the EFM32 CMSIS including emlib to run
mbedTLS libraries on the EFM32PG.

The example redirects standard io to the VCOM virtual serial port of the
SLSTK3401A_EFM32PG kit. By default the serial port setting is 115200-8-N-1.

The user should connect a terminal emulator program, and follow the
instructions shown on the console.

The user can select encryption or decryption of a message which should be sent
via the VCOM serial interface.

In order to encrypt and decrypt the program use a hard coded key of 256 bits.

In ecryption mode, the example will ask the user for a short phrase in order to
generate an initial vector used in the AES encryption process. The user may type
any phrase ended by <enter> or limited to a maximum of 16 bytes. After the short
phrase, the user should start typing in the message to be encrypted, followed by
hitting <enter> to mark the end of the message. The message length is limited to
the #define MAX_MESSAGE_SIZE_ENCRYPTION. Then the program will encrypt the
message (plaintext), and print out the ciphertext, preceded with the initial
vector of 16 bytes and followed by a message digest tag of 32 bytes. All data
is converted to hexadecimal readable text format before sent to the serial port.
The format is:
Initial Vector(16 bytes) | Ciphertext | Message Digest Tag (32 bytes)

The user can copy the output and feed it back to the program for decryption
later. The user need to reset the kit in order to run decryption mode.

In decryption mode, the example will expect to receive a decrypted message
in the same format as generated by the encryption (as shown above).

The example has been instrumented with code to count the number of clock
cycles spent in the encryption and decryption loops. In order to check the
performanc gain of CRYPTO acceleration, the user can switch off
CRYPTO hardware acceleration by compiling with -DNO_CRYPTO_ACCELERATION
in the compiler command line.

Board:  Silicon Labs SLSTK3401A Starter Kit
Device: EFM32PG1B200F256
