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 an Absorb trait bound to PCCommitment #144

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mmagician
Copy link
Member

Description

Following Option 2 from #143.

closes: #143


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@mmagician mmagician requested a review from a team as a code owner February 6, 2024 12:27
@mmagician mmagician requested review from z-tech, Pratyush and weikengchen and removed request for a team February 6, 2024 12:27
Cargo.toml Outdated Show resolved Hide resolved
Comment on lines +328 to +334
pub struct Commitment<E>(
/// The commitment is a group element.
pub E::G1Affine,
);
)
where
E: Pairing,
E::G1Affine: Absorb;
Copy link
Member

Choose a reason for hiding this comment

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

Technically, we don't need an Absorb bound on E::G1Affine, only on the PCCommitment impl and on the Absorb impl, right?

Copy link
Member

Choose a reason for hiding this comment

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

That would avoid most of this churn I think

Copy link
Member Author

Choose a reason for hiding this comment

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

If I restrict PCCommitment: Absorb, then I also have to ensure any struct which implements PCCommitment also implements Absorb - and so I need to restrict E::G1Affine etc. to also be Absorb.
Let me know if you have another idea for this, I currently can't see a better workaround.

@@ -178,7 +179,7 @@ impl<'a, F: Field, P: Polynomial<F>> LabeledPolynomial<F, P> {
}

/// A commitment along with information about its degree bound (if any).
#[derive(Clone)]
Copy link
Member Author

Choose a reason for hiding this comment

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

@Pratyush If I'm not deriving Absorb, what about the degree_bound? I would assume this doesn't need to get absorbed.

@mmagician mmagician requested a review from Pratyush February 27, 2024 13:32
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.

Add Absorb trait bound on PCCommitment
2 participants