Since the code in question was needlessly convoluted, rewrote those sections to make them clearer. Added another test-suite to test whether padding works correctly, when compared with md5sum.