pub struct Incr {
pub input: Col<B8>,
pub carry_in: Col<B1>,
pub output: Col<B8>,
pub carry_out: Col<B1>,
pub merged: Col<B32>,
}
Expand description
Represents an increment operation with carry in a lookup table.
This struct holds columns for an 8-bit increment operation where:
input
is the 8-bit value to be incrementedcarry_in
is a 1-bit carry inputoutput
is the 8-bit result of the incrementcarry_out
is a 1-bit carry outputmerged
is a 32-bit encoding of all inputs and outputs for lookup
The increment operation computes: output = input + carry_in, with carry_out set if the result overflows 8 bits.
Fields§
§input: Col<B8>
§carry_in: Col<B1>
§output: Col<B8>
§carry_out: Col<B1>
§merged: Col<B32>
Implementations§
Source§impl Incr
impl Incr
Sourcepub fn new(
table: &mut TableBuilder<'_>,
lookup_chan: ChannelId,
input: Col<B8>,
carry_in: Col<B1>,
) -> Self
pub fn new( table: &mut TableBuilder<'_>, lookup_chan: ChannelId, input: Col<B8>, carry_in: Col<B1>, ) -> Self
Constructs a new increment gadget, registering the necessary columns in the table.
§Arguments
table
- The table builder to register columns with.lookup_chan
- The channel for lookup operations.input
- The input column (8 bits).carry_in
- The carry-in column (1 bit).
§Returns
An Incr
struct with all columns set up.
Sourcepub fn populate<P>(
&self,
witness: &mut TableWitnessSegment<'_, P>,
) -> Result<()>where
P: PackedFieldIndexable<Scalar = B128> + PackedExtension<B1> + PackedExtension<B8> + PackedExtension<B32>,
pub fn populate<P>(
&self,
witness: &mut TableWitnessSegment<'_, P>,
) -> Result<()>where
P: PackedFieldIndexable<Scalar = B128> + PackedExtension<B1> + PackedExtension<B8> + PackedExtension<B32>,
Auto Trait Implementations§
impl Freeze for Incr
impl RefUnwindSafe for Incr
impl Send for Incr
impl Sync for Incr
impl Unpin for Incr
impl UnwindSafe for Incr
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