Hi
I would like to use the aes functions to encrypt a message between a BLE-device und the dongle with a private key, but the don't work...
I'm working with the simpleBLEPeripheral
1) when I try to use the aes functions like AesStartShortBlock( uint8 *out, uint8 *in ) I get an error:
Error[e46]: Undefined external "AesStartShortBlock::?relay" referred in simpleBLEPeripheral ( C:\Texas Instruments\BLE-CC2540-1.1a\Projects\ble\SimpleBLEPeripheral\CC2540DB\ CC2540DK-MINI Keyfob Slave\Obj\simpleBLEPeripheral.r51 )
2) I found the function SM_Encrypt(aesKey,aesIn,aesOut);
This function works more or less... If I call this function, I get no error. But I really don't know what this function does. Somehow the encrypted code is wrong.
Input:
static uint8 aesIn [30]={'h','e','l','l','o','h','e','l','l','o','h','e','l','l','o','h'};
static uint8 aesKey[17]={'1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g'};
Output:
0x9B,0x2B,0xB7,0x2C,0x98,0x5A,0x5A,0xCB,0x78,0xFA,0x5B,0x0C,0xD2,0x78,0x2A,0xEA
According to two different online tools (http://www.riscure.com/tech-corner/online-crypto-tools/aes.html) the Output should be
0xE7,0x66,0xEA,0x14,0x23,0x53,0x06,0x64,0x48,0x67,0xED,0x8D,0xB7,0xA9,0xA4,0x60