I know that the extended euclidean algorithm is the ideal way to calculate the multiplicative inverse of a single number modulo prime p.
But what if I want to create an array A where A[x] has the inverse of x? Is there a faster way calculate such an array then by calculating the inverse of every element individually?
I intuitively expect that there is a shortcut because you have many identities like
A[x*y % p] = A[x]*A[y] % p However I can not think of a general methodology for getting the entire array A.

(x)are small enough, it might be more efficient to use Euler's theorem, provided you can perform modular exponentiation without resorting to bignums:x^-1 = x^(p-2) (mod p)