Revert to openbsd sha1, fix hash endianess tests, add compat.h.