[−][src]Struct snarkos_models::gadgets::utilities::uint::uint128::UInt128
Represents an interpretation of 128 Boolean
objects as an
unsigned integer.
Fields
bits: Vec<Boolean>
negated: bool
value: Option<u128>
Implementations
impl UInt128
[src]
Trait Implementations
impl<F: Field + PrimeField> Add<F, UInt128> for UInt128
[src]
type ErrorType = SynthesisError
fn add<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
impl<F: Field> AllocGadget<u128, F> for UInt128
[src]
fn alloc<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<u128>, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
[src]
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_input<Fn, T, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<u128>,
[src]
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<u128>,
fn alloc_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
[src]
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>
[src]
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
impl Clone for UInt128
[src]
impl<F: Field + PrimeField> ComparatorGadget<F> for UInt128
[src]
fn greater_than<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
fn less_than_or_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
fn greater_than_or_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
impl<F: PrimeField> CondSelectGadget<F> for UInt128
[src]
fn conditionally_select<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
first: &Self,
second: &Self
) -> Result<Self, SynthesisError>
[src]
cs: CS,
cond: &Boolean,
first: &Self,
second: &Self
) -> Result<Self, SynthesisError>
fn cost() -> usize
[src]
impl<F: Field> ConditionalEqGadget<F> for UInt128
[src]
fn conditional_enforce_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self,
condition: &Boolean
) -> Result<(), SynthesisError>
[src]
&self,
cs: CS,
other: &Self,
condition: &Boolean
) -> Result<(), SynthesisError>
fn cost() -> usize
[src]
impl Debug for UInt128
[src]
impl Eq for UInt128
[src]
impl<F: Field> EqGadget<F> for UInt128
[src]
fn enforce_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<(), SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<(), SynthesisError>
fn cost() -> usize
[src]
impl<F: PrimeField> EvaluateEqGadget<F> for UInt128
[src]
fn evaluate_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
impl<F: Field + PrimeField> EvaluateLtGadget<F> for UInt128
[src]
fn less_than<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
impl PartialEq<UInt128> for UInt128
[src]
impl PartialOrd<UInt128> for UInt128
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<F: Field> ToBytesGadget<F> for UInt128
[src]
fn to_bytes<CS: ConstraintSystem<F>>(
&self,
_cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
[src]
&self,
_cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
fn to_bytes_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
[src]
&self,
cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
impl UInt for UInt128
[src]
fn negate(&self) -> Self
[src]
Returns the inverse UInt128
fn is_constant(&self) -> bool
[src]
Returns true if all bits in this UInt128 are constant
fn to_bits_le(&self) -> Vec<Boolean>
[src]
Turns this UInt128
into its little-endian byte order representation.
fn from_bits_le(bits: &[Boolean]) -> Self
[src]
Converts a little-endian byte order representation of bits into a
UInt128
.
fn rotr(&self, by: usize) -> Self
[src]
fn xor<F: Field, CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
XOR this UInt128
with another UInt128
fn addmany<F: PrimeField, CS: ConstraintSystem<F>>(
cs: CS,
operands: &[Self]
) -> Result<Self, SynthesisError>
[src]
cs: CS,
operands: &[Self]
) -> Result<Self, SynthesisError>
Perform modular addition of several UInt128
objects.
fn sub<F: PrimeField, CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
Perform modular subtraction of two UInt128
objects.
fn sub_unsafe<F: PrimeField, CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
Perform unsafe subtraction of two UInt128
objects which returns 0 if overflowed
fn mul<F: PrimeField, CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
Bitwise multiplication of two UInt128
objects.
Reference: https://en.wikipedia.org/wiki/Binary_multiplier
fn div<F: PrimeField, CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
Perform long division of two UInt128
objects.
Reference: https://en.wikipedia.org/wiki/Division_algorithm
fn pow<F: Field + PrimeField, CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
[src]
&self,
cs: CS,
other: &Self
) -> Result<Self, SynthesisError>
Bitwise multiplication of two UInt128
objects.
Reference: /snarkOS/models/src/curves/field.rs
fn result_is_constant(first: &Self, second: &Self) -> bool
[src]
Auto Trait Implementations
impl RefUnwindSafe for UInt128
impl Send for UInt128
impl Sync for UInt128
impl Unpin for UInt128
impl UnwindSafe for UInt128
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<F, T> ConditionalOrEqualsGadget<F> for T where
F: Field,
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
[src]
F: Field,
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
fn conditional_enforce_equal_or<CS>(
CS,
&Boolean,
&T,
&T,
&T,
&Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS,
&Boolean,
&T,
&T,
&T,
&Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
fn cost() -> usize
[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
F: Field,
T: ConditionalOrEqualsGadget<F>,
[src]
F: Field,
T: ConditionalOrEqualsGadget<F>,
fn enforce_equal_or<CS>(CS, &Boolean, &T, &T, &T) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
[src]
CS: ConstraintSystem<F>,
fn cost() -> usize
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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.
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>,