Skip to content

Implement the elliptic curve group law #545

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

Merged
merged 7 commits into from
Oct 7, 2023
Merged

Conversation

boxdot
Copy link
Contributor

@boxdot boxdot commented Oct 6, 2023

Description

The implementation is done for a finite field of characteristic != 2, 3
and the curve of the form y^2 = x^3 + Ax^2 + B.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I ran bellow commands using the latest version of rust nightly.
  • I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • I ran cargo fmt just before my last commit.
  • I ran cargo test just before my last commit and all tests passed.
  • I checked COUNTRIBUTING.md and my code follows its guidelines.

The implementation is done for a finite field of characteristic != 2, 3
and the curve of the form `y^2 = x^3 + Ax^2 + B`. Also include an
implementation of a finite field of prime order P which is used in
examples and tests.
@boxdot boxdot requested review from siriak and imp2002 as code owners October 6, 2023 18:59
@boxdot
Copy link
Contributor Author

boxdot commented Oct 6, 2023

I am considering to split this PR into two:

  1. Add finite field of prime order implementation.
  2. Add elliptic group law implementation based on 1.

What do you think?

The `Field` trait actually describes any field, not only a field
representable by i64.
@siriak
Copy link
Member

siriak commented Oct 6, 2023

Feel free to split this into 2 PRs. And could you implement Field in a separate file? So that it can be reused for other algorithms

@siriak
Copy link
Member

siriak commented Oct 6, 2023

Ping me when it's time to review

The field trait will allow us to define an elliptic curve over any
field. We provide an implementation of the trait for a prime field of
order `P`, that is, the field isomorpic to the finite field `GF(P) =
ℤ/Pℤ`. This field will be used to define specific elliptic curves.
@boxdot
Copy link
Contributor Author

boxdot commented Oct 7, 2023

Ping me when it's time to review

@siriak The field trait and prime field implementation can be reviewed in #549

@boxdot
Copy link
Contributor Author

boxdot commented Oct 7, 2023

Based on top of #549. Waiting for the latter to be reviewed first.

@boxdot
Copy link
Contributor Author

boxdot commented Oct 7, 2023

Based on top of #549. Waiting for the latter to be reviewed first.

#549 is merged. Now this PR only contains the relevant changes.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@siriak siriak merged commit 9d57491 into TheAlgorithms:master Oct 7, 2023
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.

2 participants