mirror of
https://github.com/arnaucube/arbo.git
synced 2026-01-17 02:31:28 +01:00
Add Tree Circom Verifier Proofs
Circom Verifier Proofs allow to verify through a zkSNARK proof the inclusion/exclusion of a leaf in a tree. This commit adds the needed code in go to generate the circuit inputs for a CircomVerifierProof.
This commit is contained in:
@@ -305,9 +305,11 @@ func TestGenProofAndVerify(t *testing.T) {
|
||||
|
||||
k := BigIntToBytes(bLen, big.NewInt(int64(7)))
|
||||
v := BigIntToBytes(bLen, big.NewInt(int64(14)))
|
||||
proofV, siblings, err := tree.GenProof(k)
|
||||
kAux, proofV, siblings, existence, err := tree.GenProof(k)
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(proofV, qt.DeepEquals, v)
|
||||
c.Assert(k, qt.DeepEquals, kAux)
|
||||
c.Assert(existence, qt.IsTrue)
|
||||
|
||||
verif, err := CheckProof(tree.hashFunction, k, v, tree.Root(), siblings)
|
||||
c.Assert(err, qt.IsNil)
|
||||
|
||||
Reference in New Issue
Block a user