Package

scorex.crypto.authds

merkle

Permalink

package merkle

Visibility
  1. Public
  2. All

Type Members

  1. case class EmptyNode[D <: Digest]()(implicit hf: CryptographicHash[D]) extends Node[D] with Product with Serializable

    Permalink

    Empty Merkle tree node.

    Empty Merkle tree node. Either Leaf (if number of non-empty leafs is not a power of 2, remaining leafs are EmptyNode) or InternalNode (if both childs of an InternalNode are empty, it is EmptyNode)

    D

    - hash function application type

    hf

    - hash function

  2. case class EmptyRootNode[D <: Digest]()(implicit hf: CryptographicHash[D]) extends Node[D] with Product with Serializable

    Permalink

    Empty root node.

    Empty root node. If the tree contains no elements, it's root hash is array of 0 bits of a hash function digest length

    D

    - hash function application type

    hf

    - hash function

  3. case class InternalNode[D <: Digest](left: Node[D], right: Node[D])(implicit hf: CryptographicHash[D]) extends Node[D] with Product with Serializable

    Permalink

    Internal node in Merkle tree

    Internal node in Merkle tree

    D

    - hash function application type

    left

    - left child. always non-empty

    right

    - right child. can be emptyNode

    hf

    - hash function

  4. case class Leaf[D <: Digest](data: LeafData)(implicit hf: CryptographicHash[D]) extends Node[D] with Product with Serializable

    Permalink

    Merkle tree leaf

    Merkle tree leaf

    D

    - hash function application type

    data

    - leaf data.

    hf

    - hash function

  5. case class MerkleProof[D <: Digest](leafData: LeafData, levels: Seq[(Digest, Side)])(implicit hf: CryptographicHash[D]) extends ScorexEncoding with Product with Serializable

    Permalink

    Proof is given leaf data, leaf hash sibling and also siblings for parent nodes.

    Proof is given leaf data, leaf hash sibling and also siblings for parent nodes. Using this data, it is possible to compute nodes on the path to root hash, and the hash itself. The picture of a proof given below. In the picture, "^^" is leaf data(to compute leaf hash from), "=" values are to be computed, "*" values are to be stored.

    ........= Root ..... / \ .... * = ....... / \ ...... * = ......... /.\ .........* = ............ ^^

    leafData

    - leaf data bytes

    levels

    - levels in proof, bottom up, each level is about stored value and position of computed element (whether it is left or right to stored value)

  6. case class MerkleTree[D <: Digest](topNode: Node[D], elementsHashIndex: Map[ofByte, Int]) extends Product with Serializable

    Permalink
  7. trait Node[D <: Digest] extends ScorexEncoding

    Permalink

Value Members

  1. object MerkleProof extends Serializable

    Permalink
  2. object MerkleTree extends Serializable

    Permalink
  3. package sparse

    Permalink

Ungrouped