Evaluator
Expose logic to handle newly added opcodes
/// This module handles all of the binary operations between polynomials
pub mod add;
+pub mod and;
+pub mod bound_check;
+pub mod cast;
pub mod div;
pub mod equal;
pub mod mul;
pub mod neq;
pub mod sub;
+pub mod xor;
pub use add::handle_add_op;
+pub use and::handle_and_op;
+pub use bound_check::handle_greater_than_equal_op;
+pub use bound_check::handle_greater_than_op;
+pub use bound_check::handle_less_than_equal_op;
+pub use bound_check::handle_less_than_op;
+pub use cast::handle_cast_op;
pub use div::handle_div_op;
pub use equal::handle_equal_op;
pub use mul::handle_mul_op;
pub use neq::handle_neq_op;
pub use sub::handle_sub_op;
+pub use xor::handle_xor_op;
-use crate::{Environment, Evaluator, FieldElement, Gate, Polynomial};
+use crate::{Environment, Evaluator, FieldElement, Polynomial, Type};
/// Creates a new witness and constrains it to be the inverse of the polynomial passed in
pub fn invert(x: Polynomial, env: &mut Environment, evaluator: &mut Evaluator) -> Polynomial {
// Create a fresh witness
// XXX: We need to create a better function for fresh variables
let inter_var_name = format!("{}{}", "inverse_", evaluator.get_unique_value(),);
- evaluator.store_witness(inter_var_name.clone());
+ evaluator.store_witness(inter_var_name.clone(), Type::Witness);
let x_inv = evaluator.store_lone_variable(inter_var_name, env);
// Multiply inverse by original value
