Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Where is the disparity between the two coming from?


There are two widely used polynomials, IEEE and Castagnoli. These parameterize the CRC-32 algorithm, and are sometimes known as crc32 and crc32c.

The IEEE polynomial is used by Bzip2, Ethernet (IEEE 802.3), Gzip, MPEG-2, PNG, SATA, Zip and other formats.

The Castagnoli polynomial is used by Btrfs, Ext4, iSCSI, SCTP and other formats.

For better or worse, the hardware instruction computes CRC-32-Castagnoli, which means it's not relevant for e.g. Zip.


Ahh interesting. Thank you.

Is there any particular advantage of one polynomial over the other?


https://en.wikipedia.org/wiki/Cyclic_redundancy_check#Standa... suggests that Castagnoli has better "error detection capacity". What that means exactly (in terms of information theory) and whether that difference matters in practice is getting beyond my expertise level. In any case, existing formats like Zip are what they are, and as I mentioned in the blog post comments, it is still possible to SIMD-accelerate the IEEE flavor.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: