Struct snarkvm_gadgets::bits::boolean_input::BooleanInputGadget
source · [−]pub struct BooleanInputGadget<F: PrimeField, CF: PrimeField> {
pub val: Vec<Vec<Boolean>>,
/* private fields */
}
Expand description
Conversion of field elements by converting them to boolean sequences Used by Groth16 and Gm17
Fields
val: Vec<Vec<Boolean>>
Implementations
sourceimpl<F: PrimeField, CF: PrimeField> BooleanInputGadget<F, CF>
impl<F: PrimeField, CF: PrimeField> BooleanInputGadget<F, CF>
Trait Implementations
sourceimpl<F: PrimeField, CF: PrimeField> AllocGadget<Vec<F, Global>, CF> for BooleanInputGadget<F, CF>
impl<F: PrimeField, CF: PrimeField> AllocGadget<Vec<F, Global>, CF> for BooleanInputGadget<F, CF>
fn alloc_constant<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<Vec<F>>, CS: ConstraintSystem<CF>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<Vec<F>>, CS: ConstraintSystem<CF>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_input<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<Vec<F>>, CS: ConstraintSystem<CF>>(
cs: CS,
value_gen: 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>
sourceimpl<F: Clone + PrimeField, CF: Clone + PrimeField> Clone for BooleanInputGadget<F, CF>
impl<F: Clone + PrimeField, CF: Clone + PrimeField> Clone for BooleanInputGadget<F, CF>
sourcefn clone(&self) -> BooleanInputGadget<F, CF>
fn clone(&self) -> BooleanInputGadget<F, CF>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<F: PrimeField, CF: PrimeField> FromFieldElementsGadget<F, CF> for BooleanInputGadget<F, CF>
impl<F: PrimeField, CF: PrimeField> FromFieldElementsGadget<F, CF> for BooleanInputGadget<F, CF>
sourcefn from_field_elements<CS: ConstraintSystem<CF>>(
cs: CS,
field_elements: &[FpGadget<CF>]
) -> Result<Self, SynthesisError>
fn from_field_elements<CS: ConstraintSystem<CF>>(
cs: CS,
field_elements: &[FpGadget<CF>]
) -> Result<Self, SynthesisError>
Converts FpGadget<F>
variables to self
.
sourceimpl<F: PrimeField, CF: PrimeField> IntoIterator for BooleanInputGadget<F, CF>
impl<F: PrimeField, CF: PrimeField> IntoIterator for BooleanInputGadget<F, CF>
sourceimpl<F: PrimeField, CF: PrimeField> MergeGadget<CF> for BooleanInputGadget<F, CF>
impl<F: PrimeField, CF: PrimeField> MergeGadget<CF> for BooleanInputGadget<F, CF>
fn merge<CS: ConstraintSystem<CF>>(
&self,
_cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
fn merge_in_place<CS: ConstraintSystem<CF>>(
&mut self,
_cs: CS,
other: &Self
) -> Result<(), SynthesisError>
fn merge_many<CS: ConstraintSystem<F>>(
cs: CS,
elems: &[Self]
) -> Result<Self, SynthesisError>
sourceimpl<F: PrimeField, CF: PrimeField> ToBitsLEGadget<CF> for BooleanInputGadget<F, CF>
impl<F: PrimeField, CF: PrimeField> ToBitsLEGadget<CF> for BooleanInputGadget<F, CF>
fn to_bits_le<CS: ConstraintSystem<CF>>(
&self,
_cs: CS
) -> Result<Vec<Boolean>, SynthesisError>
sourcefn to_bits_le_strict<CS: ConstraintSystem<CF>>(
&self,
cs: CS
) -> Result<Vec<Boolean>, SynthesisError>
fn to_bits_le_strict<CS: ConstraintSystem<CF>>(
&self,
cs: CS
) -> Result<Vec<Boolean>, SynthesisError>
Additionally checks if the produced list of booleans is ‘valid’.
Auto Trait Implementations
impl<F, CF> RefUnwindSafe for BooleanInputGadget<F, CF> where
CF: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, CF> Send for BooleanInputGadget<F, CF>
impl<F, CF> Sync for BooleanInputGadget<F, CF>
impl<F, CF> Unpin for BooleanInputGadget<F, CF> where
CF: Unpin,
F: Unpin,
impl<F, CF> UnwindSafe for BooleanInputGadget<F, CF> where
CF: UnwindSafe,
F: 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
impl<T> Pointable for T
impl<T> Pointable for T
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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more