Suppose that I wrote an implementation of a standard algorithm such as an MD* or a SHA*: How I know that it's correct ? Different implementations of the same algorithm must produce the same digest ?
The reference documents themselves contain a small number of example cases, which can be used. (The hash of "abc"
is in all of the reference documents, for example.) In addition, Aaron Gifford has made a number of test cases available at http://www.adg.us/computers/sha.html. In particular, he has tests for some of the border cases (where the text is exactly the length of a block, or one less, and a couple of other special lengths. If your implementation calculates the correct value for all of these, there is a good chance that it is correct.