Bill Allombert on Wed, 18 Mar 2020 21:12:45 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Tower field extensions in libPARI


On Wed, Mar 18, 2020 at 09:50:30PM +0200, Aleksandr Lenin wrote:
> A follow-up question, as it appears I also have difficulties doing
> elliptic curve operations in F_11^2^6. Consider a BN curve E defined by
> y^2 = x^3 + 1 defined over (F_11[Y]/(y^2+1))[X]/(x^6 + (y + 3)).
> 
> To set up the extension field, I run the following code:
> 
> long var_y = fetch_user_var("y");
> 
> GEN p = stoi(11);
> 
> // T = y^2 + 1 in F_p[Y]
> GEN T = mkpoln(3,gen_1,gen_0,gen_1);
> setvarn(T,var_y);
> 
> // s = y + 3 in F_p[Y]
> GEN s = mkpoln(2,gen_1,stoi(3));
> setvarn(s,var_y);
> 
> // U = x^6 + (y + 3) in (F_p[Y]/(T))[X]
> GEN U = mkpoln(7, pol_1(0), pol_0(0), pol_0(0), pol_0(0),
>                   pol_0(0), pol_0(0), s);
> 
> 
> I asked for the cardinality of an elliptic group of a curve defined over
> (F_11[Y]/(y^2+1))[X]/(x^6 + (y + 3)) by running a call
> FpXQ_ellcard(pol_0(0),pol_1(0),U,p). The cardinality was reported to be
> 1774224, which looks suspicious to me, as I expected a much bigger
> number there. I checked it in SageMath. Sage also was struggling to
> obtain the cardinality of a curve defined over (F_11[Y]/(y^2+1))[X]/(x^6
> + (y + 3)), but for a 12-th degree extension of F_11, the cardinality
> should be 3138424833600, according to SageMath. Why does FpXQ_ellcard
> report 1774224?

You should realize that a call like
FpXQ_ellcard(pol_0(0),pol_1(0),U,p)
cannot possibly work since you are not specifying the polynomial T.

Of course, since your curve has coefficient in F_11,
you can just use Fp_ffellcard:
Fp_ffellcard(gen_0, gen_1,powuu(11,12),12,utoi(11))

> Operations on point curves end up in a crash. In example, the call
> FpXQE_mul(mkvec2(pol_0(0),pol_1(0)),stoi(10),gen_0,U,p) produces "bug in
> PARI/GP (Segmentation Fault), please report."
> 
> Do I need some version of FpXQXQE_ function here? I'm obviously
> tourchering and probably misusing libPARI here, but I hope to be able to
> do something useful with elliptic curves defined over towered extension
> fields.

Yes, you would need FpXQXQE_* functions, which are not implemented.

Instead You can use 
S = FpX_FpXY_resultant(T,U,p) to get the absolute polynomial defining
your extension.

Cheers,
Bill.