Struct zkevm_circuits::util::word::WordLoHi
source · pub struct WordLoHi<T>(/* private fields */);
Expand description
Word
, special alias for Word2.
Implementations§
source§impl<T: Clone> WordLoHi<T>
impl<T: Clone> WordLoHi<T>
sourcepub fn into_lo_hi(self) -> (T, T)
pub fn into_lo_hi(self) -> (T, T)
Extract (move) lo and hi values
sourcepub fn into_value(self) -> WordLoHi<Value<T>>
pub fn into_value(self) -> WordLoHi<Value<T>>
Wrap Word
into WordLoHi<Value>
source§impl WordLoHi<Column<Advice>>
impl WordLoHi<Column<Advice>>
sourcepub fn query_advice<F: Field>(
&self,
meta: &mut VirtualCells<'_, F>,
at: Rotation
) -> WordLoHi<Expression<F>>
pub fn query_advice<F: Field>( &self, meta: &mut VirtualCells<'_, F>, at: Rotation ) -> WordLoHi<Expression<F>>
Query advice of Word of columns advice
source§impl<F: Field> WordLoHi<F>
impl<F: Field> WordLoHi<F>
sourcepub fn compress_f(&self) -> F
pub fn compress_f(&self) -> F
Convert address (h160) to single field element. This method is Address specific
source§impl<F: Field> WordLoHi<Expression<F>>
impl<F: Field> WordLoHi<Expression<F>>
sourcepub fn from_lo_unchecked(lo: Expression<F>) -> Self
pub fn from_lo_unchecked(lo: Expression<F>) -> Self
create word from lo limb with hi limb as 0. caller need to guaranteed to be 128 bits.
sourcepub fn select<T: Expr<F> + Clone>(
selector: T,
when_true: WordLoHi<T>,
when_false: WordLoHi<T>
) -> WordLoHi<Expression<F>>
pub fn select<T: Expr<F> + Clone>( selector: T, when_true: WordLoHi<T>, when_false: WordLoHi<T> ) -> WordLoHi<Expression<F>>
select based on selector. Here assume selector is 1/0 therefore no overflow check
sourcepub fn mul_selector(&self, selector: Expression<F>) -> Self
pub fn mul_selector(&self, selector: Expression<F>) -> Self
Assume selector is 1/0 therefore no overflow check
sourcepub fn add_unchecked(self, rhs: Self) -> Self
pub fn add_unchecked(self, rhs: Self) -> Self
No overflow check on lo/hi limbs
sourcepub fn sub_unchecked(self, rhs: Self) -> Self
pub fn sub_unchecked(self, rhs: Self) -> Self
No underflow check on lo/hi limbs
sourcepub fn mul_unchecked(self, rhs: Self) -> Self
pub fn mul_unchecked(self, rhs: Self) -> Self
No overflow check on lo/hi limbs
Methods from Deref<Target = WordLimbs<T, 2>>§
sourcepub fn query_advice<F: Field>(
&self,
meta: &mut VirtualCells<'_, F>,
at: Rotation
) -> WordLimbs<Expression<F>, N>
pub fn query_advice<F: Field>( &self, meta: &mut VirtualCells<'_, F>, at: Rotation ) -> WordLimbs<Expression<F>, N>
Query advice of WordLibs of columns advice
sourcepub fn to_expr<F: Field>(&self) -> WordLimbs<Expression<F>, N>
pub fn to_expr<F: Field>(&self) -> WordLimbs<Expression<F>, N>
Convert WordLimbs of u8 to WordLimbs of expressions
sourcepub fn assign_u256(
&self,
region: &mut CachedRegion<'_, '_, F>,
offset: usize,
word: Word
) -> Result<Vec<AssignedCell<F, F>>, Error>
pub fn assign_u256( &self, region: &mut CachedRegion<'_, '_, F>, offset: usize, word: Word ) -> Result<Vec<AssignedCell<F, F>>, Error>
assign u256 to wordlimbs
sourcepub fn assign_h160(
&self,
region: &mut CachedRegion<'_, '_, F>,
offset: usize,
h160: H160
) -> Result<Vec<AssignedCell<F, F>>, Error>
pub fn assign_h160( &self, region: &mut CachedRegion<'_, '_, F>, offset: usize, h160: H160 ) -> Result<Vec<AssignedCell<F, F>>, Error>
assign h160 to wordlimbs
sourcepub fn assign_u64(
&self,
region: &mut CachedRegion<'_, '_, F>,
offset: usize,
value: u64
) -> Result<Vec<AssignedCell<F, F>>, Error>
pub fn assign_u64( &self, region: &mut CachedRegion<'_, '_, F>, offset: usize, value: u64 ) -> Result<Vec<AssignedCell<F, F>>, Error>
assign u64 to wordlimbs
sourcepub fn to_word_n<const N2: usize>(&self) -> WordLimbs<Expression<F>, N2>
pub fn to_word_n<const N2: usize>(&self) -> WordLimbs<Expression<F>, N2>
convert from N cells to N2 expressions limbs
sourcepub fn is_zero_vartime(&self) -> bool
pub fn is_zero_vartime(&self) -> bool
Check if zero
sourcepub fn to_word_n<const N2: usize>(&self) -> WordLimbs<Expression<F>, N2>
pub fn to_word_n<const N2: usize>(&self) -> WordLimbs<Expression<F>, N2>
to_wordlimbs will aggregate nested expressions, which implies during expression evaluation it need more recursive call. if the converted limbs word will be used in many places, consider create new low limbs word, have equality constrain, then finally use low limbs elsewhere.
Trait Implementations§
source§impl<F: Field, E: Expr<F> + Clone> ExprVec<F> for WordLoHi<E>
impl<F: Field, E: Expr<F> + Clone> ExprVec<F> for WordLoHi<E>
source§fn to_expr_vec(&self) -> Vec<Expression<F>>
fn to_expr_vec(&self) -> Vec<Expression<F>>
source§impl<T: Clone + OpsIdentity<Output = T>> OpsIdentity for WordLoHi<T>
impl<T: Clone + OpsIdentity<Output = T>> OpsIdentity for WordLoHi<T>
source§impl<T: Clone + PartialEq> PartialEq for WordLoHi<T>
impl<T: Clone + PartialEq> PartialEq for WordLoHi<T>
impl<T: Copy> Copy for WordLoHi<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for WordLoHi<T>where
T: RefUnwindSafe,
impl<T> Send for WordLoHi<T>where
T: Send,
impl<T> Sync for WordLoHi<T>where
T: Sync,
impl<T> Unpin for WordLoHi<T>where
T: Unpin,
impl<T> UnwindSafe for WordLoHi<T>where
T: 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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.