-
-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PARI/GP for elliptic curve discrete logarithms (elllog) and Weil pairings (ellweilpairing) #33121
Comments
comment:1
Good idea! Another example from recent experience: PARI computes (some?) pairings about 10 times faster than Sage. |
comment:2
Discrete log also seems to be faster with PARI/GP (x3 on this example)
|
Commit: |
Author: Lorenz Panny |
comment:3
Alright, here's a branch. Its primary goal was to call Benchmarks with pairings in fields up to 128 bits and ECDLPs up to 40 bits indicate that the new code is about 15 times faster on average for those sizes (in both cases). The biggest speedups observed in my tests were about 25× for pairings and about 100× for ECDLPs. Minor slowdowns were only observed for really tiny instances, presumably due to the added conversions between PARI and Sage. We could add a case distinction there, but frankly, I think it doesn't matter. Example:
9.5.rc0:
This branch:
While benchmarking, I also noticed that scalar multiplications in Sage are significantly (5×?) slower than PARI's New commits:
|
comment:4
Nice. Replying to @yyyyx4:
Where did you read that ? At ellog documentation they say to have a look at znlog documentation. And there it only says that the result is undefined (here I would translate as: algorithm terminates but got garbage) if |
comment:5
In the
However, the documentation also says that rho is only used for "large" sizes, so it seems like we could skip the check for the smaller instances if it's a problem. Overall, the cost of the pairing is negligible anyway (Miller's algorithm is |
comment:6
Does the Weil pairing guarantees colinearity or the fact that Q is a multiple of P ? (not very familiar with EC myself) |
comment:7
More precisely, there could be a denominator issue. The two following questions are different : |
comment:8
You are right that " Modulo a bunch of identifications, the Weil pairing is "just" the determinant pairing: Our points live in a group isomorphic to Thus, the pairing is If we drop the assumption that one of the inputs has full order, we can indeed easily construct counterexamples: |
Reviewer: Vincent Delecroix |
comment:11
|
comment:13
Thanks, good catch. PARI doesn't seem to like pairings over infinite fields. |
comment:14
According to the patchbot (and sage documentation) |
Changed branch from public/use_pari_elllog_and_ellweilpairing to |
PARI/GP implements discrete logarithm on elliptic curves
This should be benchmarked against the native sage implementation
P.discrete_log(400*P)
. If relevant, PARI/GP should be an alternative in the functiondiscrete_log
.This might apply to other functions as well, see PARI/GP elliptic curve reference card.
CC: @yyyyx4
Component: elliptic curves
Author: Lorenz Panny
Branch/Commit:
c7626f6
Reviewer: Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/33121
The text was updated successfully, but these errors were encountered: