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.

CC2630: CC26XX Crypto in TIMAC: CBC AES

Part Number: CC2630
Other Parts Discussed in Thread: TIMAC, CC2650

This is for an existing product so I have no flexibility in hardware, software or the type of encryption I am using.

I am writing an application for a CC2630 that requires CBC AES function. The ICall libraries don't appear to support this nor do the underlying CryptoCC26XX libraries, although it is a feature supported in hardware.

/*!
 *  @brief    CryptoCC26XX Operation Type
 *
 *  This type holds the CryptoCC26XX operation.
 *
 *  Currently supported types are
 *  ::CRYPTOCC26XX_OP_AES_CCM, ::CRYPTOCC26XX_OP_AES_CCMINV,
 *  ::CRYPTOCC26XX_OP_AES_ECB, ::CRYPTOCC26XX_OP_AES_CCM_NOCRYPT,
 *  ::CRYPTOCC26XX_OP_AES_CCMINV_NOCRYPT and ::CRYPTOCC26XX_OP_AES_ECB_NOCRYPT.
 */
typedef uint8_t CryptoCC26XX_Operation;

...

#define CRYPTOCC26XX_OP_AES_CCM            0  /*!< AES-CCM Operation with Cryptation           */
#define CRYPTOCC26XX_OP_AES_CCM_NOCRYPT    1  /*!< AES-CCM Operation without Cryptation        */
#define CRYPTOCC26XX_OP_AES_CCMINV         2  /*!< AES-CCM Inverse Operation with Cryptation   */
#define CRYPTOCC26XX_OP_AES_CCMINV_NOCRYPT 3  /*!< AES-CCM Inverse Operation without Cryptation*/
#define CRYPTOCC26XX_OP_AES_ECB            4  /*!< AES-ECB Operation with Cryptation           */
#define CRYPTOCC26XX_OP_AES_ECB_NOCRYPT    5  /*!< AES-ECB Operation without Cryptation        */

This application will have a single caller (the only one that will ever use the crypto features) that needs to do the CBC AES encryption and decryption. How should I accomplish this either through the libraries or implementing it myself in a TI-RTOS friendly convention?

  • Hi Daniel,

    TI-RTOS has documented the Crypto implementation inside of its TI-RTOS Drivers Runtime APIs documentation.

    Regards,
    Ryan

  • This is for the version 2_21_00_04, I am stuck with tirtos_simplelink_2_11_01_09 which uses cc26xxware_2_20_06_14829 and cc26xxware_2_00_06_14829 (the manifest only lists 2_20_06_14829). It looks like those features were added later and TIMAC wasn't updated.

  • Is tirtos_simplelink_2_11_01_09/docs/doxygen/html/_crypto_c_c26_x_x_8h.html not valid?  I simply referred to the easy-to-access online version but the Crypto TI Driver should still be available in TI-RTOS v2.11, the source is at tirtos_simplelink_2_11_01_09\packages\ti\drivers\crypto

    Regards,
    Ryan

  • It's valid, but the supported operations in that version are missing the CBC operations consistent with the code I posted.

  • You could attempt to update the TI Driver files (Crypto specifically, CryptoCC26XX.c/h) with the newer version and place them directly inside your application project workspace so that they override the original pre-built TI Drivers.

    Regards,
    Ryan

  • That's probably the best option, thanks.

  • I was able to add CBC encryption using the new features by diffing in the relevant portions of crypto.c, crypto.h, CryptoCC26xx.c and CryptoCC26xx.h (the files are close enough to use a diff tool but did require some tweaking to compile). Since I started from the CC2650 MSA example it's worth noting that I am not using the crypto ICall interface it has, I don't know if that would be required for using the crypto module with the radio since I don't use it that way.

    Original message (I accidentally clicked "this was my answer" so I edited instead of posting again):

    There may be a way to make this work but it will not be simple. Adding the relevant files and porting them to compile causes a crash on boot. The first version that has CBC commands (2.20.00.06) is after the transition from "SimpleLink Wireless MCUs" to "CC13xx/CC26xx" and a lot appears to have changed. A lot of the power interface seems to have been moved from chip ROM into defined code and I have no idea how to integrate that (and even if I did there's no way its getting into production)

    My other option is to hack it together just directly manipulating the registers which I was hoping to avoid. Maybe I can add only what I need to my current versions files and override them in the same way... Either way I'll update the thread with what I end up doing.