-
-
Notifications
You must be signed in to change notification settings - Fork 660
Closed
Milestone
Description
Currently, Sage uses the generic action of ZZ
on additive groups to compute scalar multiplications for elliptic curves. This is significantly slower than PARI's specialized ellmul()
function:
sage: E = EllipticCurve(GF(65537), [1,2,3,4,5])
sage: P = E.random_point()
sage: %timeit 12345*P
241 µs ± 3.31 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
sage: %timeit pari.ellmul(E,P,12345)
47.4 µs ± 645 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
This patch adds the use of ellmul()
for elliptic curves over finite fields. The speedup is very significant for all sizes I've tried (between ~10 and ~1000 bits), ranging from 4× to 8×.
Diff without the dependency:
sagemath/sagetrac-mirror@e92d1cc
The dependency is by no means essential, but it was convenient since #32786 already adds the _acted_upon_
method.
Depends on #32786
CC: @videlec
Component: elliptic curves
Author: Lorenz Panny
Branch: 895fe23
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/33147