Skip to main content

polymod_run

Function polymod_run 

Source
pub fn polymod_run(values: &[u8]) -> u128
Expand description

Run the BCH polymod over values starting from POLYMOD_INIT.

Returns the final residue; callers XOR against the per-HRP target constant (e.g. MD_REGULAR_CONST) to produce a checksum or to verify one. Inputs are 5-bit symbols (u8 in 0..32); larger values are reduced modulo 32 by the underlying step.