Ask Your Question
0

Displaying Z-coordinate of the Elliptic curve points

asked 2020-05-07 00:11:47 +0100

Hassan Mostafa gravatar image

updated 2020-05-14 15:59:01 +0100

FrédéricC gravatar image

when i generate an elliptic curve and work with it's points. it is always displaying with Z-coordinate =1 as following:

sage: EC=EllipticCurve(GF(101),[2,3])
sage: EC
Elliptic Curve defined by y^2 = x^3 + 2*x + 3 over Finite Field of size 101
sage: EC.random_point()
(60 : 65 : 1)
sage: point1=EC.random_point()
sage: point1
(3 : 6 : 1)
sage: point2=2*point1
sage: point2
(30 : 55 : 1)

as shown Z-coordinate always = 1. can i work with points with it's normal (original) Z- component ??

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2020-05-14 15:40:51 +0100

dan_fulea gravatar image

Here is an alternative answer, to show points...

sage: EC = EllipticCurve(GF(101), [2, 3])                                                                
sage: EC                                                                                                 
Elliptic Curve defined by y^2 = x^3 + 2*x + 3 over Finite Field of size 101
sage: P = EC.random_point()                                                                              
sage: P                                                                                                  
(98 : 24 : 1)
sage: P.xy()                                                                                             
(98, 24)
sage: ORIGIN = EC.point(0)                                                                               
sage: ORIGIN.xy()                                                                                        
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)

As seen, there is a problem to represent P using the P.xy() method (only) in the case the point needed is the $O$ point on the elliptic curve (declared in the shape $y^2=x^3+ax+b$).

Note that one can easily access the components and do stuff with them as best suited for the own taste...

sage: P                                                                                                  
(98 : 24 : 1)

sage: x, y, z = P                                                                                        
sage: x, y, z                                                                                            
(98, 24, 1)
sage:   

sage: x, y, z = ORIGIN                                                                                   
sage: x, y, z                                                                                            
(0, 1, 0)
edit flag offensive delete link more
1

answered 2020-05-07 02:47:23 +0100

tmonteil gravatar image

updated 2020-05-07 02:48:32 +0100

The thing is that the points of the curve are defined up to a multiplicative constant, since the equation that defines the curve is homogenous:

sage: EC.defining_polynomial()
-x^3 + y^2*z - 2*x*z^2 - 3*z^3

So if i take a random point :

sage: p = EC.random_point()
sage: p
(50 : 60 : 1)

there is no canonical choice of which multiple (a*50, a*60, a*1) that represents that point.

That said, you can decide to fix the x coordinate to be equal to 1:

sage: p.dehomogenize(0)
(82, 99)

or the y coordinate:

sage: p.dehomogenize(1)
(85, 32)

or the z coordinate:

sage: p.dehomogenize(2)
(50, 60)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-05-07 00:11:47 +0100

Seen: 481 times

Last updated: May 14 '20