namnc / circom-2-arithc

Circom interpreter to arithmetic circuit description
MIT License
33 stars 7 forks source link

Execute `ExpressionInfixOpcode` directly when dealing with integers #27

Closed brech1 closed 2 months ago

brech1 commented 2 months ago

The execute_op function is called whenever we need to operate on two integers (not signals). Transforming to our set of gates is limiting us to perform some operations, and is not really needed, we could operate any opcode directly.

/// Executes an operation, performing the specified arithmetic or logical computation.
pub fn execute_op(lhs: &u32, rhs: &u32, op: &ExpressionInfixOpcode) -> u32 {
    match op {
     ...
    }
}