SHA1 properly handle int-to-byte conversion

Int represent 4 bytes but those are not expected to land in the same
order in the resulting byte array.

Also fix an issue in the assertion util which prevented to see the
issue.