Elliptic curve arithmetic: Difference between revisions
m
→{{header|Sage}}: updated to work with Python 3
(OCaml implementation) |
m (→{{header|Sage}}: updated to work with Python 3) |
||
Line 1,932:
=={{header|Sage}}==
Examples from C, using the built-in Elliptic curves library.
<lang sage>Ellie = EllipticCurve(RR,[0,7]) # RR = field of real numbers▼
▲Ellie = EllipticCurve(RR,[0,7]) # RR = field of real numbers
# a point (x,y) on Ellie, given y
Line 1,942 ⟶ 1,941:
return P
print
P = point(1)
print
Q = point(2)
print
S = P+Q
print
print
print
{{out}}
<pre>
|