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

Improve Circuit trait API and usability #313

Merged
merged 3 commits into from
Oct 5, 2020
Merged

Conversation

CPerezz
Copy link
Contributor

@CPerezz CPerezz commented Oct 5, 2020

The API was not flexible enough and it was forcing us
to repeat a lot of code.

  • Trait now comes with build_pi, gen_proof, compile & verify_proof
    fn's already implemented.
  • It forces the user to implement the getters and setters for the PI
    vector storage.
  • It carries the circuit size already hardcored in it.

We've also defined the method pos() for PublicInput in order to get
quick access to them.

The API was not flexible enough and it was forcing us
to repeat a lot of code.

- Trait now comes with build_pi, gen_proof, compile & verify_proof
fn's already implemented.
- It forces the user to implement the getters and setters for the PI
vector storage.
- It carries the circuit size already hardcored in it.

We've also defined the method pos() for PublicInput in order to get
quick access to them.
@CPerezz CPerezz added API-design area:cryptography anything related to cryptographic primitives, hashing and ZKP labels Oct 5, 2020
Copy link
Contributor

@jules jules left a comment

Choose a reason for hiding this comment

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

Just one typo

src/circuit_builder.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@LukePearson1 LukePearson1 left a comment

Choose a reason for hiding this comment

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

Only one nit.

@@ -34,34 +34,99 @@ impl PublicInput {
PublicInput::AffinePoint(point, _, _) => vec![point.get_x(), point.get_y()],
}
}

/// Returns the positions that of a PublicInput struct
Copy link
Contributor

Choose a reason for hiding this comment

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

'That' left in mistakenly

@CPerezz CPerezz merged commit c900d2c into master Oct 5, 2020
@CPerezz CPerezz deleted the circuit_api_refactor branch October 5, 2020 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:cryptography anything related to cryptographic primitives, hashing and ZKP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants