Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Checksums, CRCs and other integrity mechanisms

Every integrity check used by any family in this specification, with full parameters and a test vector. Family documents refer to the anchors below (lowercase catalogue name, non-alphanumerics replaced by -).

CRC parameters follow the Rocksoft/RevEng model: width, poly (normal, MSB-first form), init, refin, refout, xorout, check (CRC of the ASCII bytes 123456789) and residue (register value after running the CRC, without final XOR, over a message followed by its correct CRC). All test vectors were computed for this document with an independent bit-by-bit implementation.

Summary

AnchorKindcheck(“123456789”)Families
crc-8-smbusCRC-8, poly 07F4Halcyon Symbios
crc-8-msb-0x12CRC-8, poly 12 (non-standard)EAPelagic i330R / Apeks DSX (BLE packets)
crc-16-ibm-3740CRC-16 (a.k.a. CCITT-FALSE)29B1Cressi Leonardo, Cressi Goa (dive header), ReefNet Sensus Pro and Ultra, Ratio/DiveSystem iDive, Liquivision (replies), Seac Screen, Pelagic i330R (data)
crc-16-xmodemCRC-1631C3Cressi Goa (frames), Oceans S1 (XMODEM-CRC), McLean Extreme, Tecdiving DiveComputer.eu, Mares Genius-class records
crc-16-ibm-sdlcCRC-16 (a.k.a. X-25)906EIrDA IrLAP FCS (Uwatec Smart), Divesoft Freedom (packets)
crc-16-arcCRC-16BB3DGarmin FIT files, Garmin GFDI over BLE
crc-16-modbusCRC-164B37Divesoft Freedom (dive header)
crc-32-iso-hdlcCRC-32 (zlib/Ethernet)CBF43926Suunto EON Steel family
crc-32-bzip2CRC-32, MSB-firstFC891918Liquivision Xen/Xeo/Lynx/Kaon (dive header, keyed)
sum88-bit additiveDDOceanic/Pelagic (many), Mares Nemo, Mares Puck/Darwin (ASCII protocol), Suunto Eon, Deepblu (verify)
sum8-negtwo’s complement of sum823Zeagle N2iTiON3, Deepblu Cosmiq (send), HW OSTC (firmware blocks), Intel HEX
sum8-invones’ complement of sum822Deep Six Excursion
sum1616-bit additive of bytes01DDAtomic Cobalt, Oceanic Atom 2 (256-byte pages), Uwatec Aladin, ReefNet Sensus, Sporasub SP2
nibble-sum8-bit sum of nibbles48Oceanic VT Pro family, Pelagic (some handshakes)
xor88-bit XOR31Suunto Vyper/Vyper2/D9 families, Uwatec Memomouse, Uwatec Smart over serial (Meridian/Chromis/Mantis)
ostc-firmware-sum32-bit Fletcher-like091501DDHW OSTC 3 firmware files

Confidence: verified for all check values (computed); likely for the family assignments.

crc-8-smbus

widthpolyinitrefinrefoutxoroutcheckresidue
80700falsefalse00F400

Plain MSB-first CRC-8. Halcyon Symbios computes it over the payload of each packet (from the byte after the start byte up to, but excluding, the CRC byte).

Confidence: likely.

crc-8-msb-0x12

Not in the RevEng catalogue (the polynomial has no x^0 term, so it is not a proper CRC generator).

widthpolyinitrefinrefoutxoroutcheck
81200falsefalse00EA

Byte-wise formulation (equivalent, checked on 2000 random messages):

for each byte b:
    a = crc XOR b
    t = a XOR (a >> 4) XOR (a >> 7)
    crc = ((t << 4) XOR (t << 1)) AND 0xFF

Pelagic i330R / Apeks DSX: computed over the whole BLE packet (start byte CD through the end of the payload) with the CRC byte position (offset 3) set to 00 during calculation.

Confidence: likely (two sources describe the same algorithm; equivalence to the polynomial form verified numerically).

crc-16-ibm-3740

Also known as CRC-16/CCITT-FALSE, CRC-16/AUTOSAR.

