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

New curve interfaces #484

Merged
merged 50 commits into from
Jan 3, 2024
Merged

New curve interfaces #484

merged 50 commits into from
Jan 3, 2024

Conversation

annenkov
Copy link
Contributor

@annenkov annenkov commented Nov 27, 2023

Purpose

Make the Curve trait and related functionality (e.g. finine field interfaces) better suitable for adding new curve implementations. Add the curve25519 implementation using the updated interface. Add benchmarks of the curve25519 curve with our bulletproof implementation.

Changes

  • add Field and PrimeField traits; the idea is that they contain only what we need and don't have extra dependencies; moreover, we can provide implementation for external type, which was not possible with ff::Field;
  • make it possible to override the generic multiexp algoritm implementation, if a certain curve provides an optimised version;
  • implement Field, PrimeField for the BLS12-381 curve (including a blanket inplementation of Field for any F : ff::Field;
  • implement Field, PrimeField and Curve for The ristretto representation of curve25519-dalek;
  • add benckmarks:
    • multiexp algorithms from curve25519-dalek exposed through our interface (authored by @hamiidreza);
    • range proof performance curve25519;
    • range proof from dalek's bulletproofs (authored by @hamiidreza). (was exluded in the development process)

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • I have updated the CHANGELOG.

@annenkov annenkov marked this pull request as ready for review November 28, 2023 11:56
@abizjak
Copy link
Contributor

abizjak commented Nov 28, 2023

I thought the idea was to have a minimal PR that only does the introduction of new abstractions. This seems to have more, e.g., why is there ark-ff as a new dependency?

@hamiidreza
Copy link
Contributor

Added some minor comments and suggestions. Otherwise, looks good to me.

@annenkov annenkov merged commit d0a76c7 into main Jan 3, 2024
40 checks passed
@annenkov annenkov deleted the new-curves branch January 3, 2024 10:16
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.

4 participants