pub struct OpFlags<E: FieldElement> { /* private fields */ }
Expand description

Operation flags for all stack operations.

Computes all the operation flag values of the individual stack operations using intermediate values which helps in reducing the number of field multiplication operations being used in the calculation of the operation flag.

The operation flag values are computed separately for degree 7 and degree 6 and 4 stack operations. Only one flag will be set to ONE and rest all would be ZERO for an execution trace. It also computes the composite flags using individual stack operation flags for generic stack constraints.

Implementations§

source§

impl<E: FieldElement> OpFlags<E>

source

pub fn new(frame: &EvaluationFrame<E>) -> Self

Returns a new instance of OpFlags instantiated with all stack operation flags. It computes the following operations:

  • degree 7 operations which doesn’t shift the stack.
  • degree 7 operations which shifts the stack to the left.
  • degree 7 operations which shifts the stack to the right.
  • degree 6 and 4 operations.
  • composite flags for individual stack items whose value has been copied over.
  • composite flags for individual stack items which has been shifted to the left.
  • composite flags for individual stack items which has been shifted to the right.
  • composite flag for the stack if the stack has been shifted to the left.
  • composite flag for the stack if the stack has been shifted to the right.
  • composite flag if the current operation being executed is a control flow operation or not.
  • composite flag if the current operation being executed has a binary element constraint on the top element in the stack.
source

pub fn noop(&self) -> E

Operation Flag of NOOP operation.

source

pub fn eqz(&self) -> E

Operation Flag of EQZ operation.

source

pub fn neg(&self) -> E

Operation Flag of NEG operation.

source

pub fn inv(&self) -> E

Operation Flag of INV operation.

source

pub fn incr(&self) -> E

Operation Flag of INCR operation.

source

pub fn not(&self) -> E

Operation Flag of NOT operation.

source

pub fn fmpadd(&self) -> E

Operation Flag of FMPADD operation.

source

pub fn mload(&self) -> E

Operation Flag of MLOAD operation.

source

pub fn swap(&self) -> E

Operation Flag of SWAP operation.

source

pub fn movup2(&self) -> E

Operation Flag of MOVUP2 operation.

source

pub fn movdn2(&self) -> E

Operation Flag of MOVDN2 operation.

source

pub fn movup3(&self) -> E

Operation Flag of MOVUP3 operation.

source

pub fn movdn3(&self) -> E

Operation Flag of MOVDN3 operation.

source

pub fn advpopw(&self) -> E

Operation Flag of ADVPOPW operation.

source

pub fn expacc(&self) -> E

Operation Flag of EXPACC operation.

source

pub fn movup4(&self) -> E

Operation Flag of MOVUP4 operation.

source

pub fn movdn4(&self) -> E

Operation Flag of MOVDN4 operation.

source

pub fn movup5(&self) -> E

Operation Flag of MOVUP5 operation.

source

pub fn movdn5(&self) -> E

Operation Flag of MOVDN5 operation.

source

pub fn movup6(&self) -> E

Operation Flag of MOVUP6 operation.

source

pub fn movdn6(&self) -> E

Operation Flag of MOVDN6 operation.

source

pub fn movup7(&self) -> E

Operation Flag of MOVUP7 operation.

source

pub fn movdn7(&self) -> E

Operation Flag of MOVDN7 operation.

source

pub fn swapw(&self) -> E

Operation Flag of SWAPW operation.

source

pub fn movup8(&self) -> E

Operation Flag of MOVUP8 operation.

source

pub fn movdn8(&self) -> E

Operation Flag of MOVDN8 operation.

source

pub fn swapw2(&self) -> E

Operation Flag of SWAPW2 operation.

source

pub fn swapw3(&self) -> E

Operation Flag of SWAPW3 operation.

source

pub fn swapdw(&self) -> E

Operation Flag of SWAPDW operation.

source

pub fn ext2mul(&self) -> E

Operation Flag of EXT2MUL operation.

source

pub fn assert(&self) -> E

Operation Flag of ASSERT operation.

source

pub fn eq(&self) -> E

Operation Flag of EQ operation.

source

pub fn add(&self) -> E

Operation Flag of ADD operation.

source

pub fn mul(&self) -> E

Operation Flag of MUL operation.

source

pub fn and(&self) -> E

Operation Flag of AND operation.

source

pub fn or(&self) -> E

Operation Flag of OR operation.

source

pub fn u32and(&self) -> E

Operation Flag of U32AND operation.

source

pub fn u32xor(&self) -> E

Operation Flag of U32XOR operation.

source

pub fn drop(&self) -> E

Operation Flag of DROP operation.

source

pub fn cswap(&self) -> E

Operation Flag of CSWAP operation.

source

pub fn cswapw(&self) -> E

Operation Flag of CSWAPW operation.

source

pub fn mloadw(&self) -> E

Operation Flag of MLOADW operation.

source

pub fn mstore(&self) -> E

