Implementation on FPGA - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

We support CCM mode including both encryption and decryption parts in this implementation.

Attention

The bit-width of the interfaces we provide is shown as follows:

  payload cipher cipherkey nonce AD tag lenPld lenCph lenAD
CCM-AES128 128 128 128 56-104 128 32-128 64 64 64
CCM-AES192 128 128 192 56-104 128 32-128 64 64 64
CCM-AES256 128 128 256 56-104 128 32-128 64 64 64

The bit-width for the nonce and the tag is specified by the template parameters _t and _q. Please read the API’s specification for further information.

The tag (MAC) is used to verify the received data is whether authentic or not. To maintain the same interface for both input and output ports, we do not provide a bool flag to indicate the received data is authentic or not but a tag for you to verify it outside the primitive.

Caution

Applicable conditions:

1. To verify the received data, you need to compare the tag which is the output of the decrypting process with the tag from the encrypting process. If they are equal, the received data is authentic.

The algorithm flow chart of encryption part of CCM mode is shown as follow:

algorithm flow chart of CCM_encryption

As we can see from the chart, the CCM encryption part can be divided into two individual parts: The Counter Mode (CTR) and The Cipher Block Chaining-Message Authentication Code (CBC-MAC). CTR is used to encrypt the plaintext to ciphertext, and CBC-MAC is used to generate the data tag (MAC).

The algorithm flow chart of decryption part of CCM mode is shown as follow:

algorithm flow chart of CCM_decryption

The decryption part is very similar with the encryption part of CCM mode. The only difference is that we decrypt the ciphertext to plaintext in the decryption part. In decryption part of CCM mode, we don’t provide a bool flag to indicate whether the data is authentic or not. You should compare the tag which the decryption part gives with the tag from CCM encryption part to judge the authenticity of the data. If the data is authentic, then the tags should be equal.

The internal data flow of both encryption and decryption parts of CCM mode is shown as the figures below: