Check-Value Calculation Audit
Check-Value Calculation Audit
Ada re-derives this chapter’s own numbers step by step, at full precision
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.
Derive the baseline in four named moves
- 1
Name the input. The chapter baseline is 8 bits.
- 2
Name the relationship. random miss chance = 100 / 2^check bits
- 3
Substitute with units. 100 / 2^8 = 0.390625%
- 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.
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?
What does this small model leave out?
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.
2. Prove the swap blind spot. Swapping 03 and 10 changes the order but not the addition result:
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.