Skip to main content

Module bch

Module bch 

Source
Expand description

BIP 93 codex32 BCH primitives for HRP "md" (regular code only).

Extracted from the v0.x encoding module; v0.11 needs only the regular-code checksum + verify (long code dropped along with v0.x).

Constants§

GEN_REGULAR
BCH(93,80,8) generator polynomial coefficients (5 × 65-bit).
MD_REGULAR_CONST
MD-domain target residue (NUMS-style, top 65 bits of SHA-256("shibbolethnums")).

Functions§

bch_create_checksum_regular
13-symbol regular-code BCH checksum over hrp_expand(hrp) || data || [0; 13].
bch_verify_regular
Verify a regular-code BCH checksum over the data-part-with-checksum.
hrp_expand
BIP 173-style HRP expansion: [c >> 5 for c in hrp] ++ [0] ++ [c & 31 for c in hrp].
polymod_run
Run the BCH polymod over values starting from POLYMOD_INIT.