Check-Value Calculation Audit

Check-Value Calculation Audit

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
fundamentals
beginner
Ada ADA · CALCULATION AUDIT

Check-Value Calculation Audit

The chapter’s worked example runs an 8-bit addition checksum over the bytes AA 03 10 00 EB and keeps the low byte, 0xA8. Then it swaps the 03 and 10 bytes and the checksum still reads 0xA8, so the corrupted order slips through — the blind spot that motivates a CRC. This audit recomputes the sum, reproduces that byte-swap failure, and compares check-value widths to ask what the arithmetic actually buys the receiver.

Companion to the chapter Packet Error Detection — every number here comes from that chapter.

A check value is a small mathematical shadow of the protected bytes. The useful question is not whether the shadow exists, but which byte changes can keep the same shadow and what risk the receiver still carries.

See the relationship before changing it

The figure reads from left to right. The blue card is check width. The middle card applies this page's rule. The green card is random miss chance. Walk the arrows once: set the input, apply the rule, then read the result with its unit.

The retained audit below checks several chapter fixtures. This model keeps those stated values fixed and changes only check width, so the numeric fixture does not switch without explanation.

Check width changes random miss chance An input card leads through the rule random miss chance = 100 / 2^check bits to the random miss chance result. INPUT PAGE INPUT APPLY THE RULE predict calculate check units OUTPUT RESULT
Walk the arrows. More check bits shrink random collision chance, though checksum structure can still miss ordered swaps.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 8 bits.

  2. 2

    Name the relationship. random miss chance = 100 / 2^check bits

  3. 3

    Substitute with units. 100 / 2^8 = 0.390625%

  4. 4

    Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.

Predict, then change check width

Try Predict the direction of random miss chance = 100 / 2^check bits. Test another check width, then compare random miss chance.

8 bits
Chapter baseline
Random miss chance

Observe More check bits shrink random collision chance, though checksum structure can still miss ordered swaps. Reset check width to 8 and compare random miss chance.

Explain More check bits shrink random collision chance, though checksum structure can still miss ordered swaps.

Check yourself

What should you do before trusting a moved-control result?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only check width moves here. Field effects named in the technical boundary stay fixed.
TryRecompute Recompute the chapter's checksum example. The protected bytes are AA 03 10 00 EB , and the chapter uses an 8-bit addition checksum with the low byte kept.
ObserveTrack Prove the swap blind spot. Swapping 03 and 10 changes the order but not the addition result:.
ExplainExplain why swapping 03 and 10 preserves the 0xA8 additive checksum, while a wider CRC check space reduces accidental collisions without authenticating the packet.

Ready: use the stated baseline inputs, then compare each displayed result.

1. Recompute the chapter's checksum example. The protected bytes are AA 03 10 00 EB, and the chapter uses an 8-bit addition checksum with the low byte kept.

0xAA + 0x03 + 0x10 + 0x00 + 0xEB = 170 + 3 + 16 + 0 + 235 = 424 = 0x1A8
low byte = 424 mod 256 = 168 = 0xA8

2. Prove the swap blind spot. Swapping 03 and 10 changes the order but not the addition result:

0xAA + 0x10 + 0x03 + 0x00 + 0xEB = 170 + 16 + 3 + 0 + 235 = 424 = 0x1A8
low byte after the swap = 424 mod 256 = 0xA8, so this checksum still passes

3. Compare check-width scale without overclaiming. Width alone is not a CRC specification, but it does set the size of the check-value space. Under a simple uniform random collision model:

Check width Arithmetic Scale
8-bit checksum 1 / 2^8 = 1 / 256 0.390625%
CRC-16 width 1 / 2^16 = 1 / 65,536 0.001526%
CRC-32 width 1 / 2^32 = 1 / 4,294,967,296 0.0000000233%

What the mathematics buys you: the receiver can now explain both the acceptance decision and the residual risk. The checksum example is reproducible, the byte-swap failure is visible, and the CRC discussion stays honest: a wider check space helps accidental-error screening but still does not authenticate the packet.

Every number above is taken from the chapter’s own material and re-derived step by step.

Technical boundaries. This check-value audit deliberately does not simulate burst-error patterns or a particular CRC polynomial and does not claim authentication. It recomputes the fixed additive checksum and uses a uniform-collision model only to compare 8-, 16-, and 32-bit spaces.