SWRU543B January 2019 – June 2025 CC3230S , CC3230SF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
The amount of data to hash is not necessarily a multiple of 64 bytes. In this case, the CLOSE_HASH bit in the SHAMD5_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, if enough data is available. However, a pad is appended on the last block of data, which 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 in the same way as for a new hash, and the 128-bit result can be read in the digest registers. The SHAMD5_DIGESTCOUNT register returns restored digest count and length when it is read, and hashing completes.