Module penumbra_tct::internal::hash

source ·
Available on crate feature internal only.
Expand description

The core Hash type, which is used internally to represent hashes, the GetHash trait for computing and caching hashes of things, and the CachedHash type, which is used internally for lazy evaluation of hashes.

Structs§

  • An Mutex-based cache for hashes, to prevent repeated computation.
  • A version tracking when a particular piece of the tree was explicitly forgotten.
  • The hash of an individual [Commitment] or internal node in the tree.
  • A representation of Option<Hash> without the tag bytes required by Option, because we know that no valid Hash will be equal to [u64::MAX; 4], since the modulus for Commitment is too small.

Statics§

  • The domain separator used for leaves in the tree, and used as a base index for the domain separators of nodes in the tree (nodes get a domain separator of the form DOMAIN_SEPARATOR + HEIGHT).

Traits§

  • A type which can be transformed into a Hash, either by retrieving a cached hash, computing a hash for it, or some combination of both.