MAX32665-MAX32668 User Guide
Maxim Integrated Page 436 of 457
Table 23-3. Hash Functions
Data is processed in 512-bit or 1024-bit blocks. After every 16 or 32 words are written to the hash block, several cycles are
needed to complete the hash of that block. The number of cycles needed to compute the hash is dependent upon the
number of rounds in the algorithm. The first 16 rounds are calculated as the 16 or 32 words are written to the hash block.
The remaining rounds are calculated at a rate of one clock cycle per round.
The integrated DMA can fetch data for the hash accelerator. Calculation of the hash can occur in parallel with the block
cipher as long as only one of the operations uses the DMA.
Setting the HASH_CTRL.init bit will seed the hash accelerator with the secure hash constants required by security validation
requirement . Contact Maxim for specific information about the seeding process and its comparability with the latest
security requirements for NIST FIPS and other certifications.
23.3.1 Last Message Block Padding
Once all data is written to the cryptographic data register, the final message block must be padded according to the FIPS
Publication 180 standard. The standard requires that the bit length be appended to the end of the message. The length of
the message in binary representation is contained in the HASH Message Size Registers HASH MSG_SZ_0. Prior to hashing
the last message data, set HASH_CTRL.last along with the HASH_MSG_SZ registers. The HASH_MSG_SZ value is
automatically padded to the last message block.