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

panic if verifying with incorrect leaf count #20

Closed
themighty1 opened this issue Feb 13, 2023 · 2 comments · Fixed by #28
Closed

panic if verifying with incorrect leaf count #20

themighty1 opened this issue Feb 13, 2023 · 2 comments · Fixed by #28

Comments

@themighty1
Copy link
Contributor

When verifying a proof, we rely on the Prover (a potentially malicious party in our case) to inform the Verifier about the correct number of the leaves in the tree. Trying to verify with an incorrect number causes a panic.

Can be reproduced by modifying a line in this example:

/// assert!(proof.verify(root, &indices_to_prove, leaves_to_prove, leaves.len()));

and changing the last arg to leaves.len() + 100

@antouhou
Copy link
Owner

Thank you for the report, I'll look into it!

@antouhou
Copy link
Owner

Hi @themighty1! The issue has been fixed in the release 1.4.1 Thanks!

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 a pull request may close this issue.

2 participants