Struct ark_r1cs_std::bits::uint32::UInt32 [−][src]
This struct represent an unsigned
32
bit integer as a sequence of
32
Booleans.
This is the R1CS equivalent of the native
u32
unsigned integer type.
Implementations
impl<F: Field> UInt32<F>[src]
pub fn constant(value: u32) -> Self[src]
Construct a constant
U32
from the native
u32
type.
pub fn to_bits_le(&self) -> Vec<Boolean<F>>[src]
Turns self into the underlying little-endian bits.
pub fn from_bits_le(bits: &[Boolean<F>]) -> Self[src]
pub fn rotr(&self, by: usize) -> Self[src]
Rotates self to the right by by steps, wrapping around.
pub fn xor(&self, other: &Self) -> Result<Self, SynthesisError>[src]
Outputs self ^ other.
If at least one of self and other are constants, then this method
does not create any constraints or variables.
pub fn addmany(operands: &[Self]) -> Result<Self, SynthesisError> where
F: PrimeField, [src]
F: PrimeField,
Perform modular addition of operands.
The user must ensure that overflow does not occur.
Trait Implementations
impl<ConstraintF: Field> AllocVar<u32, ConstraintF> for UInt32<ConstraintF>[src]
fn new_variable<T: Borrow<u32>>(
cs: impl Into<Namespace<ConstraintF>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>[src]
cs: impl Into<Namespace<ConstraintF>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>[src]
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>[src]
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
fn new_witness<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>[src]
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
impl<F: Clone + Field> Clone for UInt32<F>[src]
impl<ConstraintF: Field> CondSelectGadget<ConstraintF> for UInt32<ConstraintF>[src]
fn conditionally_select(
cond: &Boolean<ConstraintF>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>[src]
cond: &Boolean<ConstraintF>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
fn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>[src]
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>
impl<F: Debug + Field> Debug for UInt32<F>[src]
impl<ConstraintF: Field> EqGadget<ConstraintF> for UInt32<ConstraintF>[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<ConstraintF>, SynthesisError>[src]
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
fn is_neq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>[src]
fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>[src]
fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>[src]
impl<F: Field> R1CSVar<F> for UInt32<F>[src]
type Value = u32
The type of the “native” value that Self represents in the constraint
system. Read more
fn cs(&self) -> ConstraintSystemRef<F>[src]
fn value(&self) -> Result<Self::Value, SynthesisError>[src]
fn is_constant(&self) -> bool[src]
impl<ConstraintF: Field> ToBytesGadget<ConstraintF> for UInt32<ConstraintF>[src]
fn to_bytes(&self) -> Result<Vec<UInt8<ConstraintF>>, SynthesisError>[src]
fn to_non_unique_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError>[src]
Auto Trait Implementations
impl<F> !RefUnwindSafe for UInt32<F>
impl<F> !Send for UInt32<F>
impl<F> !Sync for UInt32<F>
impl<F> Unpin for UInt32<F>
impl<F> !UnwindSafe for UInt32<F>
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,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub 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.
pub 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.
pub 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>,