SLAU723A October 2017 – October 2018 MSP432E401Y , MSP432E411Y
The amount of data to hash is not necessarily a multiple of 64 bytes. In this case, the CLOSE_HASH bit in the SHA_MODE register must be set to append padding so that the message size becomes a multiple of 64 bytes. See the previous MD5 algorithm for more information on padding.
The module is fed with a 64-byte block of data, as long as enough data is available. However, a pad is appended on the last block of data. This can result in the creation of an extra 64-byte block.
The one or two last blocks that contain the padding are processed the same way as the other blocks. Hash completion is then indicated the same way as for a new hash, and the 128-bit result can be read in the digest registers. The SHA_DIGESTCOUNT register returns restored digest count and length when it is read, and hashing completes.