Expand description
Reed-Solomon erasure coding over GF(256) with a Cauchy generator matrix.
Rationale, measurements and history live in PLAN.md §1.7 and in the legacy
Python reference packages/agent/fec.py. What matters for this crate:
kparity chunks overnequal-length data chunks recover anykerasures. Cauchy rather than Vandermonde because every square submatrix of a Cauchy matrix is invertible, which is exactly that guarantee.- The construction — poly
0x11d,A[i][j] = 1 / (i XOR (k + j))— is part of the wire contract. Changing it breaks interop silently, which is whytools/fec-vectors.py | cargo run -p seyd-fec --example checkexists. - The coder is payload-agnostic: it never parses what it protects.
Modules§
- gf
- GF(256) arithmetic, field polynomial 0x11d.
Constants§
- MAX_
SYMBOLS - Hard limit of the construction:
n + k <= 256.
Functions§
- cauchy_
matrix - decode
- Reconstruct missing data chunks in place. Returns
falseif unrecoverable. - encode_
parity - Compute
kparity chunks fromnequal-length data chunks. - parity_
count - Parity chunks for an
n-chunk block atpctoverhead.
Type Aliases§
- Matrix
k x nCauchy matrix, cached per(n, k).