Struct simplicity::FirstPassImr
source · pub struct FirstPassImr(/* private fields */);Expand description
Identity Merkle root (first pass)
A Merkle root that commits to a node’s combinator, its witness data (if present),
and recursively its children. Used as input to the Imr type which is probably
actually what you want.
Implementations§
source§impl FirstPassImr
impl FirstPassImr
sourcepub fn update(self, left: Self, right: Self) -> Self
pub fn update(self, left: Self, right: Self) -> Self
Extend the given tagged hash by the given left and right hashes.
The hash self is taken as initial value,
left and right hash are combined to create a 512-bit block,
and the compression function is run once
sourcepub fn update_1(self, right: Self) -> Self
pub fn update_1(self, right: Self) -> Self
Extend the given tagged hash by 256 bits of zeroes and the right hash.
The hash self is taken as initial value,
256 bits of zeroes and right hash are combined to create a 512-bit block,
and the compression function is run once
sourcepub fn update_with_weight(self, left_weight: u64, right: Self) -> Self
pub fn update_with_weight(self, left_weight: u64, right: Self) -> Self
Updates the given tagged hash with given left cost and right hash.
The cost is serialized as the last 64 bits in the left block
pub fn update_fail_entropy(self, entropy: FailEntropy) -> Self
sourcepub fn from_byte_array(data: [u8; 32]) -> Self
pub fn from_byte_array(data: [u8; 32]) -> Self
Converts the given tagged hash into a byte array
sourcepub fn to_byte_array(self) -> [u8; 32]
pub fn to_byte_array(self) -> [u8; 32]
Converts the given tagged hash into a byte array
source§impl FirstPassImr
impl FirstPassImr
sourcepub fn injl(child: FirstPassImr) -> Self
pub fn injl(child: FirstPassImr) -> Self
Produce a CMR for an injl combinator
sourcepub fn injr(child: FirstPassImr) -> Self
pub fn injr(child: FirstPassImr) -> Self
Produce a CMR for an injr combinator
sourcepub fn take(child: FirstPassImr) -> Self
pub fn take(child: FirstPassImr) -> Self
Produce a CMR for a take combinator
sourcepub fn drop(child: FirstPassImr) -> Self
pub fn drop(child: FirstPassImr) -> Self
Produce a CMR for a drop combinator
sourcepub fn comp(left: FirstPassImr, right: FirstPassImr) -> Self
pub fn comp(left: FirstPassImr, right: FirstPassImr) -> Self
Produce a CMR for a comp combinator
sourcepub fn case(left: FirstPassImr, right: FirstPassImr) -> Self
pub fn case(left: FirstPassImr, right: FirstPassImr) -> Self
Produce a CMR for a case combinator
sourcepub fn pair(left: FirstPassImr, right: FirstPassImr) -> Self
pub fn pair(left: FirstPassImr, right: FirstPassImr) -> Self
Produce a CMR for a pair combinator
sourcepub fn disconnect(left: FirstPassImr, right: FirstPassImr) -> Self
pub fn disconnect(left: FirstPassImr, right: FirstPassImr) -> Self
Produce a CMR for a disconnect combinator
sourcepub fn witness(ty: &FinalArrow, value: &Value) -> Self
pub fn witness(ty: &FinalArrow, value: &Value) -> Self
Produce a CMR for a witness combinator
sourcepub fn fail(entropy: FailEntropy) -> Self
pub fn fail(entropy: FailEntropy) -> Self
Produce an IMR for a fail combinator
sourcepub fn const_word(v: &Value) -> Self
pub fn const_word(v: &Value) -> Self
Compute the CMR of a constant word jet
This is equal to the IMR of the equivalent scribe, converted to a CMR in the usual way for jets.
Trait Implementations§
source§impl AsRef<[u8]> for FirstPassImr
impl AsRef<[u8]> for FirstPassImr
source§impl Clone for FirstPassImr
impl Clone for FirstPassImr
source§fn clone(&self) -> FirstPassImr
fn clone(&self) -> FirstPassImr
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for FirstPassImr
impl Debug for FirstPassImr
source§impl Display for FirstPassImr
impl Display for FirstPassImr
source§impl From<Cmr> for FirstPassImr
impl From<Cmr> for FirstPassImr
source§impl FromStr for FirstPassImr
impl FromStr for FirstPassImr
source§impl Hash for FirstPassImr
impl Hash for FirstPassImr
source§impl Ord for FirstPassImr
impl Ord for FirstPassImr
source§fn cmp(&self, other: &FirstPassImr) -> Ordering
fn cmp(&self, other: &FirstPassImr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for FirstPassImr
impl PartialEq for FirstPassImr
source§fn eq(&self, other: &FirstPassImr) -> bool
fn eq(&self, other: &FirstPassImr) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for FirstPassImr
impl PartialOrd for FirstPassImr
source§fn partial_cmp(&self, other: &FirstPassImr) -> Option<Ordering>
fn partial_cmp(&self, other: &FirstPassImr) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more