2 Rogier van de Pol notified me that my implementation differed
3 with several others on several test data sets he had tested
4 against. This test vector data set is one Rogier provided
5 to me that highlighted an off-by-one bug in my implementation
6 that affected SHA-256/384/512 hashes where the data set length
7 was of a certain length. In the case of SHA512 or SHA384, if
8 the data length after subtracting 111 was an even multiple of
9 128 bytes, the bug surfaced. In the case of SHA256, after
10 subtracting 55, the remaining length was an even multiple of 64,
11 the bug surfaced. The fix was simple. In SHA512_Last() and in
12 SHA256_Final() functions, I simply replaced a single "<" test
17 (Total length of test vector data: 12271)
23 88ee6ada861083094f4c64b373657e178d88ef0a4674fce6e4e1d84e3b176afb
26 78cc6402a29eb984b8f8f888ab0102cabe7c06f0b9570e3d8d744c969db14397
27 f58ecd14e70f324bf12d8dd4cd1ad3b2
30 211bec83fbca249c53668802b857a9889428dc5120f34b3eac1603f13d1b4796
31 5c387b39ef6af15b3a44c5e7b6bbb6c1096a677dc98fc8f472737540a332f378