09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>RM0090</strong> Hash processor (HASH)<br />

Figure 219. Block diagram for STM32F42x and STM32F43x<br />

Control and status<br />

registers<br />

Interrupt registers<br />

HASH_IMR<br />

HASH_SR<br />

Control register<br />

HASH_CR<br />

Start register<br />

HASH_ST R<br />

32-bit AHB2 bus<br />

IN buffer<br />

Data<br />

register<br />

HASH_DIN<br />

16 × 32-bit<br />

IN FIFO<br />

swa ppin g<br />

write into HASH_DIN<br />

or write DCAL bit to 1<br />

or 1 complete block<br />

transferred by the DMA<br />

IN FIFO full<br />

or DCAL written to 1<br />

Context swapping<br />

HASH_CSR0..53<br />

context<br />

SHA-1, SHA-224, SHA-256 and MD5<br />

Message digest<br />

HASH_H0...H7<br />

digest<br />

Hash / HMAC processor core<br />

MS30442V1<br />

The FIPS PUB 180-2 standard and the IETF RFC 1321 publication specify the SHA-1, SHA-<br />

224 and SHA-256 and MD5 secure hash algorithms, respectively, for computing a<br />

condensed representation of a message or data file. When a message of any length below<br />

2 64 bits is provided on input, the SHA-1, SHA-224 and SHA-256 and MD5 produce<br />

respective a 160-bit, 224 bit, 256 bit and 128-bit output string, respectively, called a<br />

message digest. The message digest can then be processed with a digital signature<br />

algorithm in order to generate or verify the signature for the message. Signing the message<br />

digest rather than the message often improves the efficiency of the process because the<br />

message digest is usually much smaller in size than the message. The verifier of a digital<br />

signature has to use the same hash algorithm as the one used by the creator of the digital<br />

signature.<br />

The SHA-1, SHA-224 and SHA-256 and MD5 are qualified as “secure” because it is<br />

computationally infeasible to find a message that corresponds to a given message digest, or<br />

to find two different messages that produce the same message digest. Any change to a<br />

message in transit will, with very high probability, result in a different message digest, and<br />

the signature will fail to verify. For more detail on the SHA-1 or SHA-224 and SHA-256<br />

algorithm, please refer to the FIPS PUB 180-2 (Federal Information Processing Standards<br />

Publication 180-2), 2002 august 1.<br />

The current implementation of this standard works with little-endian input data convention.<br />

For example, the C string “abc” must be represented in memory as the 24-bit hexadecimal<br />

value 0x434241.<br />

A message or data file to be processed by the hash processor should be considered a bit<br />

string. The length of the message is the number of bits in the message (the empty message<br />

Doc ID 018909 Rev 3 596/1416

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!