p = randomprime(2^100) a = Mod(2,p); type(a) a^(p-1) a.mod == p lift(a) T = x^2+1; b = Mod(x+a, T); type(b) b^(p+1) b.pol b.mod == T c = ffgen(3^8,'c) \\generator of F_3^8 as a field type(c) c.p c.mod \\defining polynomial, lifted to Z polisirreducible(c.mod*Mod(1,3)) c.f \\degree over F_3 d = c^9+1 d.pol type(d.pol) ffinit(3,5) ffgen(x^2+Mod(1,3)) nf = nfinit(y^8 - 2*y^7 + 9*y^6 - 2*y^5 + 38*y^4 - 34*y^3 + 31*y^2 - 6*y + 1); pr = idealprimedec(nf,2)[1]; [pr.e,pr.f] g = nfmodpr(nf,y,pr) modpr = nfmodprinit(nf,pr); nfmodpr(nf,y^2+1,modpr) nfmodprlift(nf,g+1,modpr) \\find a preimage [c,c+1;2*c,1]^-1 d = random(c) \\random element in the field issquare(d) trace(d) \\over F_3 norm(d) minpoly(d^82) factor(x^5+x^3+c) \\variants factormodSQF and factormodDDF polrootsmod(x^7+x+c) fforder(c) z = ffprimroot(c) fforder(z) n = fflog(c,z) c == z^n E = ellinit([c,1]); E.cyc \\structure of the group of points ellissupersingular(E) hyperellcharpoly(x^7+c*x+2) \\y^2 = x^7+c*+2 d = ffgen([3,24],'d) Mcd = ffembed(c,d); \\compute some embedding ffembed(d,c) break c2 = ffmap(Mcd,c^5+c+1) \\apply the map F = fffrobenius(d,8); \\8-th power of Frobenius ffmap(F, d) == d ffmap(F, c2) == c2 T = ffinit(3,5) [e,Mde] = ffextend(d, T, 'e); e.f fforder(e) ffmap(Mde, d) Mce = ffcompomap(Mde,Mcd); ffmap(Mce, c) == ffmap(Mde, ffmap(Mcd, c)) ffcompomap(F,Mcd) == Mcd ffcompomap(F,F) == fffrobenius(d,16) Mdc = ffinvmap(Mcd); ffmap(Mdc, ffmap(Mcd, c^3+c+1)) ffmap(Mdc, d) Mec = ffcompomap(Mdc, ffinvmap(Mde)); ffmap(Mec, ffmap(Mce, c)) ffinvmap(fffrobenius(c,3)) == fffrobenius(c,5)