sparse

package
v0.0.0-...-02c3ccb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HashSize contains the blocksize of the used hash function in bytes.
	HashSize = sha512.Size256
	// IndexLen is the maximum number of levels in this Merkle Tree.
	IndexLen = HashSize * 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash [HashSize]byte

Hash represents the output of the hash function used in the sparse tree.

func FromBytes

func FromBytes(b []byte) Hash

FromBytes initializes a Hash object from a byte slice.

func NodeValues

func NodeValues(mapID int64, hasher TreeHasher, bindex string, value []byte, nbrValues []Hash) []Hash

NodeValues computes the new values for leafs up the tree. nbrValues must not be compressed. value is the actual value of the leaf. NodeValues returns the leaf hash as part of the returned list.

func (Hash) Bytes

func (h Hash) Bytes() []byte

Bytes returns a byte slice from a Hash object.

type TreeHasher

type TreeHasher interface {
	HashLeaf(mapID int64, index []byte, depth int, dataHash []byte) Hash
	HashInterior(left, right Hash) Hash
	HashEmpty(mapID int64, index []byte, depth int) Hash
}

TreeHasher provides hash functions for tree implementations.

var CONIKSHasher TreeHasher = &coniks{}

CONIKSHasher implements the tree hashes described in CONIKS http://www.jbonneau.com/doc/MBBFF15-coniks.pdf

Directories

Path Synopsis
Package verifier allows client to verify a tree proof.
Package verifier allows client to verify a tree proof.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL