net/hinic: refactor checksum functions