Skip to content

Commit

Permalink
index: add param lookup tables
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Jul 11, 2023
1 parent 9a173c4 commit 3843756
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kimchi/wasm/src/pasta_fp_plonk_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ impl From<WasmPastaFpRuntimeTableCfg> for RuntimeTableCfg<Fp> {
pub fn caml_pasta_fp_plonk_index_create(
gates: &WasmGateVector,
public_: i32,
lookup_tables: WasmVector<WasmPastaFpLookupTable>,
runtime_table_cfgs: WasmVector<WasmPastaFpRuntimeTableCfg>,
prev_challenges: i32,
srs: &WasmSrs,
Expand All @@ -115,10 +116,14 @@ pub fn caml_pasta_fp_plonk_index_create(
let rust_runtime_table_cfgs: Vec<RuntimeTableCfg<Fp>> =
runtime_table_cfgs.into_iter().map(Into::into).collect();

let rust_lookup_tables : Vec<LookupTable<Fp>> =
lookup_tables.into_iter().map(Into::into).collect();

// create constraint system
let cs = match ConstraintSystem::<Fp>::create(gates)
.public(public_ as usize)
.prev_challenges(prev_challenges as usize)
.lookup(rust_lookup_tables)
.runtime(if rust_runtime_table_cfgs.is_empty() {
None
} else {
Expand Down
5 changes: 5 additions & 0 deletions kimchi/wasm/src/pasta_fq_plonk_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ impl WasmPastaFqRuntimeTableCfg {
pub fn caml_pasta_fq_plonk_index_create(
gates: &WasmGateVector,
public_: i32,
lookup_tables: WasmVector<WasmPastaFqLookupTable>,
runtime_table_cfgs: WasmVector<WasmPastaFqRuntimeTableCfg>,
prev_challenges: i32,
srs: &WasmSrs,
Expand All @@ -113,10 +114,14 @@ pub fn caml_pasta_fq_plonk_index_create(
let rust_runtime_table_cfgs: Vec<RuntimeTableCfg<Fq>> =
runtime_table_cfgs.into_iter().map(Into::into).collect();

let rust_lookup_tables : Vec<LookupTable<Fq>> =
lookup_tables.into_iter().map(Into::into).collect();

// create constraint system
let cs = match ConstraintSystem::<Fq>::create(gates)
.public(public_ as usize)
.prev_challenges(prev_challenges as usize)
.lookup(rust_lookup_tables)
.runtime(if rust_runtime_table_cfgs.is_empty() {
None
} else {
Expand Down

0 comments on commit 3843756

Please sign in to comment.