Documentation ¶
Overview ¶
Package merkle provides a ZKP-circuit function to verify merkle proofs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MerkleProof ¶
type MerkleProof struct { // RootHash root of the Merkle tree RootHash frontend.Variable // Path path of the Merkle proof Path []frontend.Variable }
MerkleProof stores the path, the root hash and an helper for the Merkle proof.
func (*MerkleProof) VerifyProof ¶
func (mp *MerkleProof) VerifyProof(api frontend.API, h hash.FieldHasher, leaf frontend.Variable)
VerifyProof takes a Merkle root, a proofSet, and a proofIndex and returns true if the first element of the proof set is a leaf of data in the Merkle root. False is returned if the proof set or Merkle root is nil, and if 'numLeaves' equals 0.
Click to show internal directories.
Click to hide internal directories.