Struct snarkvm_wasm::fields::AllocatedFp [−][src]
Represents a variable in the constraint system whose value can be an arbitrary field element.
Fields
value: Option<F>variable: ConstraintVariable<F>Implementations
impl<F> AllocatedFp<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn from<CS>(cs: CS, value: &F) -> AllocatedFp<F> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
impl<F> AllocatedFp<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn from_boolean<CS>(
cs: CS,
other: Boolean
) -> Result<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
other: Boolean
) -> Result<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>,
Constructs Self from a Boolean: if other is false, this outputs
zero, else it outputs one.
Trait Implementations
impl<F> AllocGadget<F, F> for AllocatedFp<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn alloc_constant<FN, T, CS>(
cs: CS,
value_gen: FN
) -> Result<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Borrow<F>,
FN: FnOnce() -> Result<T, SynthesisError>, [src]
cs: CS,
value_gen: FN
) -> Result<AllocatedFp<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<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Borrow<F>,
FN: FnOnce() -> Result<T, SynthesisError>, [src]
cs: CS,
value_gen: FN
) -> Result<AllocatedFp<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<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Borrow<F>,
FN: FnOnce() -> Result<T, SynthesisError>, [src]
cs: CS,
value_gen: FN
) -> Result<AllocatedFp<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 AllocatedFp<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn clone(&self) -> AllocatedFp<F>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<F> CondSelectGadget<F> for AllocatedFp<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn conditionally_select<CS>(
cs: CS,
cond: &Boolean,
first: &AllocatedFp<F>,
second: &AllocatedFp<F>
) -> Result<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
cond: &Boolean,
first: &AllocatedFp<F>,
second: &AllocatedFp<F>
) -> Result<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> ConditionalEqGadget<F> for AllocatedFp<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn conditional_enforce_equal<CS>(
&self,
cs: CS,
other: &AllocatedFp<F>,
condition: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &AllocatedFp<F>,
condition: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> Debug for AllocatedFp<F> where
F: Debug + PrimeField, [src]
F: Debug + PrimeField,
impl<F> Eq for AllocatedFp<F> where
F: PrimeField, [src]
F: PrimeField,
impl<F> EqGadget<F> for AllocatedFp<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> 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 AllocatedFp<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn enforce_not_equal<CS>(
&self,
cs: CS,
other: &AllocatedFp<F>
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &AllocatedFp<F>
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> PartialEq<AllocatedFp<F>> for AllocatedFp<F> where
F: PrimeField, [src]
F: PrimeField,
pub fn eq(&self, other: &AllocatedFp<F>) -> bool[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool1.0.0[src]
impl<F> ThreeBitCondNegLookupGadget<F> for AllocatedFp<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: &[<AllocatedFp<F> as ThreeBitCondNegLookupGadget<F>>::TableConstant]
) -> Result<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
b: &[Boolean],
b0b1: &Boolean,
c: &[<AllocatedFp<F> as ThreeBitCondNegLookupGadget<F>>::TableConstant]
) -> Result<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> ToBitsGadget<F> for AllocatedFp<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 AllocatedFp<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 AllocatedFp<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: &[<AllocatedFp<F> as TwoBitLookupGadget<F>>::TableConstant]
) -> Result<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
b: &[Boolean],
c: &[<AllocatedFp<F> as TwoBitLookupGadget<F>>::TableConstant]
) -> Result<AllocatedFp<F>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
Auto Trait Implementations
impl<F> RefUnwindSafe for AllocatedFp<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for AllocatedFp<F>
impl<F> Sync for AllocatedFp<F>
impl<F> Unpin for AllocatedFp<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for AllocatedFp<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>,