Skip to content
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

Add STARK curve #299

Merged
merged 4 commits into from
Jan 11, 2023
Merged

Add STARK curve #299

merged 4 commits into from
Jan 11, 2023

Conversation

yelhousni
Copy link
Collaborator

Supports only Fp, Fr and G1 arithmetics.
TODO:

  • Optimise field arithmetic given the special form of the moduli
  • Use addchain for Sqrt and Legendre (bug with addchain --> code generation works only when NewField() set with false flag)

  • Code generation for G1 when a!=0 (but not sure we'll add another curve with a!=0)
  • MultiExp? (but not needed for now, maybe for Pedersen hash or batch ECDSA?)

Copy link
Collaborator

@gbotrel gbotrel left a comment

Choose a reason for hiding this comment

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

lgtm 👍
on the TODOs:

  1. addchain works OK with fp. Not fr, I think it's a small bug in addchain but need to write a minimal reproductible test case... (it finds the addition chain for the legendre exponent, but the code generation template fails)
  2. field arithmetic: since q0 == 1, q1 == 0, q2 == 0, many functions can be optimized, but the arithmetic templates are dirty and need some refactoring to allow that cleanly. Probably couple of days work and a good double digit perf boost on the fp.Mul (and consequently all the ecc ops cc @joshklop @omerfirmak )

@omerfirmak
Copy link
Contributor

field arithmetic: since q0 == 1, q1 == 0, q2 == 0, many functions can be optimized, but the arithmetic templates are dirty and need some refactoring to allow that cleanly. Probably couple of days work and a good double digit perf boost on the fp.Mul (and consequently all the ecc ops cc @joshklop @omerfirmak )

Pedersen is still the main bottleneck in our application, so that would be much appreciated if you can find the time. Thank you for all the work so far!

@yelhousni
Copy link
Collaborator Author

Let's merge this and track the field arithmetic optimization in #302

@yelhousni yelhousni merged commit 93fe074 into develop Jan 11, 2023
@yelhousni yelhousni deleted the feat/stark-curve branch January 11, 2023 14:21
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.

None yet

3 participants