bridge/class-master/depend/pari/src/basemath/bb_group.c
/*Generic discrete logarithme in a group of prime order p*/
Generic discrete logarithme in a group of prime order p
Generic discrete logarithme in a group of prime order p
GEN
gen_plog(GEN x, GEN g, GEN p, void *E, const struct bb_group *grp)
{
  if (grp->easylog)
  {
    GEN e = grp->easylog(E, x, g, p);
    if (e) return e;
  }
  if (grp->equal1(x)) return gen_0;
  if (grp->equal(x,g)) return gen_1;
  if (expi(p)<32) return gen_Shanks_log(x,g,p,E,grp);
  return gen_Pollard_log(x, g, p, E, grp);
}
GEN gen_plog ( GEN x , GEN g , GEN p , void * E , const struct bb_group * grp ) { if ( grp -> easylog ) { GEN e = grp -> easylog ( E , x , g , p ) ; if ( e ) return e ; } if ( grp -> equal1 ( x ) ) return gen_0 ; if ( grp -> equal ( x , g ) ) return gen_1 ; if ( expi ( p ) < 32 ) return gen_Shanks_log ( x , g , p , E , grp ) ; return gen_Pollard_log ( x , g , p , E , grp ) ; }
Generic discrete logarithme in a group of prime order p
Generic discrete logarithme in a group of prime order p