md-codec v0.34.0 — public BCH primitives + decode_with_correction
Tranche B Phase B.1 + B.2 of the v0.22.x follow-ups cycle. Promotes md-codec's BCH primitives to the public API and adds a full-decode-semantic decode_with_correction for downstream sibling-codec + toolkit consumers.
What's new
- Public BCH surface —
bch::{GEN_REGULAR, MD_REGULAR_CONST, polymod_run, hrp_expand, bch_create_checksum_regular, bch_verify_regular}nowpub. Lifts the visibility gate that blocked toolkit + ms-codec from consuming these primitives without forking. bch_decodemodule — vendored Berlekamp-Massey + Chien + Forney + Gf32/Gf1024 (~450 LOC prod + ~100 LOC tests; constant-agnostic body parameterized onMD_REGULAR_CONST). Mirrorsmk_codec::string_layer::bch_decodebyte-equivalent under parity-smoke againstmnemonic-toolkit-v0.22.1.chunk::decode_with_correction(strings: &[&str]) -> Result<(Descriptor, Vec<CorrectionDetail>), Error>— full-decode semantics (Q1 lock): BCH-corrects each chunk then runs the existing decoder. Atomic per chunk per D28 (any chunk failing capacity bound → entire call fails withchunk_indexnamed).- New
Error::TooManyErrors { chunk_index: usize, bound: u8 }variant for BCH-correction-capacity failures.
Closes FOLLOWUPs
md-codec-decode-with-correction-public-api(toolkit + this repo)
Files new at this release
2 visibility-pin/parity tests + 1 unit test file (bch_decode.rs)
+550 LOC bch_decode.rs prod
+190 LOC chunk.rs (decode_with_correction)
Lockstep
- mnemonic-toolkit v0.23.0 — toolkit consumes this via
repair_via_md_codec. - ms-codec v0.2.0 — sibling codec; same architectural pattern.
- descriptor-mnemonic md-cli v0.6.0 — sibling CLI ships
md repairsubcommand.
🤖 Released as part of the v0.22.x follow-ups cycle (Tranche B close).