Expand description
RAID parity: XOR (P-only) and P+Q (RAID-6) generation and checking —
ISA-L’s raid module semantics with validated, panic-free APIs.
Q is the classic RAID-6 syndrome Q = Σ 2^j · D_j over GF(2^8)/0x11d,
computed Horner-style exactly as ISA-L’s pq_gen_base (last source first,
q = s ^ 2·q), using the same word-parallel multiply-by-2 (eight byte
lanes per u64: shift, isolate bit-7 lanes, expand to a lane mask, fold the
polynomial). Where ISA-L requires 32-byte-multiple lengths and silently
ignores sub-word tails in its base code, this port handles ANY length —
word blocks plus an exact byte tail — and is gated both ways against real
ISA-L (their outputs on aligned lens; their byte-wise checkers accepting
our outputs on odd lens).
Structs§
- PqMismatch
- A P/Q consistency failure: the first offending byte offset and which
parity it disagreed with (ISA-L’s
i | 1/i | 2return, made typed).
Enums§
Functions§
- pq_
check - Check sources against P and Q — ISA-L
pq_check.Ok(None)means consistent;Ok(Some(_))names the first mismatch. - pq_gen
- RAID-6 P+Q of ≥2 sources — ISA-L
pq_gen, any length. - xor_
check - True when the XOR of ALL vectors (parity included) is zero — ISA-L
xor_check. Word-wide with per-block early exit. - xor_gen
- XOR parity of ≥2 sources into
parity— ISA-Lxor_gen.