Fix regression introduced in 5a2646b8b28 for hash algorithms with size greater than 160 bytes

It was initially fixed in baff308d.

Thank you Paul Dokas for the bug report and fixes.