lovesh/bulletproofs-r1cs-gadgets

VSMT Gadget not working with arbitrary values

m0bi5 opened this issue · 0 comments

m0bi5 commented

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?