Struct arkworks_gadgets::merkle_tree::constraints::PathVar
source · [−]pub struct PathVar<F, P, HG, LHG, const N: usize> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>, { /* private fields */ }
Expand description
Gadgets for one Merkle tree path
Implementations
sourceimpl<F, P, HG, LHG, const N: usize> PathVar<F, P, HG, LHG, N> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
impl<F, P, HG, LHG, const N: usize> PathVar<F, P, HG, LHG, N> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
sourcepub fn check_membership<L: ToBytesGadget<F>>(
&self,
root: &NodeVar<F, P, HG, LHG>,
leaf: L
) -> Result<Boolean<F>, SynthesisError>
pub fn check_membership<L: ToBytesGadget<F>>(
&self,
root: &NodeVar<F, P, HG, LHG>,
leaf: L
) -> Result<Boolean<F>, SynthesisError>
conditionally check a lookup proof (does not enforce index consistency)
pub fn root_hash<L: ToBytesGadget<F>>(
&self,
leaf: &L
) -> Result<NodeVar<F, P, HG, LHG>, SynthesisError>
pub fn get_index<L: ToBytesGadget<F>>(
&self,
root: &NodeVar<F, P, HG, LHG>,
leaf: L
) -> Result<FpVar<F>, SynthesisError>
Trait Implementations
sourceimpl<F, P, HG, LHG, const N: usize> AllocVar<Path<P, N>, F> for PathVar<F, P, HG, LHG, N> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
impl<F, P, HG, LHG, const N: usize> AllocVar<Path<P, N>, F> for PathVar<F, P, HG, LHG, N> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
sourcefn new_variable<T: Borrow<Path<P, N>>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_variable<T: Borrow<Path<P, N>>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
Allocates a new variable of type Self
in the ConstraintSystem
cs
.
The mode of allocation is decided by mode
. Read more
sourcefn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
Allocates a new constant of type Self
in the ConstraintSystem
cs
. Read more
sourcefn new_input<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError> where
T: Borrow<V>,
fn new_input<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError> where
T: Borrow<V>,
Allocates a new public input of type Self
in the ConstraintSystem
cs
. Read more
sourcefn new_witness<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError> where
T: Borrow<V>,
fn new_witness<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError> where
T: Borrow<V>,
Allocates a new private witness of type Self
in the ConstraintSystem
cs
. Read more
Auto Trait Implementations
impl<F, P, HG, LHG, const N: usize> RefUnwindSafe for PathVar<F, P, HG, LHG, N> where
<HG as CRHGadget<<P as Config>::H, F>>::OutputVar: RefUnwindSafe,
<LHG as CRHGadget<<P as Config>::LeafH, F>>::OutputVar: RefUnwindSafe,
<HG as CRHGadget<<P as Config>::H, F>>::ParametersVar: RefUnwindSafe,
<LHG as CRHGadget<<P as Config>::LeafH, F>>::ParametersVar: RefUnwindSafe,
impl<F, P, HG, LHG, const N: usize> !Send for PathVar<F, P, HG, LHG, N>
impl<F, P, HG, LHG, const N: usize> !Sync for PathVar<F, P, HG, LHG, N>
impl<F, P, HG, LHG, const N: usize> Unpin for PathVar<F, P, HG, LHG, N> where
<HG as CRHGadget<<P as Config>::H, F>>::OutputVar: Unpin,
<LHG as CRHGadget<<P as Config>::LeafH, F>>::OutputVar: Unpin,
impl<F, P, HG, LHG, const N: usize> UnwindSafe for PathVar<F, P, HG, LHG, N> where
<HG as CRHGadget<<P as Config>::H, F>>::OutputVar: UnwindSafe,
<LHG as CRHGadget<<P as Config>::LeafH, F>>::OutputVar: UnwindSafe,
<HG as CRHGadget<<P as Config>::H, F>>::ParametersVar: RefUnwindSafe,
<LHG as CRHGadget<<P as Config>::LeafH, F>>::ParametersVar: RefUnwindSafe,
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more