Skip to content

Instantly share code, notes, and snippets.

@lengyijun
Created October 23, 2017 09:05
Show Gist options
  • Save lengyijun/fe1766d22993a6bb37228d9e1c69c462 to your computer and use it in GitHub Desktop.
Save lengyijun/fe1766d22993a6bb37228d9e1c69c462 to your computer and use it in GitHub Desktop.
PairingForBeginers P52 Weil reciprocity magma脚本
clear;
Fq:=GF(503);
a:=0; b:=1;
E:=EllipticCurve([Fq|a,b]);
P:=E![433,98];
Q:=E![127,258];
R:=E![339,199];
S:=E![124,42];
T:=E![147,443];
U:=E![413,369];
DP:=Divisor(P);
DQ:=Divisor(Q);
F<x,y>:=FunctionField(E);
lambda:=(3*P[1]^2+a)/(2*P[2]);
nu:=P[2]-lambda*P[1];
f2P:=y-(lambda*x+nu);
lambda:=(3*Q[1]^2+a)/(2*Q[2]);
nu:=Q[2]-lambda*Q[1];
f2Q:=y-(lambda*x+nu);
f:=f2P/f2Q;
Evaluate(f,R)*Evaluate(f,S)*Evaluate(f,T)*Evaluate(f,U)/(Evaluate(f,Identity(E)))^4;
@lengyijun
Copy link
Author

image

@lengyijun
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment