Newton iteration for modular inversion

ID: newton-iteration-for-modular-inversion

If , the update satisfies because . For odd , starting with modulo and repeatedly doubling the number of correct bits computes its inverse modulo a power of two.

New to topics? Read the docs here!