Struct snarkvm_wasm::traits::utilities::uint::UInt8 [−][src]
Fields
bits: Vec<Boolean, Global>negated: boolvalue: Option<u8>Implementations
impl UInt8[src]
impl UInt8[src]pub fn constant_vec(values: &[u8]) -> Vec<UInt8, Global>[src]
pub fn constant_vec(values: &[u8]) -> Vec<UInt8, Global>[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<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Into<Option<u8>> + Copy,
F: Field, [src]
cs: CS,
values: &[T]
) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>,
T: Into<Option<u8>> + Copy,
F: Field,
pub fn alloc_input_vec_le<F, CS>(
cs: CS,
values: &[u8]
) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>,
F: PrimeField, [src]
pub fn alloc_input_vec_le<F, CS>(
cs: CS,
values: &[u8]
) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>,
F: PrimeField, [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> AllocGadget<<UInt8 as Integer>::IntegerType, F> for UInt8 where
F: Field, [src]
impl<F> AllocGadget<<UInt8 as Integer>::IntegerType, F> for UInt8 where
F: Field, [src]pub fn alloc<Fn, T, CS>(cs: CS, value_gen: Fn) -> Result<UInt8, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<<UInt8 as Integer>::IntegerType>, [src]
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<<UInt8 as Integer>::IntegerType>,
pub fn alloc_input<Fn, T, CS>(
cs: CS,
value_gen: Fn
) -> Result<UInt8, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<<UInt8 as Integer>::IntegerType>, [src]
cs: CS,
value_gen: Fn
) -> Result<UInt8, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<<UInt8 as Integer>::IntegerType>,
fn alloc_constant<Fn, T, CS>(_cs: CS, _f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>, [src]
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
fn alloc_checked<Fn, T, CS>(cs: CS, f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>, [src]
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
fn alloc_input_checked<Fn, T, CS>(cs: CS, f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>, [src]
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
impl<F> ComparatorGadget<F> for UInt8 where
F: Field + PrimeField, [src]
impl<F> ComparatorGadget<F> for UInt8 where
F: Field + PrimeField, [src]fn greater_than<CS>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>,
fn less_than_or_equal<CS>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>,
fn greater_than_or_equal<CS>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>,
impl<F> CondSelectGadget<F> for UInt8 where
F: PrimeField, [src]
impl<F> CondSelectGadget<F> for UInt8 where
F: PrimeField, [src]pub fn conditionally_select<CS>(
cs: CS,
cond: &Boolean,
first: &UInt8,
second: &UInt8
) -> Result<UInt8, SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
cond: &Boolean,
first: &UInt8,
second: &UInt8
) -> Result<UInt8, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> ConditionalEqGadget<F> for UInt8 where
F: Field, [src]
impl<F> ConditionalEqGadget<F> for UInt8 where
F: Field, [src]pub fn conditional_enforce_equal<CS>(
&self,
cs: CS,
other: &UInt8,
condition: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &UInt8,
condition: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<F> Div<F, UInt8> for UInt8 where
F: PrimeField, [src]
impl<F> Div<F, UInt8> for UInt8 where
F: PrimeField, [src]impl<F> EqGadget<F> for UInt8 where
F: Field, [src]
impl<F> EqGadget<F> for UInt8 where
F: Field, [src]fn is_eq<CS>(&self, _cs: CS, _other: &Self) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>, [src]
fn is_eq<CS>(&self, _cs: CS, _other: &Self) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>, [src]Output a Boolean value representing whether self.value() == other.value(). Read more
fn enforce_equal<CS>(&self, cs: CS, other: &Self) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
fn cost() -> usize[src]
impl<F> EvaluateEqGadget<F> for UInt8 where
F: PrimeField, [src]
impl<F> EvaluateEqGadget<F> for UInt8 where
F: PrimeField, [src]pub fn evaluate_equal<CS>(
&self,
cs: CS,
other: &UInt8
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &UInt8
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>,
impl<F> EvaluateLtGadget<F> for UInt8 where
F: Field + PrimeField, [src]
impl<F> EvaluateLtGadget<F> for UInt8 where
F: Field + PrimeField, [src]pub fn less_than<CS>(
&self,
cs: CS,
other: &UInt8
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &UInt8
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<F>,
impl Integer for UInt8[src]
impl Integer for UInt8[src]type IntegerType = u8
pub const SIZE: usize[src]
pub fn constant(value: u8) -> UInt8[src]
pub fn one() -> UInt8[src]
pub fn zero() -> UInt8[src]
pub fn new(
bits: Vec<Boolean, Global>,
value: Option<<UInt8 as Integer>::IntegerType>
) -> UInt8[src]
bits: Vec<Boolean, Global>,
value: Option<<UInt8 as Integer>::IntegerType>
) -> UInt8
pub fn is_constant(&self) -> bool[src]
pub fn is_constant(&self) -> bool[src]Returns true if all bits in this Int are constant
pub fn to_bits_le(&self) -> Vec<Boolean, Global>[src]
pub fn from_bits_le(bits: &[Boolean]) -> UInt8[src]
pub fn get_value(&self) -> Option<String>[src]
fn result_is_constant(first: &Self, second: &Self) -> bool[src]
fn result_is_constant(first: &Self, second: &Self) -> bool[src]Returns true if both Int objects have constant bits
impl PartialOrd<UInt8> for UInt8[src]
impl PartialOrd<UInt8> for UInt8[src]pub fn partial_cmp(&self, other: &UInt8) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &UInt8) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<F> Pow<F, UInt8> for UInt8 where
F: PrimeField, [src]
impl<F> Pow<F, UInt8> for UInt8 where
F: PrimeField, [src]impl<F> Sub<F, UInt8> for UInt8 where
F: PrimeField, [src]
impl<F> Sub<F, UInt8> for UInt8 where
F: PrimeField, [src]pub fn sub_unsafe<CS>(
&self,
cs: CS,
other: &UInt8
) -> Result<UInt8, <UInt8 as Sub<F, UInt8>>::ErrorType> where
CS: ConstraintSystem<F>, [src]
pub fn sub_unsafe<CS>(
&self,
cs: CS,
other: &UInt8
) -> Result<UInt8, <UInt8 as Sub<F, UInt8>>::ErrorType> where
CS: ConstraintSystem<F>, [src]Used for division. Evaluates a - b, and when a - b < 0, returns 0.
impl<F> ToBytesGadget<F> for UInt8 where
F: Field, [src]
impl<F> ToBytesGadget<F> for UInt8 where
F: Field, [src]pub fn to_bytes<CS>(
&self,
_cs: CS
) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
_cs: CS
) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn to_bytes_strict<CS>(
&self,
cs: CS
) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>, [src]
pub fn to_bytes_strict<CS>(
&self,
cs: CS
) -> Result<Vec<UInt8, Global>, SynthesisError> where
CS: ConstraintSystem<F>, [src]Additionally checks if the produced list of booleans is ‘valid’.
impl UInt for UInt8[src]
impl UInt for UInt8[src]pub fn addmany<F, CS>(
cs: CS,
operands: &[UInt8]
) -> Result<UInt8, SynthesisError> where
CS: ConstraintSystem<F>,
F: PrimeField, [src]
pub fn addmany<F, CS>(
cs: CS,
operands: &[UInt8]
) -> Result<UInt8, SynthesisError> where
CS: ConstraintSystem<F>,
F: PrimeField, [src]Perform modular addition of several UInt objects.
pub fn mul<F, CS>(
&self,
cs: CS,
other: &UInt8
) -> Result<UInt8, UnsignedIntegerError> 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]Perform Bitwise multiplication of two UInt objects.
Reference: https://en.wikipedia.org/wiki/Binary_multiplier Read more
impl<F> Xor<F, UInt8> for UInt8 where
F: PrimeField, [src]
impl<F> Xor<F, UInt8> for UInt8 where
F: PrimeField, [src]pub fn xor<CS>(&self, cs: CS, other: &UInt8) -> Result<UInt8, SynthesisError> where
CS: ConstraintSystem<F>, [src]
CS: ConstraintSystem<F>,
impl Eq for UInt8[src]
Auto Trait Implementations
impl RefUnwindSafe for UInt8
impl Send for UInt8
impl Sync for UInt8
impl Unpin for UInt8
impl UnwindSafe for UInt8
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<F, T> ConditionalOrEqualsGadget<F> for T where
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
F: Field, [src]
impl<F, T> ConditionalOrEqualsGadget<F> for T where
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
F: Field, [src]pub fn conditional_enforce_equal_or<CS>(
cs: CS,
cond: &Boolean,
var: &T,
first: &T,
second: &T,
should_enforce: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
cond: &Boolean,
var: &T,
first: &T,
second: &T,
should_enforce: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]pub fn equivalent(&self, key: &K) -> bool[src]
pub fn equivalent(&self, key: &K) -> bool[src]Compare self to key and return true if they are equal.
impl<F, T> OrEqualsGadget<F> for T where
T: ConditionalOrEqualsGadget<F>,
F: Field, [src]
impl<F, T> OrEqualsGadget<F> for T where
T: ConditionalOrEqualsGadget<F>,
F: Field, [src]pub fn enforce_equal_or<CS>(
cs: CS,
cond: &Boolean,
var: &T,
first: &T,
second: &T
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
cond: &Boolean,
var: &T,
first: &T,
second: &T
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl<T> Pointable for T
impl<T> Pointable for Timpl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,