Re: What's the code for doing the reverse of this code over the altbn128 curve
Laël Cellier <[email protected]>
| Newsgroups | gmane.comp.mathematics.pari.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, sorry yes : I initially wanted to have pairings happenning on the same finite field used by the cryptosystems using the altbn254. But since my aim is diffie Hellman like, I thought after writing the message that I can perform the pairing on the code you wrote. This is in a similar way I intend to use the Weil pairing instead of the optimal ate pairing. I’ve 4 distinct points creating finite field A and B. My aim is to compute a pair of point for finite field C such as A×B×C=(identity element) with a way to do it being C=(A×B)^order−1 The next problem is the current one of this question withhttps://pari.math.u-bordeaux.fr/archives/pari-users-2507/msg00068.html *Algorithm 4.1 <cid:[email protected]>.* *Input:* * d∈Nd∈N satisfying l∣dl∣d and d∣(s+1)d∣(s+1) , * v∈Frv∈Fr , * point A∈G0−{O}A∈G0−{O} . // Note that AA may not be a generator (if ll is composite). *Output:* * Q∈G1−{O}Q∈G1−{O} satisfying hd,A(Q)=vhd,A(Q)=v if such QQ exists. Otherwise, *nil*. *Procedure:* 1. u:=(v(s+1)/d)(s+1)/2u:=(v(s+1)/d)(s+1)/2 ; 2. if u∉Fsu∉Fs then return *nil* ; 3. x1:=ξ(A)+ux1:=ξ(A)+u ; x2:=ξ(A)−ux2:=ξ(A)−u ; 4. Build a set Li:={Q∈E(Fq):ξ(Q)=xi}Li:={Q∈E(Fq):ξ(Q)=xi} for i=1,2i=1,2 . // Note 0≤#Li≤20≤#Li≤2 . 5. for each Q∈L1∪L2Q∈L1∪L2 6. if lQ=OlQ=O and hd,A(Q)=vhd,A(Q)=v then return QQ ; 7. return *nil* ; *Theorem 4.2.* /Algorithm 4.1 returns a correct result with O((klogq)3)O((klogq)3) bit operations./ On Fri, Jul 18, 2025 at 02:12:22PM +0200, Laël Cellier wrote: > The altbn254 curve is defined here : https://github.com/ethereum/EIPs/blob/master/EIPS/eip-197.md#definition-of-the-groups > > This is the code responsible for mapping points from F_p² to F_p¹² : > > p=21888242871839275222246405745257275088696311157297823662689037894645226208583; > i=ffgen((i^2+1)*Mod(1,p)); > X=11559732032986387107991004021392285783925812861821192530917403151452391805634*i+10857046999023057135944570762232829481370756359578518086990519993285655852781; > Y=4082367875863433681332203403145435568316851327593401208105741076214120093531*i+8495653923123431417604973247489272438418190587263600148770280649306958101930; > pt = [X,Y]; > \\ then define the target field, the target curve and the map from Fp[i] to Fp[w]: > w=ffgen((w^12 - 18 * w^6 + 82)*Mod(1,p)); > E2 = ellinit([0,3],w); > map = ffembed(i,w); > \\ define the isomorphism: > twist(pt)= [ffmap(map,pt[1])*w^2, ffmap(map,pt[2])*w^3]; > \\ apply to pt > pt2=twist(pt); > \\ check > ellisoncurve(E2,pt2) > %11 = 1 > \\ success! This code is identical to code I sent to this list and that you rejected. Puzzled, Bill.