You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# lets print out the points, notice they print (x,y,z) the difference between homogenious points and affine points is that to use affine you just divide x,y by z.
23
+
# We can see here that for all points in the curve group z = 1 except the zero point at infinity. So for this field they are the same
24
+
print(E.points())
25
+
26
+
# Define polynomial ring
27
+
R.<X>=PolynomialRing(F101)
28
+
29
+
# Lets make an extension field
30
+
# niavely: we could pick x^2 + 1 but
31
+
# x^2 + 1 = x^2 + 100 = (x+10)(x-10) -> There is a root in the field
32
+
# lets pick x^2 + 2 which is irreducible in our field
33
+
34
+
# Extended polynomial ring
35
+
K.<X>=GF(101**2, modulus=x^2+2)
36
+
37
+
# Curve group over polynomial ring
38
+
E2=EllipticCurve(K, [0, 3])
39
+
print(E2.points())
40
+
41
+
# G1 is the generator for E1
42
+
G1=E(1,2)
43
+
print(G1)
44
+
45
+
# N is the order of the group E1
46
+
N=17
47
+
48
+
# G2 is the generator for E2
49
+
G2=E2([36, 31*X])
50
+
print(G2)
51
+
52
+
# Now Lets generate the structured refrence string (SRS),
53
+
# we will use the "random" number 2 for the example but in practice it should be strong random.
54
+
# a circuit with n gates requires an SRS with at least
55
+
# n + 5 elements as below
56
+
# We will let it be of length 9, pythagorean triple uses 4 gates
0 commit comments