CRC concatenation
CRC concatenation derives a checksum of ordered joined byte sequences from their compatible CRC values and segment lengths without rereading the payload.
A polynomial shift accounts for the suffix length before the two CRCs are combined. Initialization and final-XOR conventions must agree. Plain XOR of independently computed part checksums is not the concatenation operation. [1]
For zlib's IEEE CRC-32, crc32_combine takes CRC(A), CRC(B) and the byte length of B. It returns CRC(A followed by B). CRC-32C needs its own polynomial and compatible implementation; the two 32-bit checksums are not interchangeable. [2] [3]
The native example splits the ASCII bytes 123456789 in all 55 three-part layouts, including empty parts. Both valid groupings produce cbf43926. A grouped suffix needs its complete length: combining A with B+C uses len(B)+len(C). Reordering parts, using a wrong length, XORing checksums or checksumming digest bytes gives different results in the selected controls. [4]
The result covers the original byte stream, unlike a hash of its part digests. Chunk boundaries may change without changing that full-object value. Keeping old part checksums does not verify current stored bytes; even correct combination preserves existing CRC collisions. [2] [4]
Relations
Citations
- Kadatch and Jenkins: Everything we know about CRC but afraid to forget (2010), sections 3.1-3.3.
- zlib 1.3.1 zlib.h: crc32, crc32_combine and crc32_combine_op contracts.
- RFC 7143: iSCSI CRC-32C polynomial and digest conventions, section 13.1.
- Hesela native CRC concatenation replay: inputs, grouping checks and limitations.
Further reading
- Hesela CRC concatenation: exact native replay results.
- Hesela CRC concatenation: standalone native-library probe.
- Hesela CRC concatenation: exhaustive two-byte and collision regression tests.
Sources & caveats
- This is a source synthesis and deterministic native-library replay, not a new CRC algorithm or a reproduction of the paper's performance measurements.
- The recorded library reports zlib 1.3; the cited 1.3.1 API documents the same nonnegative-length concatenation contract. The checker reports its actual loaded version.
- The finite tests cover 65,536 two-byte inputs, 55 layouts of one nine-byte message, five selected invalid constructions and a constructed collision. They do not estimate physical corruption rates.