Struct snarkvm_circuit::merkle_tree::MerklePath
source · pub struct MerklePath<E, const DEPTH: u8>where
E: Environment,{ /* private fields */ }
Implementations§
source§impl<E, const DEPTH: u8> MerklePath<E, DEPTH>where
E: Environment,
impl<E, const DEPTH: u8> MerklePath<E, DEPTH>where E: Environment,
sourcepub fn verify<LH, PH>(
&self,
leaf_hasher: &LH,
path_hasher: &PH,
root: &<PH as PathHash<E>>::Hash,
leaf: &<LH as LeafHash<E>>::Leaf
) -> Boolean<E>where
LH: LeafHash<E, Hash = <PH as PathHash<E>>::Hash>,
PH: PathHash<E, Hash = Field<E>>,
pub fn verify<LH, PH>( &self, leaf_hasher: &LH, path_hasher: &PH, root: &<PH as PathHash<E>>::Hash, leaf: &<LH as LeafHash<E>>::Leaf ) -> Boolean<E>where LH: LeafHash<E, Hash = <PH as PathHash<E>>::Hash>, PH: PathHash<E, Hash = Field<E>>,
Returns true
if the Merkle path is valid for the given root and leaf.
Trait Implementations§
source§impl<E, const DEPTH: u8> Eject for MerklePath<E, DEPTH>where
E: Environment,
impl<E, const DEPTH: u8> Eject for MerklePath<E, DEPTH>where E: Environment,
source§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the Merkle path.
source§fn eject_value(&self) -> <MerklePath<E, DEPTH> as Eject>::Primitive
fn eject_value(&self) -> <MerklePath<E, DEPTH> as Eject>::Primitive
Ejects the Merkle path.
type Primitive = MerklePath<<E as Environment>::Network, DEPTH>
source§fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
Ejects the mode and primitive value of the circuit type.
source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns
true
if the circuit is a constant.source§fn is_private(&self) -> bool
fn is_private(&self) -> bool
Returns
true
if the circuit is a private.source§impl<E, const DEPTH: u8> Inject for MerklePath<E, DEPTH>where
E: Environment,
impl<E, const DEPTH: u8> Inject for MerklePath<E, DEPTH>where E: Environment,
source§fn new(
mode: Mode,
merkle_path: <MerklePath<E, DEPTH> as Inject>::Primitive
) -> MerklePath<E, DEPTH>
fn new( mode: Mode, merkle_path: <MerklePath<E, DEPTH> as Inject>::Primitive ) -> MerklePath<E, DEPTH>
Initializes a Merkle path from the given mode and native Merkle path.
type Primitive = MerklePath<<E as Environment>::Network, DEPTH>
Auto Trait Implementations§
impl<E, const DEPTH: u8> RefUnwindSafe for MerklePath<E, DEPTH>where <E as Environment>::BaseField: UnwindSafe + RefUnwindSafe,
impl<E, const DEPTH: u8> !Send for MerklePath<E, DEPTH>
impl<E, const DEPTH: u8> !Sync for MerklePath<E, DEPTH>
impl<E, const DEPTH: u8> Unpin for MerklePath<E, DEPTH>where <E as Environment>::BaseField: Unpin,
impl<E, const DEPTH: u8> UnwindSafe for MerklePath<E, DEPTH>where <E as Environment>::BaseField: UnwindSafe + RefUnwindSafe,
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
Mutably borrows from an owned value. Read more