pub struct Imr(/* private fields */);
Expand description
Identity Merkle Root
A Merkle root that commits to a node’s combinator, its witness data (if present),
and recursively its children. Used as input to the Ihr
type which is probably
actually what you want.
Implementations§
Source§impl Imr
impl Imr
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 Imr
impl Imr
Sourcepub fn disconnect(left: Self, right: Self) -> Self
pub fn disconnect(left: Self, right: Self) -> 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 IHR for a fail combinator
Sourcepub fn const_word(word: &Word) -> Self
pub fn const_word(word: &Word) -> Self
Compute the CMR of a constant word jet
This is equal to the IHR of the equivalent scribe, converted to a CMR in the usual way for jets.