Some code shared by MD5, SHA1 and SHA2 implementations