Skip to main content

recode_mixed

Function recode_mixed 

Source
pub fn recode_mixed(s: [b17; 15]) -> [b6; 64]
Expand description

Signed mixed-radix recoding (super::host::recode) of a scalar below 2^253: digits 0..39 are radix 32, 39..54 radix 16, sign-magnitude (bit 5 = sign); entries 54..64 are zero.

Carry c[i+1] = (n[i] >= h) | (n[i] == h - 1 & c[i]) with h half the digit’s radix is evaluated as the carry chain of (g | p) + g, i.e. one ordinary 64-bit addition.

The digit radixes match the fixed-base tables: each digit selects a signed multiple of a precomputed point, so a radix-32 digit uses magnitudes 0..=16 and a radix-16 digit 0..=8.