Struct snarkvm_circuit::merkle_tree::MerklePath
source · [−]pub struct MerklePath<E, const DEPTH: u8> where
E: Environment, { /* private fields */ }
Implementations
sourceimpl<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
sourceimpl<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,
sourcefn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the Merkle path.
sourcefn 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>
sourcefn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
Ejects the mode and primitive value of the circuit type. Read more
sourcefn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns true
if the circuit is a constant. Read more
sourcefn is_private(&self) -> bool
fn is_private(&self) -> bool
Returns true
if the circuit is a private. Read more
sourceimpl<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,
sourcefn 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more