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.

Query about AES CTR mode supported in TI814x?

Hi.

 

AES CBC mode is in TI 814x OCF.

I need AES CTR mode.

Does TI814x support AES CTR mode?

If yes, Let me know, how to add and use.

  • Hi Ken,

    Yes, TI814x supports AES CTR mode. You can select the CTR mode (in example for AES1 public context) in register AES01_P_CTRL (address 0x41141050), set bit [6] CTR to 0x1 (counter mode).

    Best regards,

    Pavel

  • OCF is needed to use TI814x HW crypto.

    OCF has interface for CBC mode but there is no interface for CTR mode.

    Is CTR mode interface supported in OCF?

     

  • Hi Ken,

    Have you read this: http://processors.wiki.ti.com/index.php/Installing_AM387x_C6A814x_DM814x_Crypto_Support

    Together with the OCF, you need a patch - NSS-Crypto-driver-software-beta-0.9.patch

    In this patch, there is a function: nss_aes_write_ctrl(struct nss_aes_dev *dd)

    In this function, these lines of code are doing the job:

    else if (dd->flags & FLAGS_CTR)
    val |= AES_REG_CTRL_CTR | AES_REG_CTRL_CTR_WIDTH_32;

    Best regards,

    Pavel

  • 1. See the below URL. AES CTR mode not supported in TI81xx OCF.

     http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/164324.aspx

     Is AES CTR mode supported?

    2.Is CTR mode supported in HW engine or SW engine?

    \linux-2.6.37-psp04.01.00.06.patch2\crypto\ocf\kirkwood\cesa\mvCesaRegs.h

    /* crypto IV mode */
    typedef enum
    {
        MV_CESA_CRYPTO_ECB = 0,
        MV_CESA_CRYPTO_CBC = 1,

        /* NO HW Support */
        MV_CESA_CRYPTO_CTR = 10,

    } MV_CESA_CRYPTO_MODE;

    3. There in no definition for CTR mode in cryptodev.h

    Which one is for CTR mode?

    board-support\linux-2.6.37-psp04.01.00.06.patch2\crypto\ocf\cryptodev.h

    #define CRYPTO_RIJNDAEL128_CBC 11 /* 128 bit blocksize */
    #define CRYPTO_AES_CBC   11 /* 128 bit blocksize -- the same as above */
    #define CRYPTO_ARC4    12
    #define CRYPTO_MD5    13
    #define CRYPTO_SHA1    14

  • Hi Ken,

    I made a consultation with our experts. It turns out that despite CTR mode is reference from the OCF, this AES mode is still not implemented/supported.

    The current version of OCF for Linux does not publish AES CTR mode through the /dev/crypto interface. The OpenBSD version of OCF already implements this extension. So OCF need to be re-synchronized with the OpenBSD. The extension should be implemented using the OpenBSD version of OCF as a model.

    You can see the differences in /dev/crypto functionality in the file ocf/cryptodev.h

    The CryptoAPI implementation already fully supports the AES CTR mode on our hardware (it’s called “ctr(aes)”). Make sure you also pick up the latest patches at http://processors.wiki.ti.com/index.php/Installing_AM387x_C6A814x_DM814x_Crypto_Support
    Best regards,
    Pavel
  • " The current version of OCF for Linux does not publish AES CTR mode through the /dev/crypto interface. The OpenBSD version of OCF already implements this extension. So OCF need to be re-synchronized with the OpenBSD. The extension should be implemented using the OpenBSD version of OCF as a model."

    Do you have a schdule to support AES CTR mode in TI released OCF?

  • Please contact ocf-linux-users@lists.sourceforge.net for your last question.

    Best regards,

    Pavel