Struct snarkvm_wasm::traits::utilities::uint::UInt128[][src]

pub struct UInt128 {
    pub bits: Vec<Boolean, Global>,
    pub negated: bool,
    pub value: Option<u128>,
}

Fields

bits: Vec<Boolean, Global>negated: boolvalue: Option<u128>

Implementations

impl UInt128[src]

pub fn constant(value: u128) -> UInt128[src]

Trait Implementations

impl<F> Add<F, UInt128> for UInt128 where
    F: Field + PrimeField
[src]

type ErrorType = SynthesisError

impl<F> AllocGadget<u128, F> for UInt128 where
    F: Field
[src]

impl Clone for UInt128[src]

impl<F> ComparatorGadget<F> for UInt128 where
    F: Field + PrimeField
[src]

impl<F> CondSelectGadget<F> for UInt128 where
    F: PrimeField
[src]

impl<F> ConditionalEqGadget<F> for UInt128 where
    F: Field
[src]

impl Debug for UInt128[src]

impl Eq for UInt128[src]

impl<F> EqGadget<F> for UInt128 where
    F: Field
[src]

impl<F> EvaluateEqGadget<F> for UInt128 where
    F: PrimeField
[src]

impl<F> EvaluateLtGadget<F> for UInt128 where
    F: Field + PrimeField
[src]

impl PartialEq<UInt128> for UInt128[src]

impl PartialOrd<UInt128> for UInt128[src]

impl<F> ToBytesGadget<F> for UInt128 where
    F: Field
[src]

impl UInt for UInt128[src]

pub fn negate(&self) -> UInt128[src]

Returns the inverse UInt128

pub fn is_constant(&self) -> bool[src]

Returns true if all bits in this UInt128 are constant

pub fn to_bits_le(&self) -> Vec<Boolean, Global>[src]

Turns this UInt128 into its little-endian byte order representation.

pub fn from_bits_le(bits: &[Boolean]) -> UInt128[src]

Converts a little-endian byte order representation of bits into a UInt128.

pub fn xor<F, CS>(
    &self,
    cs: CS,
    other: &UInt128
) -> Result<UInt128, SynthesisError> where
    CS: ConstraintSystem<F>,
    F: Field
[src]

XOR this UInt128 with another UInt128

pub fn addmany<F, CS>(
    cs: CS,
    operands: &[UInt128]
) -> Result<UInt128, SynthesisError> where
    CS: ConstraintSystem<F>,
    F: PrimeField
[src]

Perform modular addition of several UInt128 objects.

pub fn sub<F, CS>(
    &self,
    cs: CS,
    other: &UInt128
) -> Result<UInt128, SynthesisError> where
    CS: ConstraintSystem<F>,
    F: PrimeField
[src]

Perform modular subtraction of two UInt128 objects.

pub fn sub_unsafe<F, CS>(
    &self,
    cs: CS,
    other: &UInt128
) -> Result<UInt128, SynthesisError> where
    CS: ConstraintSystem<F>,
    F: PrimeField
[src]

Perform unsafe subtraction of two UInt128 objects which returns 0 if overflowed

pub fn mul<F, CS>(
    &self,
    cs: CS,
    other: &UInt128
) -> Result<UInt128, SynthesisError> where
    CS: ConstraintSystem<F>,
    F: PrimeField
[src]

Bitwise multiplication of two UInt128 objects. Reference: https://en.wikipedia.org/wiki/Binary_multiplier

pub fn div<F, CS>(
    &self,
    cs: CS,
    other: &UInt128
) -> Result<UInt128, SynthesisError> where
    CS: ConstraintSystem<F>,
    F: PrimeField
[src]

Perform long division of two UInt128 objects. Reference: https://en.wikipedia.org/wiki/Division_algorithm

pub fn pow<F, CS>(
    &self,
    cs: CS,
    other: &UInt128
) -> Result<UInt128, SynthesisError> where
    CS: ConstraintSystem<F>,
    F: Field + PrimeField
[src]

Bitwise multiplication of two UInt128 objects. Reference: /snarkVM/models/src/curves/field.rs

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<F, T> ConditionalOrEqualsGadget<F> for T where
    T: ConditionalEqGadget<F> + CondSelectGadget<F>,
    F: Field
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F, T> OrEqualsGadget<F> for T where
    T: ConditionalOrEqualsGadget<F>,
    F: Field
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,