[][src]Struct snarkvm_models::gadgets::utilities::uint::unsigned_integer::UInt8

pub struct UInt8 {
    pub bits: Vec<Boolean>,
    pub negated: bool,
    pub value: Option<u8>,
}

Fields

bits: Vec<Boolean>negated: boolvalue: Option<u8>

Implementations

impl UInt8[src]

pub fn constant(value: u8) -> Self[src]

impl UInt8[src]

pub fn constant_vec(values: &[u8]) -> Vec<Self>[src]

Construct a constant vector of UInt8 from a vector of u8

pub fn alloc_vec<F, CS, T>(
    cs: CS,
    values: &[T]
) -> Result<Vec<Self>, SynthesisError> where
    F: Field,
    CS: ConstraintSystem<F>,
    T: Into<Option<u8>> + Copy
[src]

pub fn alloc_input_vec<F, CS>(
    cs: CS,
    values: &[u8]
) -> Result<Vec<Self>, SynthesisError> where
    F: PrimeField,
    CS: ConstraintSystem<F>, 
[src]

Allocates a vector of u8's by first converting (chunks of) them to F elements, (thus reducing the number of input allocations), and then converts this list of F gadgets back into bytes.

Trait Implementations

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

type ErrorType = SynthesisError

impl<F: Field> AllocGadget<u8, F> for UInt8[src]

impl Clone for UInt8[src]

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

impl<F: PrimeField> CondSelectGadget<F> for UInt8[src]

impl<F: Field> ConditionalEqGadget<F> for UInt8[src]

impl Debug for UInt8[src]

impl Eq for UInt8[src]

impl<F: Field> EqGadget<F> for UInt8[src]

impl<F: PrimeField> EvaluateEqGadget<F> for UInt8[src]

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

impl PartialEq<UInt8> for UInt8[src]

impl PartialOrd<UInt8> for UInt8[src]

impl<F: Field> ToBytesGadget<F> for UInt8[src]

impl UInt for UInt8[src]

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

Used for division. Evaluates a - b, and when a - b < 0, returns 0.

Auto Trait Implementations

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
    F: Field,
    T: ConditionalEqGadget<F> + CondSelectGadget<F>, 
[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
    F: Field,
    T: ConditionalOrEqualsGadget<F>, 
[src]

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>,