One’s-Complement Checksums in Internet Transport
Fold end-around carries when summing 16-bit words and distinguish accidental error checking from authenticated integrity.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
A carry wraps into the low word
In one’s-complement addition, sum the words and add carry bits beyond sixteen back into the low part until no carry remains. For \(0xFFFF+0x0001\), the low sixteen bits are zero and the carry folds back to one. Taking the bitwise complement yields the checksum of those words. Including the stored checksum in the receiver’s sum gives the specified all-ones result for this calculation.
The checked data must have an agreed representation
Internet transport checks can include a pseudo-header that binds fields such as addresses and protocol. Enforce the specification for word boundaries, padding and coverage. The checksum detects many accidental errors but is not a cryptographic authenticity guarantee. UDP datagrams use a checksum with rules tied to their network context. Authenticated encryption gives a separate integrity model with a protected key.[1][2]