Skip to main content

MS_REGULAR_CONST

Constant MS_REGULAR_CONST 

Source
pub const MS_REGULAR_CONST: u128 = 0x10ce0795c2fd1e62a;
Expand description

MS-domain target residue: codex32’s “SECRETSHARE32” Fe-vec packed big-endian in 5-bit chunks — the value polymod_run (started from the codex32 initial residue [POLYMOD_INIT]) produces for ANY valid ms1 input, independent of entropy length.

SECRETSHARE32 = [s,e,c,r,e,t,s,h,a,r,e,3,2] = [16,25,24,3,25,11,16,23,29,3,25,17,10] packed as Σ vᵢ << (5·(12−i))0x10ce0795c2fd1e62a (bit 64 set). This is the BIP-93 codex32 short-code target the rust-codex32 engine (which envelope.rs uses to encode) checks against, so the hand-rolled path here is byte-equivalent to codex32 for all ms1 lengths.

NOTE (v0.2.1 fix): the previous value 0x962958058f2c192a, paired with a wrong POLYMOD_INIT, was empirically lifted from a single 12-word vector and only validated 16-byte seeds — see design/BUG_decode_with_correction_length_divergence.md.