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.

AES 128-bit accelerator with OFB and CFB modes

Other Parts Discussed in Thread: CC430F5137

I'm attempting to do AES 128-bit encryption/decryption on a CC430F5137 using the integrated AES accelerator hardware. Since I want to be able to encrypt and decrypt variable length RF packets without having to handle paddings to complete the 16-byte packet alignment required by ECB and CBC modes, OFB and CFB seem to be my sole options.

Looking into the user guide (slau259e), there is only one mention to OFB about how to encrypt data:

"When using the output feedback (OFB) cipher block chaining mode, setting the AESDINWR flag is sufficient to trigger the next encryption, and the module starts the encryption automatically using the output data from the previous encryption as input data."

Does the above mean that AESDINWR has to be set after filling AESADIN regardless of the amount of bytes loaded? Or will the encryption trigger itself if 16 bytes are written into AESADIN?

Does TI provide any useful example for modes OFB and CFB?

Thanks in advance

  • I've been doing some tests and I'm able to encrypt and decrypt complete strings, as far as their length is multiple of 16. This makes me think that I'm unable to configure the AES module for "block chaining mode" (OFB or CFB). Indeed, configuring AESACTL0.AESCM for OFB (10) or CFB (11) has no impact. Even leaving this field unmodified generates the same encryption string, which should correspond to ECB (00) a cipher mode that actually needs 16-byte data blocks.

    For CFB mode I'm setting AESACTL0 as follows:

    AESACTL0 |= BIT5 | BIT6 | BITF; // AESCMEN=1, AESCM=CFB

    before running any encryption or decryption. I've also tried with AESCMEN=0 but nothing changes; the last bytes forming a block of less than 16 bytes are not correctly encrypted/decrypted. I'm pretty sure that the AES module sticks on ECB mode for some reason.

    Any hint about how to select CFB or OFB modes?

    Thanks again.

  • I seem unable to change the cipher mode. All values of AESACTL0.AESCM (ECB, CBC, OFB and CFB) produce the same encrypted output and only work for 16-byte aligned buffers.

    Could anyone from TI provide some light?

    Thanks.

**Attention** This is a public forum