Struct acvm_stdlib::blackbox_fallbacks::UInt32
source · pub struct UInt32 { /* private fields */ }
Expand description
UInt contains a witness that points to a field element that represents a u32 integer It has a inner field of type Witness that points to the field element and width = 32
Implementations§
source§impl UInt32
impl UInt32
sourcepub fn euclidean_division(
lhs: &UInt32,
rhs: &UInt32,
num_witness: u32
) -> (UInt32, UInt32, Vec<Opcode>, u32)
pub fn euclidean_division( lhs: &UInt32, rhs: &UInt32, num_witness: u32 ) -> (UInt32, UInt32, Vec<Opcode>, u32)
Returns the quotient and remainder such that lhs = rhs * quotient + remainder
sourcepub fn rol(&self, rotation: u32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
pub fn rol(&self, rotation: u32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
Rotate left rotation
bits. (x << rotation) | (x >> (width - rotation))
sourcepub fn ror(&self, rotation: u32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
pub fn ror(&self, rotation: u32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
Rotate right rotation
bits. (x >> rotation) | (x << (width - rotation))
sourcepub fn leftshift(
&self,
bits: u32,
num_witness: u32
) -> (UInt32, Vec<Opcode>, u32)
pub fn leftshift( &self, bits: u32, num_witness: u32 ) -> (UInt32, Vec<Opcode>, u32)
left shift by bits
sourcepub fn rightshift(
&self,
bits: u32,
num_witness: u32
) -> (UInt32, Vec<Opcode>, u32)
pub fn rightshift( &self, bits: u32, num_witness: u32 ) -> (UInt32, Vec<Opcode>, u32)
right shift by bits
sourcepub fn add(&self, rhs: &UInt32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
pub fn add(&self, rhs: &UInt32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
Caculate and constrain self
+ rhs
sourcepub fn sub(&self, rhs: &UInt32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
pub fn sub(&self, rhs: &UInt32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
Caculate and constrain self
- rhs
sourcepub fn and(&self, rhs: &UInt32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
pub fn and(&self, rhs: &UInt32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
Calculate and constrain self
and rhs
sourcepub fn xor(&self, rhs: &UInt32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
pub fn xor(&self, rhs: &UInt32, num_witness: u32) -> (UInt32, Vec<Opcode>, u32)
Calculate and constrain self
xor rhs
Trait Implementations§
Auto Trait Implementations§
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