The many different CRC16-CCITTs

I’m hacking on adding Arduino Zero support to the Zephyr Project at the moment. I had a look at speeding up crc16_ccitt() but ran into a problem: there’s so many variants of CRC16-CCITT to choose from!

  • Zephyr uses CRC-16/AUG-CCITT which is equivalent to CRC-16/CCITT-FALSE with two zero bytes prepended. The effective seed is 0x1d0f and test vector output is 0xe5cc.

  • Mynewt uses CRC-16/XMODEM. The seed is 0 and test vector output is 0x31c3.

  • Contiki uses CRC-16/CCITT. The seed is 0, input and output are bit reversed, and test vector output is 0x2189.

  • Linux uses CRC-16/MCRF4XX. The seed is 0xffff, input and output are bit reversed, and the test vector output is 0x6f91.

  • The Arduino Zero’s SAMD21 uses CRC-16/CCITT as per Contiki.

Contiki, Linux, and the SAMD21 are the same except for the seed. Zephyr is close, but you need to modify the seed to account for the padding. Mynewt is the outlier as all others reverse the input and output.

See http://reveng.sourceforge.net/crc-catalogue/16.htm for a catalogue.