widthpolyinitrefinrefoutxoroutcheckresidue
161021FFFFfalsefalse000029B10000

Users (coverage and byte order; details in the family documents):

FamilyCovered bytesWire order
Cressi LeonardoASCII hex payload characters (command and reply); also the 32000-byte binary dump4 ASCII hex chars, big-endian
Cressi Goadive header record (parser)little-endian
ReefNet Sensus Prohandshake; full memory dumplittle-endian
ReefNet Sensus Ultrahandshake (24 bytes); each 512-byte data page; user datalittle-endian
Ratio / DiveSystem iDivestart byte, length and payloadbig-endian
Liquivisionreply payloadbig-endian
Seac Screenpacket; also stored recordsbig-endian
Pelagic i330Reach flash data blockbig-endian

Confidence: likely.

crc-16-xmodem

Same as above but init = 0000.

widthpolyinitrefinrefoutxoroutcheckresidue
1610210000falsefalse000031C30000
FamilyCovered bytesWire order
Cressi Goa (serial and BLE frames)length, command and arguments (after the 3 AA preamble bytes)little-endian
Oceans S1XMODEM-CRC blocks: the data bytes after the 3-byte block headerbig-endian
McLean Extreme, Tecdivingfrom the byte after the start byte through the payload; the CRC is followed by two 00 bytesbig-endian
Mares Icon HD family (Genius-class dive records)record bodylittle-endian

Worked example (Cressi Goa frame, dive request for dive id 1): CRC over 02 22 01 00 is 0x36FF, giving the frame AA AA AA 02 22 01 00 FF 36 55.

Confidence: likely.

crc-16-ibm-sdlc

Also known as CRC-16/X-25, CRC-16/ISO-HDLC.

widthpolyinitrefinrefoutxoroutcheckresidue
161021FFFFtruetrueFFFF906EF0B8

Reflected form of the polynomial: 8408. Transmitted least significant byte first.

  • IrDA IrLAP FCS (see ../transports/irda.md). Example: frame 55 11 → FCS A300, sent 00 A3.
  • Divesoft Freedom packets: over the packet header and payload, little-endian.

Confidence: verified for IrLAP (public standard + computed example); likely for Divesoft.

crc-16-arc

widthpolyinitrefinrefoutxoroutcheckresidue
1680050000truetrue0000BB3D0000

The Garmin FIT SDK computes it with a 16-entry nibble table; the result is identical.

  • FIT files: over the header (14-byte header CRC) and over the whole file (trailing CRC), little-endian.
  • Garmin GFDI messages over BLE: over length, message id and payload, little-endian.

Confidence: verified for FIT (Garmin FIT SDK); likely for GFDI.

crc-16-modbus

widthpolyinitrefinrefoutxoroutcheckresidue
168005FFFFtruetrue00004B370000

Divesoft Freedom dive files: over the header from offset 6 to its end; stored little-endian at offset 4.

Confidence: likely.

crc-32-iso-hdlc

The zlib / Ethernet CRC-32.

widthpolyinitrefinrefoutxoroutcheckresidue
3204C11DB7FFFFFFFFtruetrueFFFFFFFFCBF43926DEBB20E3

Suunto EON Steel family: over the 12-byte message header and payload, little-endian (USB HID and BLE).

Confidence: likely.

crc-32-bzip2

widthpolyinitrefinrefoutxoroutcheckresidue
3204C11DB7FFFFFFFFfalsefalseFFFFFFFFFC891918C704DD7B

Liquivision dive headers are protected by this CRC computed over a buffer formed by a 4-byte model key followed by the header bytes from offset 4 onward (the first 4 header bytes hold the stored CRC, u32le). Coverage ends 2 bytes before the header’s end (6 bytes for some Xeo firmware). The key is a 4-byte value reported by the device’s info command (Xen, Xeo, Lynx) or a fixed value (Kaon); see the Liquivision family document.

Confidence: likely.

sum8

Sum of all covered bytes modulo 256, init = 00. check = DD.

