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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.