Freescale Semiconductor MCF5329 Reference Manual page 786

Devices supported: mcf5327; mcf5328; mcf53281; mcf5329
Table of Contents

Advertisement

Message Digest Hardware Accelerator (MDHA)
33.4.3.1
Generation of Key with IPAD
1. Reset the MDHA using the MDCMR[SWR] bit.
2. MDCR register write. Enable the interrupts. (optional)
3. MDMR register write. Select algorithm, IPAD, and MD initialization.
4. The data FIFO is filled with the key.
5. MDDSR register write. Load this register with the length of the key (without padding) in bytes.
6. MDHA does the required IPAD of key.
7. MDHA does the required algorithm's auto padding of message.
8. Set the MDCMR[GO] bit.
9. Wait for MDSR[INT] to be set or done interrupt to be triggered to indicate successful completion
(or failure).
You need to provide a time-out feature in the interrupt handler. The MDHA
stalls with no response if it is waiting for message data. This most likely
occurs if the MDDSR write is not received or auto-padding is disabled and
a partial message block is provided.
10. If MDSR[DONE] is set or done interrupt is triggered, then read the message digest and the message
digest count from the message digest registers.
33.4.3.2
Generation of Key with OPAD
1. Reset the MDHA using the MDCMR[SWR] bit.
2. MDCR register write. Enable the interrupts. (optional)
3. MDMR register write. Select algorithm, OPAD, and MD initialization.
4. The data FIFO is filled with the key.
5. MDDSR register write. Load this register with the length of the key (without padding) in bytes.
6. MDHA does the required OPAD of key.
7. MDHA does the required algorithm's auto padding of message.
8. Set the MDCMR[GO] bit.
9. Wait for MDSR[INT] to be set or done interrupt to be triggered to indicate successful completion
(or failure).
You need to provide a time-out feature in the interrupt handler. The MDHA
stalls with no response if it is waiting for message data. This most likely
occurs if the MDDSR write is not received or auto-padding is disabled and
a partial message block is provided.
10. If MDSR[DONE] is set or done interrupt is triggered, then read the message digest and the message
digest count from the message digest registers.
33-16
NOTE
NOTE
MCF5329 Reference Manual, Rev 3
Freescale Semiconductor

Advertisement

Table of Contents
loading

Table of Contents