Minor refactoring for SHA1 API.