Skip to content

Add STARK curve#299

Merged
yelhousni merged 4 commits into
developfrom
feat/stark-curve
Jan 11, 2023
Merged

Add STARK curve#299
yelhousni merged 4 commits into
developfrom
feat/stark-curve

Conversation

@yelhousni
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

3 participants