Function: fflog
Section: number_theoretical
C-Name: fflog
Prototype: GGDG
Help: fflog(x,g,{o}): return the discrete logarithm of the finite field
 element x in base g. If present, o must represents the multiplicative
 order of g. If no o is given, assume that g is a primitive root.
Doc: discrete logarithm of the finite field element $x$ in base $g$. If
 present, $o$ represents the multiplicative order of $g$, see
 \secref{se:DLfun}; the preferred format for
 this parameter is \kbd{[ord, factor(ord)]}, where \kbd{ord} is the
 order of $g$. It may be set as a side effect of calling \tet{ffprimroot}.

 If no $o$ is given, assume that $g$ is a primitive root.
 See \tet{znlog} for the limitations of the underlying discrete log algorithms.
 \bprog
 ? t = ffgen(ffinit(7,5));
 ? o = fforder(t)
 %2 = 5602   \\@com \emph{not} a primitive root.
 ? fflog(t^10,t)
 %3 = 11214  \\@com Actually correct modulo o. We are lucky !
 ? fflog(t^10,t, o)
 %4 = 10
 ? g = ffprimroot(t, &o);
 ? o   \\ order is 16806, bundled with its factorization matrix
 %6 = [16806, [2, 1; 3, 1; 2801, 1]]
 ? fforder(g, o)
 %7 = 16806  \\ no surprise there !
 ? fforder(g^10000, g, o)
 ? fflog(g^10000, g, o)
 %9 = 10000
 @eprog
