Montgomery curve

From testwiki
Revision as of 02:45, 16 February 2025 by imported>Luke10.27
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Too technical Template:Short description In mathematics, the Montgomery curve is a form of elliptic curve introduced by Peter L. Montgomery in 1987,[1] different from the usual Weierstrass form. It is used for certain computations, and in particular in different cryptography applications.

Definition

A Montgomery curve of equation 14y2=x3+52x2+x

A Montgomery curve over a field Template:Math is defined by the equation

MA,B:By2=x3+Ax2+x

for certain Template:Math and with Template:Math.

Generally this curve is considered over a finite field K (for example, over a finite field of Template:Math elements, Template:Math) with characteristic different from 2 and with Template:Math and Template:Math, but they are also considered over the rationals with the same restrictions for Template:Math and Template:Math.

Montgomery arithmetic

It is possible to do some "operations" between the points of an elliptic curve: "adding" two points P,Q consists of finding a third one R such that R=P+Q; "doubling" a point consists of computing [2]P=P+P (For more information about operations see The group law) and below.

A point P=(x,y) on the elliptic curve in the Montgomery form By2=x3+Ax2+x can be represented in Montgomery coordinates P=(X:Z), where P=(X:Z) are projective coordinates and x=X/Z for Z0.

Notice that this kind of representation for a point loses information: indeed, in this case, there is no distinction between the affine points (x,y) and (x,y) because they are both given by the point (X:Z). However, with this representation it is possible to obtain multiples of points, that is, given P=(X:Z), to compute [n]P=(Xn:Zn).

Now, considering the two points Pn=[n]P=(Xn:Zn) and Pm=[m]P=(Xm:Zm): their sum is given by the point Pm+n=Pm+Pn=(Xm+n:Zm+n) whose coordinates are:

Xm+n=Zmn((XmZm)(Xn+Zn)+(Xm+Zm)(XnZn))2
Zm+n=Xmn((XmZm)(Xn+Zn)(Xm+Zm)(XnZn))2

If m=n, then the operation becomes a "doubling"; the coordinates of [2]Pn=Pn+Pn=P2n=(X2n:Z2n) are given by the following equations:

4XnZn=(Xn+Zn)2(XnZn)2
X2n=(Xn+Zn)2(XnZn)2
Z2n=(4XnZn)((XnZn)2+((A+2)/4)(4XnZn))

The first operation considered above (addition) has a time-cost of 3M+2S, where M denotes the multiplication between two general elements of the field on which the elliptic curve is defined, while S denotes squaring of a general element of the field.

The second operation (doubling) has a time-cost of 2M + 2S + 1D, where D denotes the multiplication of a general element by a constant; notice that the constant is (A+2)/4, so A can be chosen in order to have a small D.

Algorithm and example

The following algorithm represents a doubling of a point P1=(X1:Z1) on an elliptic curve in the Montgomery form.

It is assumed that Z1=1. The cost of this implementation is 1M + 2S + 1*A + 3add + 1*4. Here M denotes the multiplications required, S indicates the squarings, and a refers to the multiplication by A.

XX1=X12
X2=(XX11)2
Z2=4X1(XX1+aX1+1)

Example

Let P1=(2,3) be a point on the curve 2y2=x3x2+x. In coordinates (X1:Z1), with x1=X1/Z1, P1=(2:1).

Then:

XX1=X12=4
X2=(XX11)2=9
Z2=4X1(XX1+AX1+1)=24

The result is the point P2=(X2:Z2)=(9:24) such that P2=2P1.

Addition

Given two points P1=(x1,y1), P2=(x2,y2) on the Montgomery curve MA,B in affine coordinates, the point P3=P1+P2 represents, geometrically the third point of intersection between MA,B and the line passing through P1 and P2. It is possible to find the coordinates (x3,y3) of P3, in the following way:

1) consider a generic line y=lx+m in the affine plane and let it pass through P1 and P2 (impose the condition), in this way, one obtains l=y2y1x2x1 and m=y1(y2y1x2x1)x1;

2) intersect the line with the curve MA,B, substituting the y variable in the curve equation with y=lx+m; the following equation of third degree is obtained:

x3+(ABl2)x2+(12Blm)xBm2=0.

As it has been observed before, this equation has three solutions that correspond to the x coordinates of P1, P2 and P3. In particular this equation can be re-written as:

(xx1)(xx2)(xx3)=0

3) Comparing the coefficients of the two identical equations given above, in particular the coefficients of the terms of second degree, one gets:

