Understanding Modern Implementations of CRC32
CRC32
is a common checksum algorithm, notably found in zip and PNG files. The "CRC" portion stands for cyclic-redundancy-check, as the algorithm is largely based around cyclic codes. The 32 refers to the number of bits
Modern implementations of this algorithm are heavily optimized and can take a while to understand. This article attempts give a simple explanation for the scalar implementation of crc32, and then work through the intuition behind the SIMD implementation.
The vectorized portion of this post is largely based on this Intel paper from 2009, Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction.