Struct ark_r1cs_std::bits::uint32::UInt32 [−][src]
pub struct UInt32<F: Field> { /* fields omitted */ }
Expand description
This struct represent an unsigned
32
bit integer as a sequence of
32
Boolean
s.
This is the R1CS equivalent of the native
u32
unsigned integer type.
Implementations
Turns self
into the underlying little-endian bits.
Outputs self ^ other
.
If at least one of self
and other
are constants, then this method
does not create any constraints or variables.
Perform modular addition of operands
.
The user must ensure that overflow does not occur.
Trait Implementations
fn new_variable<T: Borrow<u32>>(
cs: impl Into<Namespace<ConstraintF>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_variable<T: Borrow<u32>>(
cs: impl Into<Namespace<ConstraintF>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
Allocates a new variable of type Self
in the ConstraintSystem
cs
.
The mode of allocation is decided by mode
. Read more
fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
Allocates a new constant of type Self
in the ConstraintSystem
cs
. Read more
fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
Allocates a new public input of type Self
in the ConstraintSystem
cs
. Read more
fn new_witness<T: Borrow<V>>(
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>
Allocates a new private witness of type Self
in the ConstraintSystem
cs
. Read more
fn conditionally_select(
cond: &Boolean<ConstraintF>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
fn conditionally_select(
cond: &Boolean<ConstraintF>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
If cond == &Boolean::TRUE
, then this returns true_value
; else,
returns false_value
. Read more
fn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>
fn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>
Returns an element of values
whose index in represented by position
.
position
is an array of boolean that represents an unsigned integer in big endian order. Read more
Output a Boolean
value representing whether self.value() == other.value()
. Read more
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
If should_enforce == true
, enforce that self
and other
are equal;
else, enforce a vacuously true statement. Read more
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
If should_enforce == true
, enforce that self
and other
are not
equal; else, enforce a vacuously true statement. Read more
Output a Boolean
value representing whether self.value() != other.value()
. Read more
Enforce that self
and other
are equal. Read more
Enforce that self
and other
are not equal. Read more
Auto Trait Implementations
impl<F> !RefUnwindSafe for UInt32<F>
impl<F> !UnwindSafe for UInt32<F>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V