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.

CC2642R: AESGCM - IV only 12 bytes support

Part Number: CC2642R

Hi,

SDK: simplelink_cc13x2_26x2_sdk_4_20_01_04
SDK: simplelink_cc13x2_26x2_sdk_4_30_00_54

Following statements have been made in the AESGCM driver module:

/* The only supported ivLength is 12 for now */

is there already a driver which supports ivLenght of 12? I really need this for one of my projects

Kind regards,

Daan

  • Hi,

    I confirm the AESGCM driver currently available in the SDK (4.20 and 4.30) only supports ivLenght of 12.

    Maybe you can explain the need you have and we can find a different approach for you.

    Best regards,

  • Hi Clement,
    A colleague just found out how wolfSSL is doing this, after which we together implemented a sollution.

    1. Edit the AESGCMCC26XX.c source file (recommended to copy into your workspace instead of editting the SDK) with the following lines (search for the first 3 lines of this snippet).
        HWREG(CRYPTO_BASE + CRYPTO_O_AESIV0) = ((uint32_t *)operation->iv)[0];
        HWREG(CRYPTO_BASE + CRYPTO_O_AESIV1) = ((uint32_t *)operation->iv)[1];
        HWREG(CRYPTO_BASE + CRYPTO_O_AESIV2) = ((uint32_t *)operation->iv)[2];
        // HWREG(CRYPTO_BASE + CRYPTO_O_AESIV3) = 0x01000000;
    
    
        if(operation->ivLength > 12)
          HWREG(CRYPTO_BASE + CRYPTO_O_AESIV3) = ((uint32_t *)operation->iv)[3];
        else
          HWREG(CRYPTO_BASE + CRYPTO_O_AESIV3) = 0x01000000;


    Next off, create a GHASH function and hash the 16-byte IV with it (take wolfssl as your reference), also, please create a proper code formatting box for this forum

      use the output as the IV argument of the GCM cipher.

  • Hi,

    Thank you for sharing!

    Kind regards,