suppose we need to find (a^b)%m. If b is too large we can mode b with phi(m). That means (a^b)%m is equal ( a^ (b%phi(m)) )%m. This theorem works for number properly. Now I have a matrix M two dimensional. Here M^2=M*M,M^3=M*(M^2) and so on.I also mod elements of matrix by m. Suppose that M%m means all elements of matrix are mod by m. Now I need to find (M^b)%m and b is too large. if I mod b by phi(m) will it work? That means (M^b)%m and (M^ (b%phi(m)) )%m will be equal?
Sorry for my bad english and thanks in advance.