CommitmentTree.Spec (Anoma v0.34.0)

A specification for a commitment tree.

Summary

Types

A type of possible merkle tree hashes currently supported.

t()

Functions

I take an atom representation of the hash function used for the merkle tree and turn it into the appropriate function.

Types

accumulator_hash()

@type accumulator_hash() :: :sha256 | :poseidon

A type of possible merkle tree hashes currently supported.

t()

@type t() :: %CommitmentTree.Spec{
  depth: integer(),
  hash: accumulator_hash(),
  key_size: integer(),
  key_zero: binary(),
  splay: integer(),
  splay_suff_prod: [integer()]
}

Functions

cairo_poseidon_cm_tree_spec()

@spec cairo_poseidon_cm_tree_spec() :: t()

cairo_poseidon_resource_tree_spec()

@spec cairo_poseidon_resource_tree_spec() :: t()

cm_tree_spec()

@spec cm_tree_spec() :: t()

from_noun(list)

@spec from_noun(Noun.t()) :: :error | {:ok, t()} | :error

hash_ref_to_hash(atom)

@spec hash_ref_to_hash(accumulator_hash()) :: function()

I take an atom representation of the hash function used for the merkle tree and turn it into the appropriate function.

new(depth, splay, key_size, hash)

@spec new(integer(), integer(), integer(), accumulator_hash()) :: t()