Elliptic curve arithmetic: Difference between revisions
Content added Content deleted
(OCaml implementation) |
m (→{{header|Sage}}: updated to work with Python 3) |
||
Line 1,932: | Line 1,932: | ||
=={{header|Sage}}== |
=={{header|Sage}}== |
||
Examples from C, using the built-in Elliptic curves library. |
Examples from C, using the built-in Elliptic curves library. |
||
⚫ | |||
<lang sage> |
|||
⚫ | |||
# a point (x,y) on Ellie, given y |
# a point (x,y) on Ellie, given y |
||
Line 1,942: | Line 1,941: | ||
return P |
return P |
||
print |
print(Ellie) |
||
P = point(1) |
P = point(1) |
||
print |
print('P',P) |
||
Q = point(2) |
Q = point(2) |
||
print |
print('Q',Q) |
||
S = P+Q |
S = P+Q |
||
print |
print('S = P + Q',S) |
||
print |
print('P+Q-S', P+Q-S) |
||
print |
print('P*12345' ,P*12345)</lang> |
||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |