discrete_log(n, a, b) finds x with b^x = a (mod n), choosing among
trial multiplication, baby step giant step, Pollard's rho, index calculus
and Pohlig-Hellman as SymPy does. order is the order of b if known, and
prime_order states whether it is prime.