SHA-1 cleanups and performance enhancements.