x1x2x3=ABl2.

So, x3 can be written in terms of x1, y1, x2, y2, as:

x3=B(y2y1x2x1)2Ax1x2.

4) To find the y coordinate of the point P3 it is sufficient to substitute the value x3 in the line y=lx+m. Notice that this will not give the point P3 directly. Indeed, with this method one find the coordinates of the point R such that R+P1+P2=P, but if one needs the resulting point of the sum between P1 and P2, then it is necessary to observe that: R+P1+P2=P if and only if R=P1+P2. So, given the point R, it is necessary to find R, but this can be done easily by changing the sign to the y coordinate of R. In other words, it will be necessary to change the sign of the y coordinate obtained by substituting the value x3 in the equation of the line.

Resuming, the coordinates of the point P3=(x3,y3), P3=P1+P2 are:

x3=B(y2y1)2(x2x1)2Ax1x2
y3=(2x1+x2+A)(y2y1)x2x1B(y2y1)3(x2x1)3y1

Doubling

Given a point P1 on the Montgomery curve MA,B, the point [2]P1 represents geometrically the third point of intersection between the curve and the line tangent to P1; so, to find the coordinates of the point P3=2P1 it is sufficient to follow the same method given in the addition formula; however, in this case, the line y = lx + m has to be tangent to the curve at P1, so, if MA,B:f(x,y)=0 with

f(x,y)=x3+Ax2+xBy2,

then the value of l, which represents the slope of the line, is given by:

l=fx/fy

by the implicit function theorem.

So l=3x12+2Ax1+12By1 and the coordinates of the point P3, P3=2P1 are:

x3=Bl2Ax1x1=B(3x12+2Ax1+1)2(2By1)2Ax1x1y3=(2x1+x1+A)lBl3y1=(2x1+x1+A)(3x12+2Ax1+1)2By1B(3x12+2Ax1+1)3(2By1)3y1.

Equivalence with twisted Edwards curves

Let K be a field with characteristic different from 2.

Let MA,B be an elliptic curve in the Montgomery form:

MA,B:Bv2=u3+Au2+u

with AK{2,2}, BK{0}

and let Ea,d be an elliptic curve in the twisted Edwards form:

Ea,d : ax2+y2=1+dx2y2,

with a,dK{0},ad.

The following theorem shows the birational equivalence between Montgomery curves and twisted Edwards curve:[2]

Theorem (i) Every twisted Edwards curve is birationally equivalent to a Montgomery curve over K. In particular, the twisted Edwards curve Ea,d is birationally equivalent to the Montgomery curve MA,B where A=2(a+d)ad, and B=4ad.

The map:

ψ:Ea,dMA,B
(x,y)(u,v)=(1+y1y,1+y(1y)x)

is a birational equivalence from Ea,d to MA,B, with inverse:

ψ1: MA,BEa,d
(u,v)(x,y)=(uv,u1u+1),a=A+2B,d=A2B

Notice that this equivalence between the two curves is not valid everywhere: indeed the map ψ is not defined at the points v=0 or u+1=0 of the MA,B.

Equivalence with Weierstrass curves

Any elliptic curve can be written in Weierstrass form. In particular, the elliptic curve in the Montgomery form

MA,B: By2=x3+Ax2+x,

can be transformed in the following way: divide each term of the equation for MA,B by B3, and substitute the variables x and y, with u=xB and v=yB respectively, to get the equation

v2=u3+ABu2+1B2u.

To obtain a short Weierstrass form from here, it is sufficient to replace u with the variable tA3B:

v2=(tA3B)3+AB(tA3B)2+1B2(tA3B);

finally, this gives the equation:

v2=t3+(3A23B2)t+(2A39A27B3).

Hence the mapping is given as

ψ: MA,BEa,b
(x,y)(t,v)=(xB+A3B,yB),a=3A23B2,b=2A39A27B3

In contrast, an elliptic curve over base field 𝔽 in Weierstrass form

Ea,b: v2=t3+at+b

can be converted to Montgomery form if and only if Ea,b has order divisible by four and satisfies the following conditions:[3]

  1. z3+az+b=0 has at least one root α𝔽; and
  2. 3α2+a is a quadratic residue in 𝔽.

When these conditions are satisfied, then for s=(3α2+a)1 we have the mapping

ψ1: Ea,bMA,B
(t,v)(x,y)=(s(tα),sv),A=3αs,B=s.

See also

Notes

Template:Reflist

References