Skip to main content

polymod_run

Function polymod_run 

Source
pub fn polymod_run(
    values: &[u8],
    gen: &[u128; 5],
    shift: u32,
    mask: u128,
) -> u128
Expand description

Run polymod over a sequence of 5-bit values using the parameters for either the regular or long BCH code, starting from POLYMOD_INIT.

v0.3.1: promoted from pub(in crate::string_layer) to pub so downstream consumers (toolkit repair feature) can compute polymod residues against ms / md / mk target constants (all 3 share the BIP-93 BCH(93,80,8) generator). Test-helper-drift concern remains resolved by the sibling bch_decode module using THIS function directly rather than re-implementing.