This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using LL_Encrypt() and MAC generation



Hi

According to the wiki and ll.h, I see that LL_Encrypt() is used for encrypting the data provided as a parameter. Is time used for salting since, for the same key and data input, LL_Encrypt() appears to produce a unique output each time?

Is there a way to produce CBC-MAC using LL_Encrypt()? I'm hoping to advertise data authenticated by CBC-MAC so it'd be great if the AES co-processor could be utilised. The example at http://processors.wiki.ti.com/index.php/BLE_Encrypt_Adv_Data seems to be designed for advertising AES-encrypted data.

Thanks

  • Hello Will,
    I believe it should be the same output each time if the key and data is static. In the example code on the wiki the first byte in the data array is incremented for every periodic event:
    dataCount++;
    plainText[0] = dataCount;

    It does not use CBC-MAC. I think you will have to implement the functions that use the AES co-processor yourselves:
    e2e.ti.com/.../1679027
  • Hi Eirik,

    You're right - I indeed missed the part where dataCount increments.

    If LL_Encrypt() doesn't support CBC-MAC, does any other API function support it? If not, does that mean one would have to implement a custom encryption function that explicitly taps into the AES co-processor (which itself supports CBC-MAC - correct?) ? Do you know of any documentation or example code for getting started on that front?

    Thanks for your help.

  • Hello,
    Yes you are right. There is some hints in the following thread although not a complete guide for CBC-MAC. That's all I can do I am afraid.
    e2e.ti.com/.../251422