Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckProofType ¶
func SetChunkSize ¶
func VerifyCompactMultiProof ¶
func VerifyCompactMultiProof(element, seedValue []byte, multiproof *CompactMultiProof, root [32]byte, bf BloomFilter) (bool, error)
VerifyCompactMultiProof return whether the multi proof provided is true or false. The proof type can be absence or presence
Types ¶
type BloomFilter ¶
type BloomTree ¶
type BloomTree struct {
// contains filtered or unexported fields
}
BloomTree represents the bloom tree struct.
func NewBloomTree ¶
func NewBloomTree(b BloomFilter) (*BloomTree, error)
NewBloomTree creates a new bloom tree.
func (*BloomTree) GenerateCompactMultiProof ¶
func (bt *BloomTree) GenerateCompactMultiProof(elem []byte) (*CompactMultiProof, error)
GenerateCompactMultiProof returns a compact multiproof to verify the presence, or absence of an element in a bloom tree.
func (*BloomTree) GetBloomFilter ¶
func (bt *BloomTree) GetBloomFilter() BloomFilter
type CompactMultiProof ¶
type CompactMultiProof struct { // Chunks are the leaves of the bloom tree, i.e. the bloom filter values for given parts of the bloom filter. Chunks [][32]byte // Proof are the hashes needed to reconstruct the bloom tree root. Proof [][32]byte // ProofType is 255 if the element is present in the bloom filter. it returns the index of the index if the element is not present in the bloom filter. ProofType uint8 }
Click to show internal directories.
Click to hide internal directories.