Skip to main content

recode

Function recode 

Source
pub fn recode(scalar: &[u8; 32]) -> [i8; 64]
Expand description

Signed mixed-radix recoding into DIGITS digits (the rest of the array is zero): digit i lies in [-2^(w-1), 2^(w-1)] for its width w.

The scalar must be below 2^253 (every scalar the signer multiplies is reduced modulo l), which keeps the top digit in [0, 4].

Signed digits halve the table: magnitudes run to 2^(w-1) instead of 2^w - 1, and the sign is applied by negating the selected entry. The array has 64 slots to match the machine’s per-scalar digit slots.