Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
Explicit formulas for the group law on Edwards curves with comparison to formulas for Weierstrass curves in projective coordinates, as presented in 18.783 Lecture 2
Project: 18.783 Spring 2021
Views: 644License: AGPL3
Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu2004Kernel: SageMath 9.2
For the sake of comparison we first give formulas for Weierstrass curves in projective coordinates; scroll down to see the formulas for Edwards curves
In [1]:
In [2]:
In [3]:
Timing add_affine on random points...
4.82 µs ± 344 ns per loop (mean ± std. dev. of 7 runs, 30000 loops each)
Timing add_add_affine on equal points...
6.73 µs ± 321 ns per loop (mean ± std. dev. of 7 runs, 30000 loops each)
Testing dbl_affine...
6.33 µs ± 280 ns per loop (mean ± std. dev. of 7 runs, 30000 loops each)
Timing add_projective on random points...
8.75 µs ± 178 ns per loop (mean ± std. dev. of 7 runs, 30000 loops each)
Timing add_projective on equal points...
12.6 µs ± 159 ns per loop (mean ± std. dev. of 7 runs, 30000 loops each)
Testing dbl_projective...
9.13 µs ± 65.7 ns per loop (mean ± std. dev. of 7 runs, 30000 loops each)
Note that distinct triples of proejctive coordinates may define the same projective point. To compare points for equality we need to use the equal_projective function above (which also works for Edwards curves)
In [4]:
R1 = (39631903559207355134813242690485305706327172391023199616984319804673277252824, 33869231864040439687106036648793069871874765452794702250861206505319640701175, 1271603232244282005892045156571757933303549172868729422943298126929250743038)
R2 = (39003209298511745779211371247669215406384172665513230424454802014897447644459, 44765880993678661226918577289361451240836579603741727790577915314251084196108, 77363509625474818908132568781582763179407795883667700618495823692641474154245)
R1 == R2: False
equal_projective(R1,R2): True
In [5]:
In [6]:
Affine points on Edwards curve x^2 + y^2 = 1 + 3x^2y^2 over F_17
[0, 1]
[0, 16]
[1, 0]
[2, 5]
[2, 12]
[3, 4]
[3, 13]
[4, 3]
[4, 14]
[5, 2]
[5, 15]
[7, 7]
[7, 10]
[10, 7]
[10, 10]
[12, 2]
[12, 15]
[13, 3]
[13, 14]
[14, 4]
[14, 13]
[15, 5]
[15, 12]
[16, 0]
In [5]:
Timing add_edwards on random points...
6.44 µs ± 366 ns per loop (mean ± std. dev. of 7 runs, 30000 loops each)
Timing add_edwards on equal points...
6.46 µs ± 296 ns per loop (mean ± std. dev. of 7 runs, 30000 loops each)
Timing dbl_edwards...
4.96 µs ± 559 ns per loop (mean ± std. dev. of 7 runs, 30000 loops each)
In [0]: