I understand that the word size is the internal "working package size" below the block size of a cryptographic hash function (and a block cipher), as each block is broken into words an than processed round-based. Does this size have any practical relevance when using that function? For instance do algorithms with 64b word size perform better on 64b machines? Or does aligning the message-to-hash at the word size have any impact?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Yes, the internal word size of a hash algorithm has some significance, pretty much for the reasons given in the question.
Algorithms with 64-bit word size have a (typically sizable) performance edge on 64-bit machines (more precisely: for large messages, and comparable implementations, the ratio of the number of bytes hashed in a given time over that for a comparable algorithm with 32-bit word size will likely be significantly higher using a 64-bit machine and making good use of the architecture, than this ratio is on a 32-bit machine). For this reason we have SHA-512/256, a 256-bit hash obtained by truncating to 256-bit a natively 512-bit hash with internal 64-bit word size: on a 64-bit machine, SHA-512/256 can be faster than SHA-256, a natively 256-bit hash with internal 32-bit word size. See this for more details.
And, on most machines, there is some (typically small) performance penalty if the message to hash is not aligned to the native word size.