Skip to main content

mul_add_region

Function mul_add_region 

Source
pub fn mul_add_region(c: u8, src: &[u8], dst: &mut [u8])
Expand description

Region multiply-accumulate over GF(2^8): dst[i] ^= c · src[i] for every byte — the inner loop of Reed-Solomon encode/reconstruct. src and dst must be the same length. The body is a per-c table lookup XORed into the destination, a shape the compiler AUTO-VECTORIZES to SSE/AVX on native and to wasm v128 under simd128 — the SIMD speedup for browser FEC, in safe Rust with no hand-written intrinsics to silently miscompile (its result is pinned byte-exact to the scalar field by the tests).