Trait o1vm::interpreters::keccak::interpreter::Interpreter
source · pub trait Interpreter<F: One + Debug + Zero> {
type Variable: Mul<Self::Variable, Output = Self::Variable> + Add<Self::Variable, Output = Self::Variable> + Sub<Self::Variable, Output = Self::Variable> + Clone + Debug + One + Zero;
// Required methods
fn constant(x: u64) -> Self::Variable;
fn constant_field(x: F) -> Self::Variable;
fn variable(&self, column: KeccakColumn) -> Self::Variable;
fn constrain(
&mut self,
tag: Constraint,
if_true: Self::Variable,
x: Self::Variable
);
fn add_lookup(
&mut self,
if_true: Self::Variable,
lookup: RAMLookup<Self::Variable, LookupTableIDs>
);
}
Expand description
This trait includes functionalities needed to obtain the variables of the Keccak circuit needed for constraints and witness
Required Associated Types§
type Variable: Mul<Self::Variable, Output = Self::Variable> + Add<Self::Variable, Output = Self::Variable> + Sub<Self::Variable, Output = Self::Variable> + Clone + Debug + One + Zero
Required Methods§
sourcefn constant_field(x: F) -> Self::Variable
fn constant_field(x: F) -> Self::Variable
Creates a variable from a constant field element
sourcefn variable(&self, column: KeccakColumn) -> Self::Variable
fn variable(&self, column: KeccakColumn) -> Self::Variable
Returns the variable corresponding to a given column alias.
sourcefn constrain(
&mut self,
tag: Constraint,
if_true: Self::Variable,
x: Self::Variable
)
fn constrain( &mut self, tag: Constraint, if_true: Self::Variable, x: Self::Variable )
Adds one KeccakConstraint to the environment if the selector holds
sourcefn add_lookup(
&mut self,
if_true: Self::Variable,
lookup: RAMLookup<Self::Variable, LookupTableIDs>
)
fn add_lookup( &mut self, if_true: Self::Variable, lookup: RAMLookup<Self::Variable, LookupTableIDs> )
Adds a given Lookup to the environment if the condition holds