Hash processor (HASH)
RM0090
766/1731
DocID018909 Rev 11
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
bits can be grouped as bytes (8 bits) or words (32 bits) (but some implementations also use
half-words (16 bits), and implicitly, uses the big-endian byte (half-word) ordering. This
convention is mainly important for padding (see
Section 1.3.4: Message padding on
page 12
).
25.3.1
Duration of the processing
The computation of an intermediate block of a message takes:
•
66 HCLK clock cycles in SHA-1
•
50 HCLK clock cycles in SHA-224
•
50 HCLK clock cycles in SHA-256
•
50 HCLK clock cycles in MD5
to which you must add the time needed to load the 16 words of the block into the processor
(at least 16 clock cycles for a 512-bit block).
The time needed to process the last block of a message (or of a key in HMAC) can be
longer. This time depends on the length of the last block and the size of the key (in HMAC
mode). Compared to the processing of an intermediate block, it can be increased by a factor
of:
•
1 to 2.5 for a hash message
•
around 2.5 for an HMAC input-key
•
1 to 2.5 for an HMAC message
•
around 2.5 for an HMAC output key in case of a short key
•
3.5 to 5 for an HMAC output key in case of a long key
25.3.2 Data
type
Data are entered into the hash processor 32 bits (word) at a time, by writing them into the
HASH_DIN register. But the original bit-string can be organized in bytes, half-words or
words, or even be represented as bits. As the system memory organization is little-endian
and SHA1, SHA-224 and SHA-256 computation is big-endian, depending on the way the
original bit string is grouped, a bit, byte, or half-word swapping operation is performed
automatically by the hash processor.
The kind of data to be processed is configured with the DATATYPE bitfield in the HASH
control register (HASH_CR).