pub struct MerkleProof { /* private fields */ }Expand description
A proof of the merkle commitment.
Implementations§
Source§impl MerkleProof
impl MerkleProof
Sourcepub fn method(&self) -> Method
pub fn method(&self) -> Method
Method returning copy of MerkleProof::method field.
Method used to construct MPC proof (hash function, merklization).
Sourcepub fn pos(&self) -> u32
pub fn pos(&self) -> u32
Method returning copy of MerkleProof::pos field.
Position of the leaf in the tree.
Sourcepub fn cofactor(&self) -> u16
pub fn cofactor(&self) -> u16
Method returning copy of MerkleProof::cofactor field.
Cofactor used by the Merkle tree.
Source§impl MerkleProof
impl MerkleProof
Sourcepub fn width_limit(&self) -> u32
pub fn width_limit(&self) -> u32
Computes the maximum width of the merkle tree.
Sourcepub fn factored_width(&self) -> u32
pub fn factored_width(&self) -> u32
Computes the factored width of the merkle tree according to the formula
2 ^ depth - cofactor.
Sourcepub fn into_path(self) -> Confined<Vec<MerkleHash>, 0, 32>
pub fn into_path(self) -> Confined<Vec<MerkleHash>, 0, 32>
Converts the proof into inner merkle path representation
Sourcepub fn to_path(&self) -> Confined<Vec<MerkleHash>, 0, 32>
pub fn to_path(&self) -> Confined<Vec<MerkleHash>, 0, 32>
Constructs the proof into inner merkle path representation
Sourcepub fn as_path(&self) -> &[MerkleHash]
pub fn as_path(&self) -> &[MerkleHash]
Returns inner merkle path representation
Sourcepub fn merkle_root(&self) -> Option<MerkleHash>
pub fn merkle_root(&self) -> Option<MerkleHash>
Returns the root of the merkle path.
If the MPC proof contains only a single message returns None
Sourcepub fn convolve(
&self,
protocol_id: ProtocolId,
message: Message,
) -> Result<Commitment, InvalidProof>
pub fn convolve( &self, protocol_id: ProtocolId, message: Message, ) -> Result<Commitment, InvalidProof>
Convolves the proof with the message under the given protocol_id,
producing Commitment.
Trait Implementations§
Source§impl Clone for MerkleProof
impl Clone for MerkleProof
Source§fn clone(&self) -> MerkleProof
fn clone(&self) -> MerkleProof
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MerkleProof
impl Debug for MerkleProof
Source§impl Default for MerkleProof
impl Default for MerkleProof
Source§fn default() -> MerkleProof
fn default() -> MerkleProof
Source§impl<'de> Deserialize<'de> for MerkleProof
impl<'de> Deserialize<'de> for MerkleProof
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for MerkleProof
impl Hash for MerkleProof
Source§impl Ord for MerkleProof
impl Ord for MerkleProof
Source§fn cmp(&self, other: &MerkleProof) -> Ordering
fn cmp(&self, other: &MerkleProof) -> 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 MerkleProof
impl PartialEq for MerkleProof
Source§impl PartialOrd for MerkleProof
impl PartialOrd for MerkleProof
Source§impl Proof for MerkleProof
impl Proof for MerkleProof
Source§impl Serialize for MerkleProof
impl Serialize for MerkleProof
Source§impl StrictDecode for MerkleProof
impl StrictDecode for MerkleProof
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictEncode for MerkleProof
impl StrictEncode for MerkleProof
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictStruct for MerkleProof
impl StrictStruct for MerkleProof
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for MerkleProof
impl StrictType for MerkleProof
const STRICT_LIB_NAME: &'static str = LIB_NAME_COMMIT_VERIFY
fn strict_name() -> Option<TypeName>
impl Eq for MerkleProof
impl StrictProduct for MerkleProof
impl StructuralPartialEq for MerkleProof
Auto Trait Implementations§
impl Freeze for MerkleProof
impl RefUnwindSafe for MerkleProof
impl Send for MerkleProof
impl Sync for MerkleProof
impl Unpin for MerkleProof
impl UnwindSafe for MerkleProof
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.