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

feat: [PLONK_AUDIT_4-8] fixes #743 #744

Merged
merged 2 commits into from
Jul 4, 2023
Merged

Conversation

ThomasPiellard
Copy link
Collaborator

the openings (= values) of the proof commitments are ensured to be below r_mod : fixes #743

Copy link

@DavePearce DavePearce 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, though see comments below about proof_quotient_polynomial_at_zeta and proof_linearised_polynomial_at_zeta.

Also, I tried to work through whether any of the other components of the proof need to be checked to be < p_mod. As far as I can tell, any digressionis are caught by the precompile contracts for BN_ADD and BN_MUL which revert if points are not on the curve. So, that seems OK to me.

@@ -607,12 +607,54 @@ contract PlonkVerifier {

}

function check_proof_openings_size(bytes memory proof)
Copy link

@DavePearce DavePearce Jul 3, 2023

Choose a reason for hiding this comment

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

Looks good, though am wondering whether you also need a check for proof_linearised_polynomial_at_zeta. My reasoning is that this is passed as a parameter into fr_acc_mul() within fold_state, and all of the others passed into fr_acc_mul within fold_state are checked.

Looking at the Gnark code (and the provided README for the audit) I see that both proof_quotient_polynomial_at_zeta and proof_linearised_polynomial_at_zeta correspond to BatchedProof.ClaimedValues[0:2] which are typed as fr.Element. That makes me think both should be checked ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah right 👍 I don't know what I didn't check them... I'm adding the checks for the those 2 values

@ThomasPiellard ThomasPiellard requested review from ivokub and removed request for gbotrel July 4, 2023 09:46
Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

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

Range checks look good. I don't know Solidity syntax enough to confirm that the implementation is correct, but the logic looks good.

@ThomasPiellard ThomasPiellard merged commit d016813 into develop Jul 4, 2023
@ThomasPiellard ThomasPiellard deleted the fix/plonk_audit_4-8 branch July 4, 2023 12:33
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