Ported changes to SHA1

Also, result functions no longer return raw pointers to internal state.