-
Notifications
You must be signed in to change notification settings - Fork 236
Implement Curve448
with full coordinates
#1291
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
Conversation
cff6e6f
to
1ecf9f9
Compare
ExtendedMontgomeryPoint
Curve448
with full coordinates
0ad5214
to
0d64e73
Compare
I just stumbled on "Faster Complete Addition Laws for MontgomeryCurves" and will be looking into that. |
I'm going to leave this to a future somebody to look into. |
I found a bug in the current implementation of Montgomery scalar multiplication. It is possible to switch our differential addition and double algorithm to not assume Z=1, which would save us the initial invert operation (normalization). But it adds one extra multiplication, so one inversion at the start of our scalar multiplication is probably cheaper then 448 multiplications. |
5562992
to
a81e01d
Compare
Paper: Complete Addition Law for Montgomery Curves
Closing this in favor of splitting it into multiple smaller PRs. |
This PR implements a set of types for Montgomery points with a full coordinate system and corresponding
Curve448
type with aCurveArithmetic
implementation. Our currentMontgomeryPoint
x-coordinate only remains in place for use withX448
and is renamed toMontgomeryXpoint
.For context: the x-only coordinate system obviously has a lot of missing information to properly implement a full set of arithmetic operations. Crucially, while the y-coordinate could be recovered, it is costly and is missing the sign. Some protocols exist that set the sign of the y-coordinate, which is why we have some methods in place for
MontgomeryXpoint
to do exactly that.I made sure to add a full set of conversion methods between the new types.