Skip to content

ec: implement double-odd curves #986

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rubdos
Copy link
Contributor

@rubdos rubdos commented May 19, 2025

Implements Thomas Pornin's “A Prime-Order Group with Complete Formulas from Even-Order Elliptic Curves” [1], often referred to as "double odd" curves.

Includes the double-odd curve “JQ255s” as presented in the paper.

[1] T. Pornin, “A Prime-Order Group with Complete Formulas from Even-Order Elliptic Curves,” IACR CiC, vol. 1, no. 1, p. 33, Apr. 2024, doi: 10.62056/akmp-4c2h.

This is work by @Tarinn

Description

closes: #490


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

@rubdos rubdos requested review from a team as code owners May 19, 2025 11:30
@rubdos rubdos requested review from Pratyush, mmagician and weikengchen and removed request for a team May 19, 2025 11:30
@rubdos
Copy link
Contributor Author

rubdos commented May 19, 2025

As a side note: I recall a discussion on Discord where there was a parameter dump for a DO curve that embeds Curve25519, but I don't have the link at hand. Here are the SW parameters:

a = 57259562424833564022627223828891588493930540394420821089419290001039534118212
b = 64131260960803756922173133202372554928955727810351288169387335111902918457126
|F_q| = p = 115792089237316195423570985008687907853682756971699735333147980285963064639179

Copy link
Member

@Pratyush Pratyush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Left some comments!

);

fn double_in_place(&mut self) -> &mut Self {
self.z = -P::get_c().double() * self.t.square(); // Self.z == -2cT^2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a link/reference to the algorithm being implemented here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this link suffice?

@rubdos
Copy link
Contributor Author

rubdos commented May 23, 2025

Pushed a few fixups, will discuss the rest with @Tarinn when we both have time at the office! Thanks for the review so far.

@rubdos rubdos force-pushed the double-odd-public branch 4 times, most recently from 19b1822 to e084df6 Compare May 28, 2025 12:51
Robrecht and others added 2 commits May 28, 2025 15:34
Implements Thomas Pornin's “A Prime-Order Group with Complete Formulas
from Even-Order Elliptic Curves” [1], often referred to as "double odd"
curves.

Includes the double-odd curve “JQ255s” as presented in the paper.

[1] T. Pornin, “A Prime-Order Group with Complete Formulas from Even-Order Elliptic Curves,” IACR CiC, vol. 1, no. 1, p. 33, Apr. 2024, doi: 10.62056/akmp-4c2h.
@rubdos rubdos force-pushed the double-odd-public branch from e084df6 to 7564ed8 Compare May 28, 2025 13:34
@rubdos rubdos requested a review from Pratyush May 28, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement double-odd curves
2 participants