identity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash []byte

Hash ...

type IdPathElement

type IdPathElement struct {
	// contains filtered or unexported fields
}

func NewIdPathElement

func NewIdPathElement(t *TreeContent) *IdPathElement

func (*IdPathElement) BigInt

func (i *IdPathElement) BigInt() *big.Int

func (*IdPathElement) Content

func (i *IdPathElement) Content() TreeContent

func (*IdPathElement) Equal

func (i *IdPathElement) Equal(oth IdPathElement) bool

func (*IdPathElement) Hex

func (i *IdPathElement) Hex() string

func (*IdPathElement) String

func (i *IdPathElement) String() string

type Identity

type Identity string

Identity ...

func NewIdentity

func NewIdentity(commitment string) *Identity

NewIdentity ...

func NewIdentityFromBytes

func NewIdentityFromBytes(bytes []byte) *Identity

NewIdentityFromBytes ...

func (*Identity) Byte

func (id *Identity) Byte() []byte

Byte ...

func (*Identity) Equal

func (id *Identity) Equal(othID *Identity) bool

Equal .

func (*Identity) Hex

func (id *Identity) Hex() string

Hex ...

func (Identity) PathElement

func (id Identity) PathElement() *IdPathElement

PathElement ...

func (*Identity) String

func (id *Identity) String() string

String ...

type MerkleTree

type MerkleTree struct {
	// contains filtered or unexported fields
}

MerkleTree ...

func NewMerkleTree

func NewMerkleTree(levels uint8) (*MerkleTree, error)

NewMerkleTree ...

func (*MerkleTree) GetAllContent

func (m *MerkleTree) GetAllContent() []*TreeContent

GetAllContent .

func (*MerkleTree) GetIndexByValue

func (m *MerkleTree) GetIndexByValue(value *TreeContent) int

GetIndexByValue .

func (*MerkleTree) GetIntermediateValues

func (m *MerkleTree) GetIntermediateValues(value *TreeContent) ([]*TreeContent, []int, *TreeContent)

GetIntermediateValues : get all intermediate values of a leaf

func (*MerkleTree) GetPath

func (m *MerkleTree) GetPath(value *TreeContent) []byte

GetPath : get merkle path of a leaf

func (*MerkleTree) GetRoot

func (m *MerkleTree) GetRoot() *TreeContent

GetRoot : get current merkle root

func (*MerkleTree) Insert

func (m *MerkleTree) Insert(value *TreeContent) (int, error)

Insert : insert into to the merkle tree

func (*MerkleTree) IsExisted

func (m *MerkleTree) IsExisted(value *TreeContent) bool

IsExisted ...

func (*MerkleTree) Len

func (m *MerkleTree) Len() int

Len .

func (*MerkleTree) Update

func (m *MerkleTree) Update(index uint, oldValue, newValue *TreeContent) error

Update : update a leaf of this merkle tree

type Set

type Set map[Identity]string

Set ...

func NewSet

func NewSet() Set

NewSet ...

type TreeContent

type TreeContent struct {
	// contains filtered or unexported fields
}

TreeContent ...

func NewTreeContent

func NewTreeContent(value *big.Int) *TreeContent

func (TreeContent) BigInt

func (t TreeContent) BigInt() *big.Int

func (TreeContent) Bytes

func (t TreeContent) Bytes() []byte

func (TreeContent) CalculateHash

func (t TreeContent) CalculateHash() ([]byte, error)

CalculateHash hashes the values of a TreeContent

func (TreeContent) Equals

func (t TreeContent) Equals(other merkletree.Content) (bool, error)

Equals tests for equality of two Contents

func (TreeContent) Hex

func (t TreeContent) Hex() string

func (TreeContent) String

func (t TreeContent) String() string

Jump to

Keyboard shortcuts

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