Documentation ¶
Index ¶
- Constants
- type Hasher
- func (t *Hasher) ComputeProof(blockIDs iotago.BlockIDs, blockID iotago.BlockID) (*Proof, error)
- func (t *Hasher) ComputeProofForIndex(blockIDs iotago.BlockIDs, index int) (*Proof, error)
- func (t *Hasher) EmptyRoot() []byte
- func (t *Hasher) Hash(data [][]byte) []byte
- func (t *Hasher) HashBlockIDs(blockIDs iotago.BlockIDs) []byte
- func (t *Hasher) Size() int
- type Proof
Constants ¶
View Source
const ( LeafHashPrefix = 0 NodeHashPrefix = 1 )
Domain separation prefixes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hasher ¶
type Hasher struct {
// contains filtered or unexported fields
}
Hasher implements the hashing algorithm described in the IOTA protocol RFC-12.
func (*Hasher) ComputeProof ¶
ComputeProof computes the audit path given the blockIDs and the blockID we want to create the inclusion proof for.
func (*Hasher) ComputeProofForIndex ¶
ComputeProofForIndex computes the audit path given the blockIDs and the index of the blockID we want to create the inclusion proof for.
func (*Hasher) EmptyRoot ¶
EmptyRoot returns a special case for an empty tree. This is equivalent to Hash(nil).
func (*Hasher) HashBlockIDs ¶
HashBlockIDs computes the Merkle tree hash of the provided BlockIDs.
type Proof ¶
type Proof struct { Left hashable Right hashable }
func (*Proof) MarshalJSON ¶
func (*Proof) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.