Operation Flag of MSTORE operation.

source

pub fn mstorew(&self) -> E

Operation Flag of MSTOREW operation.

source

pub fn fmpupdate(&self) -> E

Operation Flag of FMPUPDATE operation.

source

pub fn pad(&self) -> E

Operation Flag of PAD operation.

source

pub fn dup(&self) -> E

Operation Flag of DUP operation.

source

pub fn dup1(&self) -> E

Operation Flag of DUP1 operation.

source

pub fn dup2(&self) -> E

Operation Flag of DUP2 operation.

source

pub fn dup3(&self) -> E

Operation Flag of DUP3 operation.

source

pub fn dup4(&self) -> E

Operation Flag of DUP4 operation.

source

pub fn dup5(&self) -> E

Operation Flag of DUP5 operation.

source

pub fn dup6(&self) -> E

Operation Flag of DUP6 operation.

source

pub fn dup7(&self) -> E

Operation Flag of DUP7 operation.

source

pub fn dup9(&self) -> E

Operation Flag of DUP9 operation.

source

pub fn dup11(&self) -> E

Operation Flag of DUP11 operation.

source

pub fn dup13(&self) -> E

Operation Flag of DUP13 operation.

source

pub fn dup15(&self) -> E

Operation Flag of DUP15 operation.

source

pub fn advpop(&self) -> E

Operation Flag of ADVPOP operation.

source

pub fn sdepth(&self) -> E

Operation Flag of SDEPTH operation.

source

pub fn u32add(&self) -> E

Operation Flag of U32ADD operation.

source

pub fn u32sub(&self) -> E

Operation Flag of U32SUB operation.

source

pub fn u32mul(&self) -> E

Operation Flag of U32MUL operation.

source

pub fn u32div(&self) -> E

Operation Flag of U32DIV operation.

source

pub fn u32split(&self) -> E

Operation Flag of U32SPLIT operation.

source

pub fn u32assert2(&self) -> E

Operation Flag of U32ASSERT2 operation.

source

pub fn u32add3(&self) -> E

Operation Flag of U32ADD3 operation.

source

pub fn u32madd(&self) -> E

Operation Flag of U32MADD operation.

source

pub fn hperm(&self) -> E

Operation Flag of HPERM operation.

source

pub fn mpverify(&self) -> E

Operation Flag of MPVERIFY operation.

source

pub fn span(&self) -> E

Operation Flag of SPAN operation.

source

pub fn join(&self) -> E

Operation Flag of JOIN operation.

source

pub fn split(&self) -> E

Operation Flag of SPLIT operation.

source

pub fn loop_op(&self) -> E

Operation Flag of LOOP operation.

source

pub fn mrupdate(&self) -> E

Operation Flag of MRUPDATE operation.

source

pub fn push(&self) -> E

Operation Flag of PUSH operation.

source

pub fn call(&self) -> E

Operation Flag of CALL operation.

source

pub fn syscall(&self) -> E

Operation Flag of SYSCALL operation.

source

pub fn end(&self) -> E

Operation Flag of END operation.

source

pub fn repeat(&self) -> E

Operation Flag of REPEAT operation.

source

pub fn respan(&self) -> E

Operation Flag of RESPAN operation.

source

pub fn halt(&self) -> E

Operation Flag of HALT operation.

source

pub fn no_shift_at(&self, index: usize) -> E

Returns ONE when the stack item at the specified depth remains unchanged during an operation, and ZERO otherwise

source

pub fn left_shift_at(&self, index: usize) -> E

Returns ONE when the stack item at the specified depth shifts to the left during an operation, and ZERO otherwise. The left shift is not defined on the first postion in the stack and therefore, a ZERO is returned.

source

pub fn right_shift_at(&self, index: usize) -> E

Returns ONE when the stack item at the specified depth shifts to the right during an operation, and ZERO otherwise. The right shift is not defined on the last postion in the stack and therefore, a ZERO is returned.

source

pub fn right_shift(&self) -> E

Returns the flag when the stack operation shifts the flag to the right.

source

pub fn left_shift(&self) -> E

Returns the flag when the stack operation shifts the flag to the left.

source

pub fn control_flow(&self) -> E

Returns the flag when the stack operation is a control flow operation.

source

pub fn u32_rc_op(&self) -> E

Returns the flag when the stack operation is a u32 operation.

source

pub fn overflow(&self) -> E

Returns the flag if the stack overflow table contains values or not.

source

pub fn top_binary(&self) -> E

Returns the flag when the stack operation needs the top element to be binary.

Auto Trait Implementations§

§

impl<E> RefUnwindSafe for OpFlags<E>where E: RefUnwindSafe,

§

impl<E> Send for OpFlags<E>

§

impl<E> Sync for OpFlags<E>

§

impl<E> Unpin for OpFlags<E>where E: Unpin,

§

impl<E> UnwindSafe for OpFlags<E>where E: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.