bridge/class-master/depend/pari/src/basemath/elliptic.c
/* assume model is p-minimal */
assume model is p-minimal
assume model is p - minimal
static GEN
ellgroup_m(GEN E, GEN p, GEN *pm)
{
  GEN a4, a6, N = ellcard(E, p); 
  *pm = gen_1;
  if (equali1(N)) return cgetg(1,t_VEC);
  if (absequaliu(p, 2)) return mkvec(N);
  if (absequaliu(p, 3))
  { 
    ulong b2, b4, b6;
    if (!absequaliu(N, 4)) return mkvec(N);
    b6 = Rg_to_Fl(ell_get_b6(E), 3);
    if (b6) return mkvec(N);
    b2 = Rg_to_Fl(ell_get_b2(E), 3);
    b4 = Rg_to_Fl(ell_get_b4(E), 3);
    if ((1 + b2 + (b4<<1)) % 3) return mkvec(N);
    return mkvec2s(2, 2);
  } 
  ell_to_a4a6(E, p, &a4,&a6);
  return Fp_ellgroup(a4,a6,N,p, pm);
}
static GEN ellgroup_m ( GEN E , GEN p , GEN * pm ) { GEN a4 , a6 , N = ellcard ( E , p ) ; * pm = gen_1 ; if ( equali1 ( N ) ) return cgetg ( 1 , t_VEC ) ; if ( absequaliu ( p , 2 ) ) return mkvec ( N ) ; if ( absequaliu ( p , 3 ) ) { ulong b2 , b4 , b6 ; if ( ! absequaliu ( N , 4 ) ) return mkvec ( N ) ; b6 = Rg_to_Fl ( ell_get_b6 ( E ) , 3 ) ; if ( b6 ) return mkvec ( N ) ; b2 = Rg_to_Fl ( ell_get_b2 ( E ) , 3 ) ; b4 = Rg_to_Fl ( ell_get_b4 ( E ) , 3 ) ; if ( ( 1 + b2 + ( b4 << 1 ) ) % 3 ) return mkvec ( N ) ; return mkvec2s ( 2 , 2 ) ; } ell_to_a4a6 ( E , p , & a4 , & a6 ) ; return Fp_ellgroup ( a4 , a6 , N , p , pm ) ; }
assume model is p-minimal
assume model is p - minimal
/* #E^ns(Fp) */ /* The only possible non-cyclic group is [2,2] which happens 9 times */ /* If the group is not cyclic, T = 4x^3 + b2 x^2 + 2b4 x + b6
     * must have 3 roots else 1 root. Test T(0) = T(1) = 0 mod 3 */ /* b6 = T(0) = 0 mod 3. Test T(1) */ /* Now assume p > 3 */