File format specification for the differences file (version 1.1)

Changes since version 1.0:
    Added 16 bytes to the footer containing an MD5 digest of the original
    input file. This is useful to determine whether patches can be merged
    in a meaningful way.

    This affects only the new tardiffmerge tool, which must be able to process
    both version 1.0 and version 1.1 files. The tarpatch tool ignores the extra
    data, when it exists.

HEADER
    8 bytes magic string: "tardiff0" (no terminating null character!)

Then, a sequence of instructions, each formatted as follows:
        4 bytes: S
        2 bytes: C
        2 bytes: A
    512*A bytes: new block data

    S, C and A are unsigned integers stored in big-endian (network) byte order.

    Interpret this as follows:
        if S == 0xffffffff and C == 0xffff and A == 0xffff:
            end of instructions has been reached

        if C >  0x7fff or A > 0x7fff:
            invalid data (higher values are reserved)

        if S == 0xffffffff:
            if C > 0: invalid data
        else:
            if C == 0: invalid data
            else: copy blocks with index S through S+C (exclusive) to output

        if A > 0:
            copy extra data (A blocks) to output

FOOTER
    16 bytes: MD5 digest of the resulting output file
    16 bytes: MD5 digest of the original input file (since version 1.1)
