Bézout's Identity vs. Fermat's Little Theorem for Finding Modular Multiplicative Inverses

161 Views Asked by At

While studying how to calculate the multiplicative inverse $a^{-1}$ of a number $a$ such that $a\cdot a^{-1} \equiv 1\mod p$, I found the majority of online resources immediately point to Bézout's identity for a solution. Nevertheless, I find the inverse is way easier to obtain through Fermat's little theorem: $a^{-1} = a^{p-2}\mod p$

Is there an advantage to using the Extended Euclidean Algorithm (Bézout) over Fermat's Little Theorem? Am I missing something?

I wonder whether Bézout's identity provides a more generalized solution, or whether modular exponentiation (FLT) is more computationally costly than EEA.