Trait snarkvm_wasm::traits::utilities::uint::UInt[][src]

pub trait UInt: Integer {
    fn negate(&self) -> Self;
fn rotr(&self, by: usize) -> Self;
fn addmany<F, CS>(cs: CS, operands: &[Self]) -> Result<Self, SynthesisError>
    where
        CS: ConstraintSystem<F>,
        F: PrimeField
;
fn mul<F, CS>(
        &self,
        cs: CS,
        other: &Self
    ) -> Result<Self, UnsignedIntegerError>
    where
        CS: ConstraintSystem<F>,
        F: PrimeField
; }

Required methods

fn negate(&self) -> Self[src]

Returns the inverse UInt

fn rotr(&self, by: usize) -> Self[src]

Rotate self bits by size

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

Perform modular addition of several UInt objects.

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

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

Implementors

impl UInt for UInt8[src]

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

pub fn rotr(&self, by: usize) -> UInt8[src]

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

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

impl UInt for UInt16[src]

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

pub fn rotr(&self, by: usize) -> UInt16[src]

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

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

impl UInt for UInt32[src]

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

pub fn rotr(&self, by: usize) -> UInt32[src]

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

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

impl UInt for UInt64[src]

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

pub fn rotr(&self, by: usize) -> UInt64[src]

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

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

impl UInt for UInt128[src]

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

Returns the inverse 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 mul<F, CS>(
    &self,
    cs: CS,
    other: &UInt128
) -> Result<UInt128, UnsignedIntegerError> where
    CS: ConstraintSystem<F>,
    F: PrimeField
[src]

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

pub fn rotr(&self, by: usize) -> UInt128[src]