RM0033
The FIPS PUB 180-2 standard and the IETF RFC 1321 publication specify the SHA-1, and
MD5 secure hash algorithms, respectively, for computing a condensed representation of a
message or data file. When a message of any length below 2
SHA-1, and MD5 produce respective a 160-bit, and 128-bit output string, respectively, called
a message digest. The message digest can then be processed with a digital signature
algorithm in order to generate or verify the signature for the message. Signing the message
digest rather than the message often improves the efficiency of the process because the
message digest is usually much smaller in size than the message. The verifier of a digital
signature has to use the same hash algorithm as the one used by the creator of the digital
signature.
The SHA-1, and MD5 are qualified as "secure" because it is computationally infeasible to
find a message that corresponds to a given message digest, or to find two different
messages that produce the same message digest. Any change to a message in transit will,
with very high probability, result in a different message digest, and the signature will fail to
verify. For more detail on the SHA-1 algorithm, please refer to the FIPS PUB 180-2 (Federal
Information Processing Standards Publication 180-2), 2002 august 1.
The current implementation of this standard works with little-endian input data convention.
For example, the C string "abc" must be represented in memory as the 24-bit hexadecimal
value 0x434241.
A message or data file to be processed by the hash processor should be considered a bit
string. The length of the message is the number of bits in the message (the empty message
has length 0). You can consider that 32 bits of this bit string forms a 32-bit word. Note that
the FIPS PUB 180-1 standard uses the convention that bit strings grow from left to right, and
Figure 212. Block diagram
32-bit AHB2 bus
Control and status
registers
Interrupt registers
HASH_IMR
HASH_SR
Control register
HASH_CR
Start register
HASH_ST R
Context swapping
context
HASH_CSR0..53
Message digest
digest
HASH_H0...H7
RM0033 Rev 8
Hash processor (HASH)
IN buffer
Data
register
HASH_DIN
write into HASH_DIN
or write DCAL bit to 1
or 1 complete block
transferred by the DMA
16 × 32-bit
IN FIFO
swa ppin g
IN FIFO full
or DCAL written to 1
SHA-1, SHA-224, SHA-256 and MD5
processor core
Hash / HMAC
64
bits is provided on input, the
MS30442V1
551/1378
569
Need help?
Do you have a question about the STM32F205 series and is the answer not in the manual?
Questions and answers