Fix sha1 implementation