Versions in this module Expand all Collapse all v0 v0.1.4 Jun 10, 2024 Changes in this version + var ErrBytesLength = fmt.Errorf("bytes array does not have the correct length") + var ErrEmptyBitlist = fmt.Errorf("bitlist is empty") + var ErrIncorrectByteSize = fmt.Errorf("incorrect byte size") + var ErrIncorrectListSize = fmt.Errorf("incorrect list size") + var ErrInvalidVariableOffset = fmt.Errorf(...) + var ErrListTooBig = fmt.Errorf("list length is higher than max value") + var ErrOffset = fmt.Errorf("incorrect offset") + var ErrSize = fmt.Errorf("incorrect size") + var ErrVectorLength = fmt.Errorf("vector does not have the correct length") + func CalculateLimit(maxCapacity, numItems, size uint64) uint64 + func DecodeDynamicLength(buf []byte, maxSize int) (int, error) + func DivideInt(a, b int) (int, bool) + func DivideInt2(a, b, max int) (int, error) + func ErrBytesLengthFn(name string, found, expected int) error + func ErrListTooBigFn(name string, found, max int) error + func ErrVectorLengthFn(name string, found, expected int) error + func ExtendUint16(b []uint16, needLen int) []uint16 + func ExtendUint32(b []uint32, needLen int) []uint32 + func ExtendUint64(b []uint64, needLen int) []uint64 + func ExtendUint8(b []uint8, needLen int) []uint8 + func HashWithDefaultHasher(v HashRoot) ([32]byte, error) + func MarshalBool(dst []byte, b bool) []byte + func MarshalSSZ(m Marshaler) ([]byte, error) + func MarshalTime(dst []byte, t time.Time) []byte + func MarshalUint16(dst []byte, i uint16) []byte + func MarshalUint32(dst []byte, i uint32) []byte + func MarshalUint64(dst []byte, i uint64) []byte + func MarshalUint8(dst []byte, i uint8) []byte + func ReadOffset(buf []byte) uint64 + func UnmarshalBool(src []byte) bool + func UnmarshalDynamic(src []byte, length int, f func(indx int, b []byte) error) error + func UnmarshalSSZTest(content []byte, result interface{}) error + func UnmarshalTime(src []byte) time.Time + func UnmarshallUint16(src []byte) uint16 + func UnmarshallUint32(src []byte) uint32 + func UnmarshallUint64(src []byte) uint64 + func UnmarshallUint8(src []byte) uint8 + func ValidateBitlist(buf []byte, bitLimit uint64) error + func VerifyMultiproof(root []byte, proof [][]byte, leaves [][]byte, indices []int) (bool, error) + func VerifyProof(root []byte, proof *Proof) (bool, error) + func WriteOffset(dst []byte, i int) []byte + type CompressedMultiproof struct + Hashes [][]byte + Indices []int + Leaves [][]byte + ZeroLevels []int + func (c *CompressedMultiproof) Decompress() *Multiproof + type HashFn func(dst []byte, input []byte) error + func NativeHashWrapper(hashFn hash.Hash) HashFn + type HashRoot interface + GetTree func() (*Node, error) + HashTreeRoot func() ([32]byte, error) + HashTreeRootWith func(hh HashWalker) error + type HashWalker interface + Append func(i []byte) + AppendBytes32 func(b []byte) + AppendUint32 func(i uint32) + AppendUint64 func(i uint64) + AppendUint8 func(i uint8) + FillUpTo32 func() + Hash func() []byte + Index func() int + Merkleize func(indx int) + MerkleizeWithMixin func(indx int, num, limit uint64) + PutBitlist func(bb []byte, maxSize uint64) + PutBool func(b bool) + PutBytes func(b []byte) + PutUint16 func(i uint16) + PutUint32 func(i uint32) + PutUint64 func(i uint64) + PutUint64Array func(b []uint64, maxCapacity ...uint64) + PutUint8 func(i uint8) + type Hasher struct + func NewHasher() *Hasher + func NewHasherWithHash(hh hash.Hash) *Hasher + func NewHasherWithHashFn(hh HashFn) *Hasher + func (h *Hasher) Append(i []byte) + func (h *Hasher) AppendBytes32(b []byte) + func (h *Hasher) AppendUint32(i uint32) + func (h *Hasher) AppendUint64(i uint64) + func (h *Hasher) AppendUint8(i uint8) + func (h *Hasher) FillUpTo32() + func (h *Hasher) Hash() []byte + func (h *Hasher) HashRoot() (res [32]byte, err error) + func (h *Hasher) Index() int + func (h *Hasher) Merkleize(indx int) + func (h *Hasher) MerkleizeWithMixin(indx int, num, limit uint64) + func (h *Hasher) PutBitlist(bb []byte, maxSize uint64) + func (h *Hasher) PutBool(b bool) + func (h *Hasher) PutBytes(b []byte) + func (h *Hasher) PutRootVector(b [][]byte, maxCapacity ...uint64) error + func (h *Hasher) PutUint16(i uint16) + func (h *Hasher) PutUint32(i uint32) + func (h *Hasher) PutUint64(i uint64) + func (h *Hasher) PutUint64Array(b []uint64, maxCapacity ...uint64) + func (h *Hasher) PutUint8(i uint8) + func (h *Hasher) Reset() + type HasherPool struct + var DefaultHasherPool HasherPool + func (hh *HasherPool) Get() *Hasher + func (hh *HasherPool) Put(h *Hasher) + type Marshaler interface + MarshalSSZ func() ([]byte, error) + MarshalSSZTo func(dst []byte) ([]byte, error) + SizeSSZ func() int + type Multiproof struct + Hashes [][]byte + Indices []int + Leaves [][]byte + func (p *Multiproof) Compress() *CompressedMultiproof + type Node struct + func EmptyLeaf() *Node + func LeafFromBool(b bool) *Node + func LeafFromBytes(b []byte) *Node + func LeafFromUint16(i uint16) *Node + func LeafFromUint32(i uint32) *Node + func LeafFromUint64(i uint64) *Node + func LeafFromUint8(i uint8) *Node + func LeavesFromUint64(items []uint64) []*Node + func NewEmptyNode(zeroOrderHash []byte) *Node + func NewNodeWithLR(left, right *Node) *Node + func NewNodeWithValue(value []byte) *Node + func ProofTree(v HashRoot) (*Node, error) + func TreeFromChunks(chunks [][]byte) (*Node, error) + func TreeFromNodes(leaves []*Node, limit int) (*Node, error) + func TreeFromNodesWithMixin(leaves []*Node, num, limit int) (*Node, error) + func (n *Node) Get(index int) (*Node, error) + func (n *Node) Hash() []byte + func (n *Node) Prove(index int) (*Proof, error) + func (n *Node) ProveMulti(indices []int) (*Multiproof, error) + func (n *Node) Show(maxDepth int) + type Proof struct + Hashes [][]byte + Index int + Leaf []byte + type Unmarshaler interface + UnmarshalSSZ func(buf []byte) error + type Wrapper struct + func (w *Wrapper) AddBytes(b []byte) + func (w *Wrapper) AddEmpty() + func (w *Wrapper) AddNode(n *Node) + func (w *Wrapper) AddUint16(i uint16) + func (w *Wrapper) AddUint32(i uint32) + func (w *Wrapper) AddUint64(i uint64) + func (w *Wrapper) AddUint8(i uint8) + func (w *Wrapper) Append(i []byte) + func (w *Wrapper) AppendBytes32(b []byte) + func (w *Wrapper) AppendUint32(i uint32) + func (w *Wrapper) AppendUint64(i uint64) + func (w *Wrapper) AppendUint8(i uint8) + func (w *Wrapper) Commit(i int) + func (w *Wrapper) CommitWithMixin(i, num, limit int) + func (w *Wrapper) FillUpTo32() + func (w *Wrapper) Hash() []byte + func (w *Wrapper) Index() int + func (w *Wrapper) Merkleize(indx int) + func (w *Wrapper) MerkleizeWithMixin(indx int, num, limit uint64) + func (w *Wrapper) Node() *Node + func (w *Wrapper) PutBitlist(bb []byte, maxSize uint64) + func (w *Wrapper) PutBool(b bool) + func (w *Wrapper) PutBytes(b []byte) + func (w *Wrapper) PutUint16(i uint16) + func (w *Wrapper) PutUint32(i uint32) + func (w *Wrapper) PutUint64(i uint64) + func (w *Wrapper) PutUint64Array(b []uint64, maxCapacity ...uint64) + func (w *Wrapper) PutUint8(i uint8)