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

Added check length #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Added check length #67

wants to merge 1 commit into from

Conversation

Antonio95
Copy link

PCS::check was zipping the commitments, proofs and claimed values. The issue is that zip is happy to combine two vectors of unequal length, in which case it drops off the excess elements from the longer vector. This could be dangerous, since check fails iff any of the individual proof checks fails, but those checks could be missed.

We considered using zip_eq, which panics if the iterators have different length. In the end, we opted for checking the lengths by hand so that we could control the error and return it. Unfortunately, this results in less-than-ideal syntax (but still acceptable), since one can't count an iterator and then iterate over it.

@autquis this is likely also relevant to the Brakedown and Ligero PRs. Let's keep it in mind, even if it's not an urgent fix :)

@autquis
Copy link
Collaborator

autquis commented Jun 14, 2024

Sure! Thanks

@mmagician
Copy link

@Antonio95 how about zip_eq combined with https://doc.rust-lang.org/std/panic/fn.catch_unwind.html ?

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