pub struct UInt32 { /* private fields */ }
Expand description
Represents an interpretation of 32 Boolean
objects as an
unsigned integer.
Implementations§
Source§impl UInt32
impl UInt32
Sourcepub fn alloc<E: Engine, CS: ConstraintSystem<E>>(
cs: &mut CS,
value: Option<u32>,
) -> Result<Self, SynthesisError>
pub fn alloc<E: Engine, CS: ConstraintSystem<E>>( cs: &mut CS, value: Option<u32>, ) -> Result<Self, SynthesisError>
Allocate a UInt32
in the constraint system
pub fn into_bits_be(&self) -> Vec<Boolean>
pub fn from_bits_be(bits: &[Boolean]) -> Self
Sourcepub fn into_bits(&self) -> Vec<Boolean>
pub fn into_bits(&self) -> Vec<Boolean>
Turns this UInt32
into its little-endian byte order representation.
Sourcepub fn from_bits(bits: &[Boolean]) -> Self
pub fn from_bits(bits: &[Boolean]) -> Self
Converts a little-endian byte order representation of bits into a
UInt32
.
pub fn rotr(&self, by: usize) -> Self
pub fn shr(&self, by: usize) -> Self
Sourcepub fn sha256_maj<E, CS>(
cs: &mut CS,
a: &Self,
b: &Self,
c: &Self,
) -> Result<Self, SynthesisError>where
E: Engine,
CS: ConstraintSystem<E>,
pub fn sha256_maj<E, CS>(
cs: &mut CS,
a: &Self,
b: &Self,
c: &Self,
) -> Result<Self, SynthesisError>where
E: Engine,
CS: ConstraintSystem<E>,
Compute the maj
value (a and b) xor (a and c) xor (b and c)
during SHA256.
Sourcepub fn sha256_ch<E, CS>(
cs: &mut CS,
a: &Self,
b: &Self,
c: &Self,
) -> Result<Self, SynthesisError>where
E: Engine,
CS: ConstraintSystem<E>,
pub fn sha256_ch<E, CS>(
cs: &mut CS,
a: &Self,
b: &Self,
c: &Self,
) -> Result<Self, SynthesisError>where
E: Engine,
CS: ConstraintSystem<E>,
Compute the ch
value (a and b) xor ((not a) and c)
during SHA256.
Sourcepub fn xor<E: Engine, CS: ConstraintSystem<E>>(
&self,
cs: &mut CS,
other: &Self,
) -> Result<Self, SynthesisError>
pub fn xor<E: Engine, CS: ConstraintSystem<E>>( &self, cs: &mut CS, other: &Self, ) -> Result<Self, SynthesisError>
XOR this UInt32
with another UInt32
Sourcepub fn addmany<E, CS>(
cs: &mut CS,
operands: &[Self],
) -> Result<Self, SynthesisError>where
E: Engine,
CS: ConstraintSystem<E>,
pub fn addmany<E, CS>(
cs: &mut CS,
operands: &[Self],
) -> Result<Self, SynthesisError>where
E: Engine,
CS: ConstraintSystem<E>,
Perform modular addition of several UInt32
objects.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UInt32
impl RefUnwindSafe for UInt32
impl Send for UInt32
impl Sync for UInt32
impl Unpin for UInt32
impl UnwindSafe for UInt32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more