pub struct WideAdd<UX: UnsignedAddPrimitives, const BIT_LENGTH: usize> {
pub x_in: [Col<B1>; BIT_LENGTH],
pub y_in: [Col<B1>; BIT_LENGTH],
pub z_out: [Col<B1>; BIT_LENGTH],
pub final_carry_out: Col<B1>,
pub flags: U32AddFlags,
/* private fields */
}
Expand description
Gadget for unsigned addition using non-packed one-bit columns generic over u32
and u64
Fields§
§x_in: [Col<B1>; BIT_LENGTH]
§y_in: [Col<B1>; BIT_LENGTH]
§z_out: [Col<B1>; BIT_LENGTH]
§final_carry_out: Col<B1>
§flags: U32AddFlags
This gadget always exposes the final carry bit.
Implementations§
Source§impl<UX: UnsignedAddPrimitives, const BIT_LENGTH: usize> WideAdd<UX, BIT_LENGTH>
impl<UX: UnsignedAddPrimitives, const BIT_LENGTH: usize> WideAdd<UX, BIT_LENGTH>
pub fn new( table: &mut TableBuilder<'_>, x_in: [Col<B1>; BIT_LENGTH], y_in: [Col<B1>; BIT_LENGTH], flags: U32AddFlags, ) -> Self
pub fn populate<P>( &self, index: &mut TableWitnessSegment<'_, P>, ) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl<UX, const BIT_LENGTH: usize> Freeze for WideAdd<UX, BIT_LENGTH>
impl<UX, const BIT_LENGTH: usize> RefUnwindSafe for WideAdd<UX, BIT_LENGTH>where
UX: RefUnwindSafe,
impl<UX, const BIT_LENGTH: usize> Send for WideAdd<UX, BIT_LENGTH>where
UX: Send,
impl<UX, const BIT_LENGTH: usize> Sync for WideAdd<UX, BIT_LENGTH>where
UX: Sync,
impl<UX, const BIT_LENGTH: usize> Unpin for WideAdd<UX, BIT_LENGTH>where
UX: Unpin,
impl<UX, const BIT_LENGTH: usize> UnwindSafe for WideAdd<UX, BIT_LENGTH>where
UX: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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