Hash processor (HASH)
Bits 11:8 NBW[3:0]: Number of words already pushed
Bits 18, 7 ALGO[1:0]: Algorithm selection
1158/2301
This bitfield reflects the number of words in the message that have already been
pushed into the IN FIFO. NBW is incremented by one when a write access to the
HASH_DIN register is performed (except if DINNE = 0 and the DMA is not used,
see below description). NBW goes to zero when the INIT bit is written to 1.
This bitfield is read-only.
If the DMA is not used
0000: if DINNE = 0, no word has been pushed into the DIN buffer (both
HASH_DIN register and IN FIFO are empty), otherwise one word has been
pushed into the DIN buffer (HASH_DIN register contains one word and IN FIFO
is empty)
0001: two words have been pushed into the DIN buffer (i.e. HASH_DIN register
and the IN FIFO contain one word each)
...
1111: 16 words have been pushed into the DIN buffer.
If the DMA is used
NBW contains the exact number of words that have been pushed into the IN
FIFO by the DMA.
These bits select the hash algorithm.
00: SHA-1
01: MD5
10: SHA-224
11: SHA-256
This selection is only taken into account when the INIT bit is set. Changing this
bitfield during a computation has no effect.
Bit 6 MODE: Mode selection
This bit selects the HASH or HMAC mode for the selected algorithm:
0: Hash mode selected
1: HMAC mode selected. LKEY must be set if the key being used is longer than
64 bytes.
This selection is only taken into account when the INIT bit is set. Changing this
bit during a computation has no effect.
Bits 5:4 DATATYPE[1:0]: Data type selection
Defines the format of the data entered into the HASH_DIN register:
00: 32-bit data. The data written into HASH_DIN are directly used by the HASH
processing, without reordering.
01: 16-bit data, or half-word. The data written into HASH_DIN are considered as
two half-words, and are swapped before being used by the HASH processing.
10: 8-bit data, or bytes. The data written into HASH_DIN are considered as four
bytes, and are swapped before being used by the HASH processing.
11: bit data, or bit-string. The data written into HASH_DIN are considered as 32
bits (1st bit of the string at position 0), and are swapped before being used by the
HASH processing (1st bit of the string at position 31).
RM0432 Rev 6
RM0432
Need help?
Do you have a question about the STM32L4+ Series and is the answer not in the manual?