diff --git a/circuit_definitions/Cargo.toml b/circuit_definitions/Cargo.toml index 39327bba..bfca0d74 100644 --- a/circuit_definitions/Cargo.toml +++ b/circuit_definitions/Cargo.toml @@ -24,6 +24,7 @@ zk_evm = {git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.4. derivative = "*" serde = {version = "1", features = ["derive"]} crossbeam = "0.8" +seq-macro = "0.3.5" [features] default = [] diff --git a/circuit_definitions/src/circuit_definitions/base_layer/ecrecover.rs b/circuit_definitions/src/circuit_definitions/base_layer/ecrecover.rs index 053d430d..29a23945 100644 --- a/circuit_definitions/src/circuit_definitions/base_layer/ecrecover.rs +++ b/circuit_definitions/src/circuit_definitions/base_layer/ecrecover.rs @@ -2,6 +2,10 @@ use derivative::*; use super::*; use crate::boojum::cs::traits::circuit::CircuitBuilder; +use zkevm_circuits::ecrecover::{ + decomp_table::*, ecrecover_function_entry_point, naf_abs_div2_table::*, + secp256k1::fixed_base_mul_table::*, +}; #[derive(Derivative, serde::Serialize, serde::Deserialize)] #[derivative(Clone, Copy, Debug, Default(bound = ""))] @@ -69,7 +73,10 @@ where share_constants: false, }, ); - + let builder = U8x4FMAGate::configure_builder( + builder, + GatePlacementStrategy::UseGeneralPurposeColumns, + ); let builder = ZeroCheckGate::configure_builder( builder, GatePlacementStrategy::UseGeneralPurposeColumns, @@ -87,6 +94,10 @@ where builder, GatePlacementStrategy::UseGeneralPurposeColumns, ); + let builder = UIntXAddGate::<8>::configure_builder( + builder, + GatePlacementStrategy::UseGeneralPurposeColumns, + ); let builder = DotProductGate::<4>::configure_builder( builder, GatePlacementStrategy::UseGeneralPurposeColumns, @@ -147,6 +158,31 @@ where let table = create_and8_table(); cs.add_lookup_table::(table); + let table = create_naf_abs_div2_table(); + cs.add_lookup_table::(table); + + let table = create_wnaf_decomp_table(); + cs.add_lookup_table::(table); + + seq_macro::seq!(C in 0..32 { + let table = create_fixed_base_mul_table::(); + cs.add_lookup_table::, 3>(table); + let table = create_fixed_base_mul_table::(); + cs.add_lookup_table::, 3>(table); + let table = create_fixed_base_mul_table::(); + cs.add_lookup_table::, 3>(table); + let table = create_fixed_base_mul_table::(); + cs.add_lookup_table::, 3>(table); + let table = create_fixed_base_mul_table::(); + cs.add_lookup_table::, 3>(table); + let table = create_fixed_base_mul_table::(); + cs.add_lookup_table::, 3>(table); + let table = create_fixed_base_mul_table::(); + cs.add_lookup_table::, 3>(table); + let table = create_fixed_base_mul_table::(); + cs.add_lookup_table::, 3>(table); + }); + let table = create_byte_split_table::(); cs.add_lookup_table::, 3>(table); let table = create_byte_split_table::();