GD32F20x User Manual
219
11.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 (264-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 11-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
11.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
set 1 to start the calculation of the digest of the last block.
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...