"Source: Text/Geometry/CrvEllFldFin.text";
"Line: 266";
"Date: Tue Jun  7 22:27:14 2016";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Geometry/CrvEllFldFin.text, line: 266
// Example: H132E1 ()
print "Example: H132E1";
ei := GetEchoInput();
SetEchoInput(true);
//example with no Gaussian Normal Basis (GNB)
K<w> := FiniteField(2, 160); // finite field of size 2^160
f<x> := MinimalPolynomial(w); f;
E := EllipticCurve([K| 1, 0, 0, 0, w]);
time #E;
assert $1 eq 1461501637330902918203686141511652467686942715904;
//example with a GNB of Type 1
HasGNB(pAdicRing(2, 1), 162, 1);
assert $1;
K<w> := FiniteField(2, 162); // finite field of size 2^162
f<x> := MinimalPolynomial(w); f;
E := EllipticCurve([K| 1, 0, 0, 0, w]);
time #E;
assert $1 eq 5846006549323611672814742626685174784085558341632;
//example with a GNB of Type 2
K<w> := FiniteField(2, 173); // finite field of size 2^173
f<x> := MinimalPolynomial(w); f;
E := EllipticCurve([K| 1, 0, 0, 0, w]);
time #E;
assert $1 eq 11972621413014756705924586057649971923911742202056704;
F := FiniteField(3, 100);
j := Random(F);
E := EllipticCurveWithjInvariant(j);
time #E;
F := FiniteField(37, 30);
j := Random(F);
E := EllipticCurveWithjInvariant(j);
time #E;
p := NextPrime(10^9);
p;
assert $1 eq 1000000007;
K := GF(p);
E := EllipticCurve([K | -1, 1]);
time SEA(E : MaxSmooth := 1);
assert $1 eq 0;
time #E;
assert $1 eq 1000009476;
E := EllipticCurve([K | 0, 1]);
time SEA(E : MaxSmooth := 1);
assert $1 eq 1000000008;
IsSupersingular(E);
assert $1;
E := EllipticCurve([K | -30, 1]);
time SEA(E : MaxSmooth := 1);
assert $1 eq 1000035283;
Factorization($1);
for k in [1..p] do
  E := EllipticCurve([K | k, 1]);
  n := SEA(E : MaxSmooth := 1);
  if IsPrime(n) then
    printf "Found curve of prime order %o for k = %o\n", n, k;
    break;
  end if;
end for;
E;
#E;
assert $1 eq 999998501;
SetEchoInput(ei);
