Computing modular inverse in extension fields

161 Views Asked by At

I am currently studying elliptic curves and Weil pairings. Curves are defined on $\mathbb{F}_{p}$, and to establish the Weil pairing extension field $\mathbb{F}_{p^2}$ is used (with a polynom for reduction).

I have created some basic programs to play with small finite fields, but now I am stuck with modular inverse in $\mathbb{F}_{p^2}$ (in $\mathbb{F}_{p}$ I was simply doing $x^{p-2}$ to compute the inverse of $x$). Can someone please point me to an algorithm to use in extension fields ?

Thanks in advance for any help!