Skip to main content

Module invert_mod

Module invert_mod 

Source

Functionsยง

expand_invert_mod2k ๐Ÿ”’
Perform a modified recursive Hensel quadratic modular inversion to calculate a^-1 mod w^p given a^-1 mod w^k where w is the size of Limb. For reference see Algorithm 2: https://arxiv.org/pdf/1209.6626
expand_invert_mod2k_step ๐Ÿ”’
One step of the Hensel quadratic modular inverse calculation, doubling the width of the inverted output, and wrapping at capacity of buf.