Skip to main content

p_minus

Function p_minus 

Source
pub fn p_minus(b: [b85; 3]) -> [b85; 3]
Expand description

p - b for canonical b, computed as !b - 18 over 255 bits.

!b = 2^255 - 1 - b, so !b - 18 = 2^255 - 19 - b = p - b. Combinational. For b = 0 the result is p itself, which is not canonical; callers that need a canonical negation must special-case zero (see the machine’s field_neg).