12. Hash_sha256_dma
12.1. Function description:
This demo shows the operation of HASH SHA256, the means about filling data writed to fifo is via DMA.
Enable global interrupt & register DMA interrupt.
Configure the HASH 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
The golden data getted by hash online calculator.
For DMA mode, the input buffer address must be aligned.
12.2. Main configuration:
12.2.1. Hash configure
Algorithm |
Mode |
DMA |
Data Type |
sha256 |
hash |
enable |
8 bits swap |
12.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.
12.3. Test result:
If the output result is same as the golden data, then print pass, if not print fail.
12.4. IO connection:
None