elliptic curves

34 days ago by voloch

k = GF(7) for a in range(1,7): E = EllipticCurve(k,[0, 0, 0,0,a]) #y^2+ a_1xy + a_3y = x^3 + a_2x^2 + a_4x +a_6 corresponds to [a_1,a_2,a_3,a_4,a_6]. In this case y^2=x^3+a print a, E.cardinality() 
       
1 12
2 9
3 13
4 3
5 7
6 4
1 12
2 9
3 13
4 3
5 7
6 4
k = GF(7) E = EllipticCurve(k,[0, 0, 0,0,2]) S= E.rational_points() print S P = E(0,3) print 2*P print 3*P Q = E(3,1) print 2*Q print 3*Q print P+Q for X in S: print 3*X 
       
[(0 : 1 : 0), (0 : 3 : 1), (0 : 4 : 1), (3 : 1 : 1), (3 : 6 : 1), (5 : 1
: 1), (5 : 6 : 1), (6 : 1 : 1), (6 : 6 : 1)]
(0 : 4 : 1)
(0 : 1 : 0)
(3 : 6 : 1)
(0 : 1 : 0)
(6 : 1 : 1)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
[(0 : 1 : 0), (0 : 3 : 1), (0 : 4 : 1), (3 : 1 : 1), (3 : 6 : 1), (5 : 1 : 1), (5 : 6 : 1), (6 : 1 : 1), (6 : 6 : 1)]
(0 : 4 : 1)
(0 : 1 : 0)
(3 : 6 : 1)
(0 : 1 : 0)
(6 : 1 : 1)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
(0 : 1 : 0)
p = 2^256-2^32-2^9-2^8-2^7-2^6-2^4-1 #elliptic curve used in Bitcoin k = GF(p) E = EllipticCurve(k,[0, 0, 0, 0, 7]) G = E(55066263022277343669578718895168534326250603453777594175500187360389116729240,32670510020758816978083085130507043184471273380659243275938904335757337482424) print E.cardinality() print p print 3*G Q = E.lift_x(1) print Q 
       
115792089237316195423570985008687907852837564279074904382605163141518161\
494337
115792089237316195423570985008687907853269984665640564039457584007908834\
671663
(11271166043971060605674865917392967310211497734153940854463061355520977\
5888121 :
255830279805708836916569058774019764064488682548162950699198889605415866\
79410 : 1)
(1 :
298967228525690460155607002945760557762143351592453031164886929075256462\
31534 : 1)
115792089237316195423570985008687907852837564279074904382605163141518161494337
115792089237316195423570985008687907853269984665640564039457584007908834671663
(112711660439710606056748659173929673102114977341539408544630613555209775888121 : 25583027980570883691656905877401976406448868254816295069919888960541586679410 : 1)
(1 : 29896722852569046015560700294576055776214335159245303116488692907525646231534 : 1)
E = EllipticCurve(QQ,[0,0,0,0,3]) #an example over the rationals P = E(1,2) for n in range(1,10): print n, n*P 
       
1 (1 : 2 : 1)
2 (-23/16 : -11/64 : 1)
3 (1873/1521 : -130870/59319 : 1)
4 (2540833/7744 : 4050085583/681472 : 1)
5 (3320340721/4218632401 : 511703877377158/274004393077351 : 1)
6 (-145867600463831/104200405779600 :
-538944270136094954197/1063663154141347656000 : 1)
7 (22099605479196054241/14823289114202355361 :
-143403774211367540349170651858/57071182195170780711429750641 : 1)
8 (41677742803929195922238593/508105313480846959761664 :
269065159484683478575364835230449703617/36218512084030739203137698091825\
9712 : 1)
9 (66961195467389887289664017989153/114342980025329910974557353718881 :
2187489394832104652216643092918685547408463869490/1222684087099345189855\
317970231850019555155264529 : 1)
1 (1 : 2 : 1)
2 (-23/16 : -11/64 : 1)
3 (1873/1521 : -130870/59319 : 1)
4 (2540833/7744 : 4050085583/681472 : 1)
5 (3320340721/4218632401 : 511703877377158/274004393077351 : 1)
6 (-145867600463831/104200405779600 : -538944270136094954197/1063663154141347656000 : 1)
7 (22099605479196054241/14823289114202355361 : -143403774211367540349170651858/57071182195170780711429750641 : 1)
8 (41677742803929195922238593/508105313480846959761664 : 269065159484683478575364835230449703617/362185120840307392031376980918259712 : 1)
9 (66961195467389887289664017989153/114342980025329910974557353718881 : 2187489394832104652216643092918685547408463869490/1222684087099345189855317970231850019555155264529 : 1)