GD32W51x User Manual
956
28.4.
HAU core
The hash acceleration unit is used to compute condensed information of input messages with
secure hash algorithms. The digest result has a length of 160/224/256/128 bits for a message
up to (2
64
-1) bits computed by SHA-1, SHA-224, SHA256 and MD5 algorithms respectively.
It can be used to generate or verify the signature of a message with a higher efficiency
because of the much simpler of the information.
A message which need to be processed in the HAU should be considered as bit information.
And the length is the number of bits of the message. The information security is ensured
because that, to find the original message using the digest is computationally impossible and,
the result will be completely different with any change to the input message.
Figure 28-3. HAU block diagram
AHB BUS
Input FIFO
16*32
HAU_DI
HAU_DO
Data swapping
Config
Hash acceleration core
(SHA-1,SHA-224,SHA-256,MD5 Hash/HMAC)
HAU_CTL
HAU_STAT
HAU_CFG
HAU_INTEN
28.4.1.
Automatic data padding
The input message should be padded first so that the number of bits in the input of the HAU
core can be an integral multiple of 512. First of all, a
“1” is added to follow the last bit of the
input message, and then several “0” should be padded to ensure the result modulo 512 is
448, at last, a 64-bit length information of input is added.
After the message padding is correctly performed, the VBL bits in the HAU_CFG register is
configured as the 64-bit length value above, and CALEN bit in the HAU_CFG register can be