Enum snarkvm_wasm::fields::FpGadget [−][src]
Represent variables corresponding to a field element in F.
Variants
Constant (not an allocated variable).
Variable(AllocatedFp<F>)Allocated variable in the constraint system.
Trait Implementations
impl<F> AllocGadget<F, F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn alloc_constant<FN, T, CS>(
_cs: CS,
value_gen: FN
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Borrow<F>,
FN: FnOnce() -> Result<T, SynthesisError>, [src]
_cs: CS,
value_gen: FN
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Borrow<F>,
FN: FnOnce() -> Result<T, SynthesisError>,
pub fn alloc<FN, T, CS>(
cs: CS,
value_gen: FN
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Borrow<F>,
FN: FnOnce() -> Result<T, SynthesisError>, [src]
cs: CS,
value_gen: FN
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Borrow<F>,
FN: FnOnce() -> Result<T, SynthesisError>,
pub fn alloc_input<FN, T, CS>(
cs: CS,
value_gen: FN
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Borrow<F>,
FN: FnOnce() -> Result<T, SynthesisError>, [src]
cs: CS,
value_gen: FN
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Borrow<F>,
FN: FnOnce() -> Result<T, SynthesisError>,
pub fn alloc_checked<Fn, T, CS>(cs: CS, f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>, [src]
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
pub fn alloc_input_checked<Fn, T, CS>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>, [src]
cs: CS,
f: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
impl<F> Clone for FpGadget<F> where
F: Clone + PrimeField, [src]
F: Clone + PrimeField,
impl<F> CondSelectGadget<F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn conditionally_select<CS>(
cs: CS,
cond: &Boolean,
first: &FpGadget<F>,
second: &FpGadget<F>
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
cond: &Boolean,
first: &FpGadget<F>,
second: &FpGadget<F>
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> ConditionalEqGadget<F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn conditional_enforce_equal<CS>(
&self,
cs: CS,
other: &FpGadget<F>,
condition: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &FpGadget<F>,
condition: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> Debug for FpGadget<F> where
F: Debug + PrimeField, [src]
F: Debug + PrimeField,
impl<F> Eq for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
impl<F> EqGadget<F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn enforce_equal<CS>(
&self,
cs: CS,
other: &Self
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &Self
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> FieldGadget<F, F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
type Variable = ConstraintVariable<F>
pub fn get_value(&self) -> Option<F>[src]
pub fn get_variable(&self) -> <FpGadget<F> as FieldGadget<F, F>>::Variable[src]
pub fn zero<CS>(_cs: CS) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
pub fn one<CS>(_cs: CS) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
pub fn conditionally_add_constant<CS>(
&self,
_cs: CS,
bit: &Boolean,
coeff: F
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
_cs: CS,
bit: &Boolean,
coeff: F
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn add<CS>(
&self,
cs: CS,
other: &FpGadget<F>
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &FpGadget<F>
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn double<CS>(&self, _cs: CS) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
pub fn double_in_place<CS>(
&mut self,
_cs: CS
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
_cs: CS
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn sub<CS>(
&self,
cs: CS,
other: &FpGadget<F>
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &FpGadget<F>
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn negate<CS>(&self, cs: CS) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
pub fn negate_in_place<CS>(
&mut self,
_cs: CS
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
_cs: CS
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn mul<CS>(
&self,
cs: CS,
other: &FpGadget<F>
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &FpGadget<F>
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn add_constant<CS>(
&self,
_cs: CS,
other: &F
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
_cs: CS,
other: &F
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn add_constant_in_place<CS>(
&mut self,
_cs: CS,
other: &F
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
_cs: CS,
other: &F
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn mul_by_constant<CS>(
&self,
cs: CS,
other: &F
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &F
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn mul_by_constant_in_place<CS>(
&mut self,
_cs: CS,
other: &F
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
_cs: CS,
other: &F
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn inverse<CS>(&self, cs: CS) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
pub fn frobenius_map<CS>(
&self,
_cs: CS,
_power: usize
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
_cs: CS,
_power: usize
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn frobenius_map_in_place<CS>(
&mut self,
_cs: CS,
_power: usize
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
_cs: CS,
_power: usize
) -> Result<&mut FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn mul_equals<CS>(
&self,
cs: CS,
other: &FpGadget<F>,
result: &FpGadget<F>
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &FpGadget<F>,
result: &FpGadget<F>
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn square_equals<CS>(
&self,
cs: CS,
result: &FpGadget<F>
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
result: &FpGadget<F>
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost_of_mul() -> usize[src]
pub fn cost_of_inv() -> usize[src]
pub fn add_in_place<CS>(
&mut self,
cs: CS,
other: &Self
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
cs: CS,
other: &Self
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn sub_in_place<CS>(
&mut self,
cs: CS,
other: &Self
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
cs: CS,
other: &Self
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn mul_in_place<CS>(
&mut self,
cs: CS,
other: &Self
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
cs: CS,
other: &Self
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn square<CS>(&self, cs: CS) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
pub fn square_in_place<CS>(
&mut self,
cs: CS
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
cs: CS
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn sub_constant<CS>(
&self,
cs: CS,
fe: &NativeF
) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
fe: &NativeF
) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn sub_constant_in_place<CS>(
&mut self,
cs: CS,
other: &NativeF
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&mut self,
cs: CS,
other: &NativeF
) -> Result<&mut Self, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn pow<CS>(&self, cs: CS, bits: &[Boolean]) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
impl<F> From<AllocatedFp<F>> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn from(other: AllocatedFp<F>) -> FpGadget<F>[src]
impl<F> NEqGadget<F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn enforce_not_equal<CS>(
&self,
cs: CS,
other: &FpGadget<F>
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &FpGadget<F>
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> PartialEq<FpGadget<F>> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn eq(&self, other: &FpGadget<F>) -> bool[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool1.0.0[src]
impl<F> ThreeBitCondNegLookupGadget<F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
type TableConstant = F
pub fn three_bit_cond_neg_lookup<CS>(
cs: CS,
b: &[Boolean],
b0b1: &Boolean,
c: &[<FpGadget<F> as ThreeBitCondNegLookupGadget<F>>::TableConstant]
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
b: &[Boolean],
b0b1: &Boolean,
c: &[<FpGadget<F> as ThreeBitCondNegLookupGadget<F>>::TableConstant]
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> ToBitsGadget<F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn to_bits<CS>(
&self,
cs: CS
) -> Result<Vec<Boolean, Global>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS
) -> Result<Vec<Boolean, Global>, SynthesisError> where
CS: ConstraintSystem<F>,
Outputs the binary representation of the value in self in big-endian
form.
pub fn to_bits_strict<CS>(
&self,
cs: CS
) -> Result<Vec<Boolean, Global>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS
) -> Result<Vec<Boolean, Global>, SynthesisError> where
CS: ConstraintSystem<F>,
impl<F> ToBytesGadget<F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn to_bytes<CS>(&self, cs: CS) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
pub fn to_bytes_strict<CS>(
&self,
cs: CS
) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS
) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>,
impl<F> TwoBitLookupGadget<F> for FpGadget<F> where
F: PrimeField, [src]
F: PrimeField,
Uses two bits to perform a lookup into a table
b is little-endian: b[0] is LSB.
type TableConstant = F
pub fn two_bit_lookup<CS>(
cs: CS,
b: &[Boolean],
c: &[<FpGadget<F> as TwoBitLookupGadget<F>>::TableConstant]
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
b: &[Boolean],
c: &[<FpGadget<F> as TwoBitLookupGadget<F>>::TableConstant]
) -> Result<FpGadget<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
Auto Trait Implementations
impl<F> RefUnwindSafe for FpGadget<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for FpGadget<F>
impl<F> Sync for FpGadget<F>
impl<F> Unpin for FpGadget<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for FpGadget<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<F, T> ConditionalOrEqualsGadget<F> for T where
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
F: Field, [src]
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
F: Field,
pub fn conditional_enforce_equal_or<CS>(
cs: CS,
cond: &Boolean,
var: &T,
first: &T,
second: &T,
should_enforce: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
cond: &Boolean,
var: &T,
first: &T,
second: &T,
should_enforce: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<F, T> OrEqualsGadget<F> for T where
T: ConditionalOrEqualsGadget<F>,
F: Field, [src]
T: ConditionalOrEqualsGadget<F>,
F: Field,
pub fn enforce_equal_or<CS>(
cs: CS,
cond: &Boolean,
var: &T,
first: &T,
second: &T
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
cond: &Boolean,
var: &T,
first: &T,
second: &T
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,