Cryptography Reference
In-Depth Information
D.2 Magma
Magma is a large computer algebra package. It requires a license to use.
It is available on some institutional computers. For general information, see
http://magma.maths.usyd.edu.au/magma/
.
The following is the transcript of a session, with commentary.
The session starts:
Magma V2.11-14 Thu Nov 1 2007 15:48:04 [Seed = 3635786414]
Type ? for help. Type <Ctrl>-D to quit.
Let's enter the elliptic curve
E
1
:
y
2
=
x
3
58447
x
+ 3954150 of Example
9.3. The vector represents the coe
cients [
a
1
,a
2
,a
3
,a
4
,a
6
] in generalized
Weierstrass form. Unless otherwise specified, the curve is over the rational
numbers.
> E1:= EllipticCurve( [ 0, 0, 0, -58347, 3954150 ]);
Note that the line needs to end with a semicolon. To find out what
E
1
is:
> E1;
Elliptic Curve defined by y
ˆ
2=x
ˆ
3 - 58347*x + 3954150 over
Rational Field
Let's also define
E
2
:
y
2
=
x
3
+ 73. Here we use the shortened form of the
coe
cient vector [
a
4
,a
6
] corresponding to (nongeneralized) Weierstrass form.
> E2:= EllipticCurve( [ 0, 73 ]);
Let's add the points (2
,
9) and (3
,
10) on
E
2
. The notation
E2![2,9]
spec-
ifies that [2
,
9] lives on
E
2
, rather than in some other set.
> E2![2,9] + E2![3, 10];
(-4 : -3 : 1)
Note that the answer is in projective coordinates. We could have done the
computation with one or both points in projective coordinates. For example:
> E2![2,9] + E2![3, 10, 1];
(-4 : -3 : 1)
The identity element of
E
2is
> E2!0;
(0 : 1 : 0)
We can also define a point using
:=
> S:= E2![2,9] + E2![3, 10];
To find out what
S
is:
>S;
(-4 : -3 : 1)
The computer remembers that
S
lies on
E
2
, so we can add it to another
point on
E
2
:
−
Search WWH ::
Custom Search