Enum arkworks_gadgets::merkle_tree::constraints::NodeVar
source · [−]pub enum NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>, {
Leaf(LHG::OutputVar),
Inner(HG::OutputVar),
}
Variants
Leaf(LHG::OutputVar)
Inner(HG::OutputVar)
Trait Implementations
sourceimpl<F, P, HG, LHG> AllocVar<Node<P>, F> for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
impl<F, P, HG, LHG> AllocVar<Node<P>, F> for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
sourcefn new_variable<T: Borrow<Node<P>>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_variable<T: Borrow<Node<P>>>(
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
sourceimpl<F, P, HG, LHG> Clone for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
impl<F, P, HG, LHG> Clone for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
sourceimpl<F, P, HG, LHG> CondSelectGadget<F> for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
impl<F, P, HG, LHG> CondSelectGadget<F> for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
sourcefn conditionally_select(
cond: &Boolean<F>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
fn conditionally_select(
cond: &Boolean<F>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
If cond == &Boolean::TRUE
, then this returns true_value
; else,
returns false_value
. Read more
sourcefn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>
fn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>
Returns an element of values
whose index in represented by position
.
position
is an array of boolean that represents an unsigned integer in big endian order. Read more
sourceimpl<F: Debug, P: Debug, HG: Debug, LHG: Debug> Debug for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
LHG::OutputVar: Debug,
HG::OutputVar: Debug,
impl<F: Debug, P: Debug, HG: Debug, LHG: Debug> Debug for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
LHG::OutputVar: Debug,
HG::OutputVar: Debug,
sourceimpl<F, P, HG, LHG> EqGadget<F> for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
impl<F, P, HG, LHG> EqGadget<F> for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
sourcefn is_eq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
fn is_eq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
Output a Boolean
value representing whether self.value() == other.value()
. Read more
sourcefn is_neq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
fn is_neq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
Output a Boolean
value representing whether self.value() != other.value()
. Read more
sourcefn conditional_enforce_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
fn conditional_enforce_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
If should_enforce == true
, enforce that self
and other
are equal;
else, enforce a vacuously true statement. Read more
sourcefn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>
fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>
Enforce that self
and other
are equal. Read more
sourcefn conditional_enforce_not_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
If should_enforce == true
, enforce that self
and other
are not
equal; else, enforce a vacuously true statement. Read more
sourcefn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>
fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>
Enforce that self
and other
are not equal. Read more
sourceimpl<F, P, HG, LHG> ToBytesGadget<F> for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
impl<F, P, HG, LHG> ToBytesGadget<F> for NodeVar<F, P, HG, LHG> where
F: PrimeField,
P: Config,
HG: CRHGadget<P::H, F>,
LHG: CRHGadget<P::LeafH, F>,
sourcefn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
fn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
Outputs a canonical, little-endian, byte decomposition of self
. Read more
sourcefn to_non_unique_bytes(&self) -> Result<Vec<UInt8<F>, Global>, SynthesisError>
fn to_non_unique_bytes(&self) -> Result<Vec<UInt8<F>, Global>, SynthesisError>
Outputs a possibly non-unique byte decomposition of self
. Read more
Auto Trait Implementations
impl<F, P, HG, LHG> RefUnwindSafe for NodeVar<F, P, HG, LHG> where
<HG as CRHGadget<<P as Config>::H, F>>::OutputVar: RefUnwindSafe,
<LHG as CRHGadget<<P as Config>::LeafH, F>>::OutputVar: RefUnwindSafe,
impl<F, P, HG, LHG> Send for NodeVar<F, P, HG, LHG> where
<HG as CRHGadget<<P as Config>::H, F>>::OutputVar: Send,
<LHG as CRHGadget<<P as Config>::LeafH, F>>::OutputVar: Send,
impl<F, P, HG, LHG> Sync for NodeVar<F, P, HG, LHG> where
<HG as CRHGadget<<P as Config>::H, F>>::OutputVar: Sync,
<LHG as CRHGadget<<P as Config>::LeafH, F>>::OutputVar: Sync,
impl<F, P, HG, LHG> Unpin for NodeVar<F, P, HG, LHG> 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> UnwindSafe for NodeVar<F, P, HG, LHG> where
<HG as CRHGadget<<P as Config>::H, F>>::OutputVar: UnwindSafe,
<LHG as CRHGadget<<P as Config>::LeafH, F>>::OutputVar: 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
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>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
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