Skip to main content

compute_n_prime_newton

Function compute_n_prime_newton 

Source
pub fn compute_n_prime_newton<T>(modulus: T, w: usize) -> T
Expand description

Newton’s method for N’ = -N^{-1} mod 2^W.

Invariant: after each iteration, modulus * x ≡ 1 (mod 2^precision). We return 0 - x so that modulus * N' ≡ -1 (mod 2^W).