Other Parts Discussed in Thread: CC1310
I want to test the AES module in my application, but all the examples uses on rtos and I want to use it without rtos I tried the examples suggested in e2e.ti.com/.../641353 but after the message is encrypted, the CryptoCC26XX_transact keeps running and never returns so i replaced it with CryptoCC26XX_transactPolling but the same problem occured, so
1. how can I use the example without RTOS?
2. why do both functions never return?
// Initialize Crypto driver structures
CryptoCC26XX_init();
// Open the crypto hardware with non-exclusive access and default parameters.
handle = CryptoCC26XX_open(Board_CRYPTO0, false, NULL);
if (handle == NULL)
{
printf("CryptoCC26XX did not open");
}
uint8_t i;
for (i = 0; i < PAYLOAD_LENGTH; i++)
{
ccmSetup.clearAndCipherText[i] = 'a';
}
keyIndex = CryptoCC26XX_allocateKey(handle, ccmSetup.keyLocation, (const uint32_t *) ccmSetup.key);
if (keyIndex == CRYPTOCC26XX_STATUS_ERROR)
{
printf("Key Location was not allocated.");
}
/* Load key to the key register */
CryptoCC26XX_loadKey(handle, keyIndex, (const uint32_t *)ccmSetup.key);
// Encrypt and authenticate the message
//change the op type hereeeeeeee
CryptoCC26XX_Transac_init((CryptoCC26XX_Transaction *) &trans, CRYPTOCC26XX_OP_AES_CCM);
trans.keyIndex = keyIndex;
trans.authLength = macLength;
trans.nonce = (char *) ccmSetup.nonce;
trans.header = (char *) ccmSetup.header;
trans.fieldLength = 3;
trans.msgInLength = clearTextLength;
trans.headerLength = aadLength;
trans.msgIn = (char *) &(ccmSetup.clearAndCipherText[0]); // Message is encrypted in place
trans.msgOut = (char *) &(ccmSetup.clearAndCipherText[clearTextLength]); // MAC will be written to this position
status = CryptoCC26XX_transactPolling(handle, (CryptoCC26XX_Transaction *) &trans);
if (status != CRYPTOCC26XX_STATUS_SUCCESS)
{
printf("Encryption and signing failed.");
}