I wrote libcorrect in C in 2016 and wanted to revisit it in Rust. Instead of doing just a direct conversion, I went down the rabbit hole of making Rust's std::simd work for me. I e…

fec implements two error-correcting codes that show up throughout software-defined radio and spacecraft links: fec started as and draws heavy inspiration from the author's own libcorrect, a C library for forward error correction. This crate also credits Phil Karn's libfec C library for offering an original implementation of these codes, although this crate does not borrow any source or have any relationship with that library, and the name is purely coincidental. Standard parameters (primitive polynomials, the CCSDS dual-basis transform) are derived from the published CCSDS standard (CCSDS 131.0-B, Annex D for the dual basis). With the simd feature, fec decodes faster than libfec on every code. Measured through libfec's own test programs with only the codec library swapped, on a Zen4 laptop (Ryzen 7840HS). Higher is better. Convolutional throughput is decoded payload bits per second. The Reed-Solomon rows decode a (255,223) block, first with no errors (syndromes only) and then with two symbol errors. Reed-Solomon uses no SIMD in either library, so its 32-bit and 64-bit rows differ only by pointer width. See shim/BENCH.md for the full tables, the bit error rate comparison, the 32-bit numbers, and how to reproduce them. decode_soft takes 8-bit soft symbols instead, which corrects more errors when the demodulator can report its confidence. For real spacecraft telemetry (dual-basis symbols on the wire), use encode_ccsds_dual / decode_ccsds_dual.