Refactor do_verify for readability

Extract size/checksum computation logic into separate functions for
gzipped and non-gzipped files.