I am trying to solve this problem :
Given $a$, $b$, $c$ integers (that could be very large), find $x$ integer such as :
$a=b^x \mod c$
I tried by coding in C a loop checking the equality and incrementing x, but I assume they are faster ways to do that. What are the best exisiting algorithms for solving this problem, with big $a$, $b$ and $c$ ?