pub enum Opcode {
AssertZero(Expression),
BlackBoxFuncCall(BlackBoxFuncCall),
Directive(Directive),
MemoryOp {
block_id: BlockId,
op: MemOp,
predicate: Option<Expression>,
},
MemoryInit {
block_id: BlockId,
init: Vec<Witness>,
},
BrilligCall {
id: u32,
inputs: Vec<BrilligInputs>,
outputs: Vec<BrilligOutputs>,
predicate: Option<Expression>,
},
Call {
id: u32,
inputs: Vec<Witness>,
outputs: Vec<Witness>,
predicate: Option<Expression>,
},
}Variants§
AssertZero(Expression)
BlackBoxFuncCall(BlackBoxFuncCall)
Calls to “gadgets” which rely on backends implementing support for specialized constraints.
Often used for exposing more efficient implementations of SNARK-unfriendly computations.
Directive(Directive)
MemoryOp
Atomic operation on a block of memory
Fields
predicate: Option<Expression>Predicate of the memory operation - indicates if it should be skipped
MemoryInit
BrilligCall
Calls to unconstrained functions
Fields
id: u32Id for the function being called. It is the responsibility of the executor to fetch the appropriate Brillig bytecode from this id.
inputs: Vec<BrilligInputs>Inputs to the function call
outputs: Vec<BrilligOutputs>Outputs to the function call
predicate: Option<Expression>Predicate of the Brillig execution - indicates if it should be skipped
Call
Calls to functions represented as a separate circuit. A call opcode allows us to build a call stack when executing the outer-most circuit.
Fields
id: u32Id for the function being called. It is the responsibility of the executor to fetch the appropriate circuit from this id.
predicate: Option<Expression>Predicate of the circuit execution - indicates if it should be skipped
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Opcode
impl<'de> Deserialize<'de> for Opcode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Opcode
impl StructuralPartialEq for Opcode
Auto Trait Implementations§
impl Freeze for Opcode
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnwindSafe for Opcode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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