Fields
bits: Vec<Boolean>
negated: bool
value: Option<u16>
Trait Implementations
sourceimpl<F: Field + PrimeField> Add<F, UInt16> for UInt16
impl<F: Field + PrimeField> Add<F, UInt16> for UInt16
type ErrorType = UnsignedIntegerError
fn add<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
sourceimpl<F: Field> AllocGadget<<UInt16 as Integer>::IntegerType, F> for UInt16
impl<F: Field> AllocGadget<<UInt16 as Integer>::IntegerType, F> for UInt16
fn alloc<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<<UInt16 as Integer>::IntegerType>, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_input<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<<UInt16 as Integer>::IntegerType>, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_constant<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
_cs: CS,
_f: 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: Field + PrimeField> ComparatorGadget<F> for UInt16
impl<F: Field + PrimeField> ComparatorGadget<F> for UInt16
fn greater_than<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
fn less_than_or_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
fn greater_than_or_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
sourceimpl<F: PrimeField> CondSelectGadget<F> for UInt16
impl<F: PrimeField> CondSelectGadget<F> for UInt16
fn conditionally_select<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
first: &Self,
second: &Self
) -> Result<Self, SynthesisError>
fn cost() -> usize
sourceimpl<F: Field> ConditionalEqGadget<F> for UInt16
impl<F: Field> ConditionalEqGadget<F> for UInt16
fn conditional_enforce_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self,
condition: &Boolean
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<F: PrimeField> Div<F, UInt16> for UInt16
impl<F: PrimeField> Div<F, UInt16> for UInt16
type ErrorType = UnsignedIntegerError
fn div<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
sourceimpl<F: Field> EqGadget<F> for UInt16
impl<F: Field> EqGadget<F> for UInt16
sourcefn is_eq<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
fn is_eq<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
Output a Boolean
value representing whether self.value() == other.value()
. Read more
fn enforce_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<F: PrimeField> EvaluateEqGadget<F> for UInt16
impl<F: PrimeField> EvaluateEqGadget<F> for UInt16
fn evaluate_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
sourceimpl<F: Field + PrimeField> EvaluateLtGadget<F> for UInt16
impl<F: Field + PrimeField> EvaluateLtGadget<F> for UInt16
fn less_than<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
sourceimpl Integer for UInt16
impl Integer for UInt16
type IntegerType = u16
type UnsignedGadget = UInt16
type UnsignedIntegerType = u16
const SIZE: usize
fn constant(value: u16) -> Self
fn one() -> Self
fn zero() -> Self
fn new(bits: Vec<Boolean>, value: Option<Self::IntegerType>) -> Self
sourcefn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns true if all bits in this Int
are constant
fn to_bits_le(&self) -> Vec<Boolean>
fn to_bits_be(&self) -> Vec<Boolean>
fn from_bits_le(bits: &[Boolean]) -> Self
fn get_value(&self) -> Option<String>
sourcefn result_is_constant(first: &Self, second: &Self) -> bool
fn result_is_constant(first: &Self, second: &Self) -> bool
Returns true if both Int
objects have constant bits
sourceimpl PartialOrd<UInt16> for UInt16
impl PartialOrd<UInt16> for UInt16
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<F: PrimeField> Pow<F, UInt16> for UInt16
impl<F: PrimeField> Pow<F, UInt16> for UInt16
sourcefn pow<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
fn pow<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
Bitwise exponentiation of two unsized integers. Reference: /snarkVM/models/src/curves/field.rs
type ErrorType = UnsignedIntegerError
sourceimpl<F: PrimeField> Sub<F, UInt16> for UInt16
impl<F: PrimeField> Sub<F, UInt16> for UInt16
type ErrorType = UnsignedIntegerError
fn sub<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
sourceimpl<F: Field> ToBytesGadget<F> for UInt16
impl<F: Field> ToBytesGadget<F> for UInt16
fn to_bytes<CS: ConstraintSystem<F>>(
&self,
_cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
sourcefn to_bytes_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
fn to_bytes_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
Additionally checks if the produced list of booleans is ‘valid’.
sourceimpl UInt for UInt16
impl UInt for UInt16
sourcefn addmany<F: PrimeField, CS: ConstraintSystem<F>>(
cs: CS,
operands: &[Self]
) -> Result<Self, SynthesisError>
fn addmany<F: PrimeField, CS: ConstraintSystem<F>>(
cs: CS,
operands: &[Self]
) -> Result<Self, SynthesisError>
Perform modular addition of several UInt
objects.
sourcefn mul<F: PrimeField, CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, UnsignedIntegerError>
fn mul<F: PrimeField, CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, UnsignedIntegerError>
Perform Bitwise multiplication of two UInt
objects.
Reference: https://en.wikipedia.org/wiki/Binary_multiplier Read more
sourceimpl<F: PrimeField> Xor<F, UInt16> for UInt16
impl<F: PrimeField> Xor<F, UInt16> for UInt16
fn xor<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
impl Eq for UInt16
Auto Trait Implementations
impl RefUnwindSafe for UInt16
impl Send for UInt16
impl Sync for UInt16
impl Unpin for UInt16
impl UnwindSafe for UInt16
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<F, T> ConditionalOrEqualsGadget<F> for T where
F: Field,
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
impl<F, T> ConditionalOrEqualsGadget<F> for T where
F: Field,
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
fn conditional_enforce_equal_or<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
var: &Self,
first: &Self,
second: &Self,
should_enforce: &Boolean
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<F, T> OrEqualsGadget<F> for T where
F: Field,
T: ConditionalOrEqualsGadget<F>,
impl<F, T> OrEqualsGadget<F> for T where
F: Field,
T: ConditionalOrEqualsGadget<F>,
fn enforce_equal_or<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
var: &Self,
first: &Self,
second: &Self
) -> Result<(), SynthesisError>
fn cost() -> usize
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)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more