What’s the equivalent of this py_ecc code for u ntwisting the ʙɴ128 curve in Pari/ɢᴘ ?

Laël Cellier <[email protected]>
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <[email protected]>
Simple, I’ve curve defined as Y2=X3+3i+9
definied over finite finite field F2p=Fp[i]i2+1
with p=21888242871839275222246405745257275088696311157297823662689037894645226208583
and point X=11559732032986387107991004021392285783925812861821192530917403151452391805634×i+10857046999023057135944570762232829481370756359578518086990519993285655852781
Y=4082367875863433681332203403145435568316851327593401208105741076214120093531×i+8495653923123431417604973247489272438418190587263600148770280649306958101930

As this curve is homomorphic to the curve Y2=X3+3

defined over F12p,
how to convert the point to the F12p

curve such as the discrete logarithm relation between 2
points on the 1st curve is preserved ?

I’ve following code from
py_ecc :

def twist(pt: Point2D[FQP]) -> Point2D[FQ12]:
_x, _y = pt
# Field isomorphism from Z[p] / x**2 to Z[p] / x**2 - 18*x + 82
xcoeffs = [_x.coeffs[0] - _x.coeffs[1] * 9, _x.coeffs[1]]
ycoeffs = [_y.coeffs[0] - _y.coeffs[1] * 9, _y.coeffs[1]]
# Isomorphism into subfield of Z[p] / w**12 - 18 * w**6 + 82,
# where w**6 = x
nx = FQ12([int(xcoeffs[0])] + [0] * 5 + [int(xcoeffs[1])] + [0] * 5)
ny = FQ12([int(ycoeffs[0])] + [0] * 5 + [int(ycoeffs[1])] + [0] * 5)
# Divide x coord by w**2 and y coord by w**3
return (nx * w**2, ny * w**3)

but what it’s Pari/ɢᴘ equivalent ?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.