nx_fec_gf256.nx
buildroot/runtime/nx_fec_gf256.nx
about
nx_fec_gf256.nx -- the FEC CEILING: Reed-Solomon erasure coding over
GF(256). MDS (maximum-distance-separable): an RS(n=K+R, K) code
recovers ANY R lost symbols, in ANY positions -- not just the specific
patterns XOR parity handles. This is the DSN/CCSDS/RaptorQ-class
rateless recovery ceiling. Sovereign, integer-only: GF(256) tables are
BUILT AT RUNTIME from the primitive polynomial 0x11D (sidesteps the
const-array-literal gap, same trick as nx_crc32c), and a CAUCHY parity
matrix guarantees every K x K submatrix is invertible (true MDS).
Encoding matrix = [ I_K ; C ] where C[j][i] = 1 / ((K+j) ^ i) in GF(256)
(disjoint Cauchy point sets -> non-singular). Decode: take the K rows
for any K surviving symbols -> K x K matrix M -> data = M^-1 * survivors
(Gauss-Jordan over GF(256)). Reconstructs every erased symbol.
license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_fec_gf256_test.nx
structs
| none |
consts
| 19 | const GF_POLY: i64 = 0x11D // x^8+x^4+x^3+x^2+1, generator 2 |
functions
| 22 | func gf_build(exp: *i64, log: *i64) -> i64 called by 1: main |
| 36 | func gf_mul(exp: *i64, log: *i64, a: i64, b: i64) -> i64 |
| 41 | func gf_inv(exp: *i64, log: *i64, a: i64) -> i64 { return exp[255 - log[a]] } |
| 43 | func rs_cauchy(exp: *i64, log: *i64, j: i64, i: i64, K: i64) -> i64 |
| 48 | func rs_encode(exp: *i64, log: *i64, data: *u8, K: i64, R: i64, S: i64, parity: *u8) -> i64 |
| 70 | func gf_mat_invert(exp: *i64, log: *i64, M: *i64, K: i64, Minv: *i64) -> i64 |
| 127 | func rs_decode_erasures(exp: *i64, log: *i64, recv: *u8, present: *i64, |