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

VSMT Gadget not working with arbitrary values #9

Open
m0bi5 opened this issue Jan 5, 2022 · 0 comments
Open

VSMT Gadget not working with arbitrary values #9

m0bi5 opened this issue Jan 5, 2022 · 0 comments

Comments

@m0bi5
Copy link

m0bi5 commented Jan 5, 2022

Hi,

I am trying to use the VSMT gadget from your repository. When I build the tree with arbitrary values I get an assertion error. I had a look at the test you have written here - https://github.com/lovesh/bulletproofs-r1cs-gadgets/blob/master/src/gadget_vsmt_2.rs. In the test_VSMT_verif() function you build a tree with values 1..10 (at leaves with index 1..10), however, when I change these values to arbitrary values and when I remove the necessary assertions -

assert_eq!(k, tree.get(k, &mut merkle_proof));         
assert!(tree.verify_proof(k, k, &merkle_proof_vec, None));
assert!(tree.verify_proof(k, k, &merkle_proof_vec, Some(&tree.root)));

the verification of the proof fails (at line assert!(verifier.verify(&proof, &pc_gens, &bp_gens).is_ok());). This is unexpected and strange behavior. When I change the values back to 1...10, everything works as expected. Is there any reason as to why this is happening?

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

No branches or pull requests

1 participant