Struct snarkvm_gadgets::algorithms::merkle_tree::merkle_path::MerklePathGadget
source · [−]pub struct MerklePathGadget<P: MerkleParameters, HG: CRHGadget<P::H, F>, F: PrimeField> { /* private fields */ }
Implementations
sourceimpl<P: MerkleParameters, HG: CRHGadget<P::H, F>, F: PrimeField> MerklePathGadget<P, HG, F>
impl<P: MerkleParameters, HG: CRHGadget<P::H, F>, F: PrimeField> MerklePathGadget<P, HG, F>
pub fn calculate_root<CS: ConstraintSystem<F>>(
&self,
cs: CS,
crh: &HG,
leaf: impl ToBytesGadget<F>
) -> Result<HG::OutputGadget, SynthesisError>
pub fn update_leaf<CS: ConstraintSystem<F>>(
&self,
cs: CS,
crh: &HG,
old_root: &HG::OutputGadget,
old_leaf: impl ToBytesGadget<F>,
new_leaf: impl ToBytesGadget<F>
) -> Result<HG::OutputGadget, SynthesisError>
pub fn update_and_check<CS: ConstraintSystem<F>>(
&self,
cs: CS,
crh: &HG,
old_root: &HG::OutputGadget,
new_root: &HG::OutputGadget,
old_leaf: impl ToBytesGadget<F>,
new_leaf: impl ToBytesGadget<F>
) -> Result<(), SynthesisError>
pub fn check_membership<CS: ConstraintSystem<F>>(
&self,
cs: CS,
crh: &HG,
root: &HG::OutputGadget,
leaf: impl ToBytesGadget<F>
) -> Result<(), SynthesisError>
pub fn conditionally_check_membership<CS: ConstraintSystem<F>>(
&self,
cs: CS,
crh: &HG,
root: &HG::OutputGadget,
leaf: impl ToBytesGadget<F>,
should_enforce: &Boolean
) -> Result<(), SynthesisError>
Trait Implementations
sourceimpl<P, HGadget, F> AllocGadget<MerklePath<P>, F> for MerklePathGadget<P, HGadget, F> where
P: MerkleParameters,
HGadget: CRHGadget<P::H, F>,
F: PrimeField,
impl<P, HGadget, F> AllocGadget<MerklePath<P>, F> for MerklePathGadget<P, HGadget, F> where
P: MerkleParameters,
HGadget: CRHGadget<P::H, F>,
F: PrimeField,
fn alloc<Fn, T, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<MerklePath<P>>,
fn alloc_input<Fn, T, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<MerklePath<P>>,
fn alloc_constant<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
_cs: CS,
_f: Fn
) -> Result<Self, SynthesisError>
fn alloc_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
fn alloc_input_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
Auto Trait Implementations
impl<P, HG, F> RefUnwindSafe for MerklePathGadget<P, HG, F> where
<HG as CRHGadget<<P as MerkleParameters>::H, F>>::OutputGadget: RefUnwindSafe,
impl<P, HG, F> Send for MerklePathGadget<P, HG, F> where
<HG as CRHGadget<<P as MerkleParameters>::H, F>>::OutputGadget: Send,
impl<P, HG, F> Sync for MerklePathGadget<P, HG, F> where
<HG as CRHGadget<<P as MerkleParameters>::H, F>>::OutputGadget: Sync,
impl<P, HG, F> Unpin for MerklePathGadget<P, HG, F> where
<HG as CRHGadget<<P as MerkleParameters>::H, F>>::OutputGadget: Unpin,
impl<P, HG, F> UnwindSafe for MerklePathGadget<P, HG, F> where
<HG as CRHGadget<<P as MerkleParameters>::H, F>>::OutputGadget: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more