Documentation ¶
Index ¶
- Constants
- func GetDepthByHeightAndAccLength(height, accLength int64) int
- func GetHeightFromWitness(ws []Witness, accLength int64) int64
- func WitnessesToHashes(w []Witness) [][]byte
- type Accumulator
- func (a *Accumulator) AddData(d []byte) []Witness
- func (a *Accumulator) AddHash(h []byte) []Witness
- func (a *Accumulator) AddNode(n Node) []Witness
- func (a *Accumulator) Flush() error
- func (a *Accumulator) GetNode(idx int64) (Node, error)
- func (a *Accumulator) Len() int64
- func (a *Accumulator) Recover() error
- func (a *Accumulator) String() string
- func (a *Accumulator) Verify(ws []Witness, h []byte) error
- func (a *Accumulator) VerifyWithAccLength(ws []Witness, h []byte, accLength int64) error
- func (a *Accumulator) WitnessFor(idx int64) (w []Witness, err error)
- func (a *Accumulator) WitnessForWithAccLength(idx, accLength int64) (w []Witness, err error)
- type Direction
- type ExtAccumulator
- func (a *ExtAccumulator) AddData(d []byte) []Witness
- func (a *ExtAccumulator) AddHash(h []byte) []Witness
- func (a *ExtAccumulator) AddNode(n Node) []Witness
- func (a *ExtAccumulator) Flush() error
- func (a *ExtAccumulator) GetNode(height int64) (Node, error)
- func (a *ExtAccumulator) Height() int64
- func (a *ExtAccumulator) Offset() int64
- func (a *ExtAccumulator) Recover() error
- func (a *ExtAccumulator) Serialized() []byte
- func (a *ExtAccumulator) VerifyAt(w []Witness, h []byte, at, offset int64) error
- func (a *ExtAccumulator) WitnessForAt(height, at, offset int64) (int64, []Witness, error)
- type Node
- type State
- type Witness
Constants ¶
View Source
const (
HashSize = 32
)
Variables ¶
This section is empty.
Functions ¶
func GetHeightFromWitness ¶
func WitnessesToHashes ¶
Types ¶
type Accumulator ¶
type Accumulator struct { KeyForState []byte // key to recover state Bucket db.Bucket // bucket to store all state data // contains filtered or unexported fields }
func (*Accumulator) AddData ¶
func (a *Accumulator) AddData(d []byte) []Witness
func (*Accumulator) AddHash ¶
func (a *Accumulator) AddHash(h []byte) []Witness
func (*Accumulator) AddNode ¶
func (a *Accumulator) AddNode(n Node) []Witness
func (*Accumulator) Flush ¶
func (a *Accumulator) Flush() error
func (*Accumulator) Len ¶
func (a *Accumulator) Len() int64
func (*Accumulator) Recover ¶
func (a *Accumulator) Recover() error
func (*Accumulator) String ¶
func (a *Accumulator) String() string
func (*Accumulator) VerifyWithAccLength ¶
func (a *Accumulator) VerifyWithAccLength(ws []Witness, h []byte, accLength int64) error
func (*Accumulator) WitnessFor ¶
func (a *Accumulator) WitnessFor(idx int64) (w []Witness, err error)
func (*Accumulator) WitnessForWithAccLength ¶
func (a *Accumulator) WitnessForWithAccLength(idx, accLength int64) (w []Witness, err error)
type ExtAccumulator ¶
type ExtAccumulator struct { Accumulator // contains filtered or unexported fields }
func NewExtAccumulator ¶
func NewExtAccumulator(keyForState []byte, bk db.Bucket, offset int64) *ExtAccumulator
func (*ExtAccumulator) AddData ¶
func (a *ExtAccumulator) AddData(d []byte) []Witness
func (*ExtAccumulator) AddHash ¶
func (a *ExtAccumulator) AddHash(h []byte) []Witness
func (*ExtAccumulator) AddNode ¶
func (a *ExtAccumulator) AddNode(n Node) []Witness
func (*ExtAccumulator) Flush ¶
func (a *ExtAccumulator) Flush() error
func (*ExtAccumulator) Height ¶
func (a *ExtAccumulator) Height() int64
func (*ExtAccumulator) Offset ¶
func (a *ExtAccumulator) Offset() int64
func (*ExtAccumulator) Recover ¶
func (a *ExtAccumulator) Recover() error
func (*ExtAccumulator) Serialized ¶
func (a *ExtAccumulator) Serialized() []byte
func (*ExtAccumulator) VerifyAt ¶
func (a *ExtAccumulator) VerifyAt(w []Witness, h []byte, at, offset int64) error
func (*ExtAccumulator) WitnessForAt ¶
func (a *ExtAccumulator) WitnessForAt(height, at, offset int64) (int64, []Witness, error)
Click to show internal directories.
Click to hide internal directories.