26. Hmac_sha224_dma

26.1. Function description:

This demo shows the operation of HMAC SHA224, the means about filling data writed to fifo is via DMA.

  • Enable global interrupt & register DMA interrupt.

  • Configure the HMAC and enable DMA function.

  • Configure UDMA P2M to transfer filling data.

  • Enable DMA interrupt and HASH to start calculation.

  • Waiting calculation done to compare the result with the golden data to check.

Note

  1. When the length of the key is greater than one block size, need to using hash operation to get the real key for hmac operation. The golden data getted by hash online calculator.

  2. For DMA mode, the input buffer address must be aligned.

26.2. Main configuration:

26.2.1. Hash configure

Algorithm

Mode

DMA

Data Type

sha224

hmac&hash

enable

8 bits swap

26.2.2. Udma p2m configure

Mode

Buffer size

Des address mode

Src address mode

Transfer width

normal

mult-4 bytes

fiexd

increasing

32 bits

Note

The buffer size according the length of message to configure, but must be a multiple of 4 bytes; transfer width also must be 32 bits.

26.3. Test result:

If the output result is same as the golden data, then print pass, if not print fail.

26.4. IO connection:

None