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

Arkworks integration and ed25519 upgrade #496

Merged
merged 59 commits into from
Jan 18, 2024
Merged

Conversation

annenkov
Copy link
Contributor

@annenkov annenkov commented Jan 4, 2024

Purpose

This PR adds generic adapters (as blanket implementation) to the ArkWorks interfaces. The adapters (with some additional configuration traits) are used to replace the BLS12-381 curve with ArkWorks implementation. In addition to that, ed25519-dalek is upgraded to v2.0, which was previously blocked by the pairing crate and the corresponding BLS implementation (new versions don't expose the target group element type Fp12, preventing from serializing it, see details here).

Changes

  • implement ArkGroup<G> and ArkField<F> wrappers;
  • blanket implementations of the Field and PrimeField traits for ArkField<F>;
  • blanket implementation of the Curve trait ArkGroup<G>;
  • all required trait implementations for the ArkWorks BLS12-381 curve, that replaces the current BLS curve implementation from the pairing crate.
  • upgrade ed25519-dalek signature scheme; the v2.0 API is a bit different, it bundles a secret and verifying (public) key into a signing key and maintains an invariant that the verifying key is always the public key of secret_key; signing does not require passing the verifying key, so it was removed from parameters of the corresponding functions.
  • update FFI function types on the Haskell side to match the changes in the signing API (removed verifing_key parameter)

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 changed the title Arkworks integration and ed25519 update Arkworks integration and ed25519 upgrade Jan 4, 2024
@annenkov annenkov marked this pull request as ready for review January 4, 2024 14:03
@annenkov annenkov self-assigned this Jan 8, 2024
@annenkov annenkov requested a review from tschudid January 8, 2024 13:01
Copy link
Contributor

@hamiidreza hamiidreza 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. I added some suggestions regarding the broken link for the VRF RFC draft version.

@annenkov annenkov requested a review from abizjak January 15, 2024 14:58
@abizjak
Copy link
Member

abizjak commented Jan 16, 2024

@annenkov did you propagate this PR to concordium-client & the node?

rust-src/concordium_base/src/id/constants.rs Outdated Show resolved Hide resolved
@annenkov
Copy link
Contributor Author

@annenkov did you propagate this PR to concordium-client & the node?

Yes, I checked concordium-client and concordium-node can be built with this branch. There are only changes in the signatures of functions used internally.
However, it would make sense to change signatures of the sign function(s). I created an issue for this #501

annenkov and others added 3 commits January 18, 2024 10:49
… the number of chuncks, not from the imput size. Add more tests
…ks.rs

Co-authored-by: eb-concordium <77331975+eb-concordium@users.noreply.github.com>
@annenkov annenkov merged commit a73ba79 into main Jan 18, 2024
40 checks passed
@annenkov annenkov deleted the arkworks-integration branch January 18, 2024 16:08
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.

Use ArkWorks BLS12-381 implementation
4 participants