Skip to content

use PARI's ellmul() for elliptic curves over finite fields #33147

@yyyyx4

Description

@yyyyx4

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions