Commit
1 year ago
gh-38347: support passing two base points to .log() for elliptic-curve points The points on an elliptic curve over a finite field form a group of rank up to $2$. In this patch we add support for passing two base points instead of just one to the `.log()` method, which will decompose the given point as a linear combination of the given points. This functionality is already available via the `.abelian_group()` method of the elliptic curve, but the latter is much slower since it relies only on generic-group algorithms and does not exploit the Weil pairing: ``` sage: F = GF((5, 60), 'a') sage: E = EllipticCurve(F, [1, 1]) sage: A = E.abelian_group() sage: P, Q = E.gens()[::-1] sage: T = randrange(P.order()) * P + randrange(Q.order()) * Q sage: %time A.discrete_log(T, [P,Q]) CPU times: user 47.4 s, sys: 74 ms, total: 47.5 s Wall time: 47.6 s (2474, 185989333112663415489036252299763200191) sage: %time T.log([P, Q]) CPU times: user 1.43 s, sys: 3.34 ms, total: 1.44 s Wall time: 1.44 s (2474, 185989333112663415489036252299763200191) ``` ### ⌛ Dependencies - #38350 URL: https://github.com/sagemath/sage/pull/38347 Reported by: Lorenz Panny Reviewer(s): Giacomo Pope, Lorenz Panny
Author
Release Manager
Loading