Users include: Oceanic/Pelagic version replies and 16- and 128-byte pages (Atom 2, Veo 250, VT Pro); Oceanic Atom 2 handshake; Mares Nemo (two copies per packet); Mares Puck/Darwin/Nemo ASCII protocol (sum of the ASCII characters between < and the checksum, sent as two hex characters); Suunto Eon; Deepblu Cosmiq (receive: sum of all bytes including the checksum must be 00).

Example (Mares ASCII read command 51 00 01 20): sum of the ASCII characters "51000120" is 0x189 → checksum 89.

Confidence: likely.

sum8-neg

Two’s complement of sum8: (0x100 − sum8) & 0xFF, so that the sum of data plus checksum is 00. check = 23.

Users: Zeagle N2iTiON3 (command and reply payloads); Deepblu Cosmiq (transmit, where the sum is seeded with command + 2 × length); HW OSTC 2 firmware upload blocks; Intel HEX records.

Confidence: likely.

sum8-inv

Ones’ complement of sum8: sum8 XOR FF. check = 22.

Users: Deep Six Excursion (over header and payload of each packet).

Confidence: likely.

sum16

Sum of all covered bytes (each 0..255) modulo 65536, init = 0000. check = 01DD.

FamilyCoverageWire order
Atomic Aquatics Cobaltversion reply; each dive recordlittle-endian
Oceanic Atom 2 family256-byte page readslittle-endian
Uwatec Aladinfull memory dumplittle-endian
ReefNet Sensusmemory dumplittle-endian
Sporasub SP2command packets (seeded with the command byte); reply payloadbig-endian

Confidence: likely.

nibble-sum

Sum of the high and low nibble of every covered byte, modulo 256, init = 00. check = 48.

Users: Oceanic VT Pro family (each 8-byte half page); Pelagic handshake replies in one source.

Confidence: likely.

xor8

XOR of all covered bytes, init = 00. check = 31.

Users: Suunto Vyper, Vyper2, D9 families (commands and replies; covers everything before the checksum); Uwatec Memomouse; Uwatec Smart over the serial cradle (Meridian/Chromis/Mantis: over length and command on transmit, over status, length and payload on receive).

Example (Suunto version query): 05 00 16 14 → XOR 07, frame 05 00 16 14 07.

Confidence: likely.

ostc-firmware-sum

Used only to verify HW OSTC 3 firmware files (not dive data). Two 16-bit accumulators, both starting at 0: for each byte b, low = (low + b) mod 65536, high = (high + low) mod 65536; result = high << 16 | low, stored u32le at the end of the file. Like Fletcher-32 but over bytes and modulo 2^16 instead of 2^16 − 1. check = 091501DD.

Confidence: likely.

Other integrity and obfuscation mechanisms

MechanismFamilyDescription
Command complement byteMares Icon HD familyeach command byte is followed by command XOR A5
Echo checkingseveral serial familiesthe device echoes the command; the host compares
SLIP framing onlyShearwaterno checksum; see the Shearwater family document
XOR-delta + run-length compressionShearwater (Petrel-class logs)each 32-byte block XORed with the previous block after RLE expansion; see the Shearwater family document
HDLC-style framingSuunto EON Steel (BLE), Divesoftsee ../transports/ble.md
COBS framingGarmin GFDI (BLE)see the Garmin family document
AES-128HW OSTC 3 firmware filesfirmware images are encrypted with AES-128 used as a 128-bit-feedback stream cipher: keystream block = AES(previous ciphertext block), first block AES(IV); concerns firmware update only, not dive download

No dive-log download in this specification uses encryption. Pelagic i330R uses a PIN / access-code exchange for pairing, which is authentication, not encryption.

Confidence: likely.

References

  • libdivecomputer (LGPL-2.1), used as a factual reference; no code copied. https://www.libdivecomputer.org/
  • Greg Cook, Catalogue of parametrised CRC algorithms (RevEng), https://reveng.sourceforge.io/crc-catalogue/
  • Ross Williams, A Painless Guide to CRC Error Detection Algorithms (parameter model)
  • Garmin FIT SDK, file CRC, https://developer.garmin.com/fit/protocol/
  • IrDA IrLAP 1.1 (FCS), Infrared Data Association
  • Intel Hexadecimal Object File Format Specification