Skip to content

Commit

Permalink
Merge pull request privacy-scaling-explorations#152 from input-output…
Browse files Browse the repository at this point in the history
…-hk/dev-bench/range-checks

Goldenfiles for range checks

This PR adds goldenfiles for the pow2 and generic range checks, so that we will have a comparison of how the general arithmetic gate changes the `EccChip`.
  • Loading branch information
ntc2 authored Mar 16, 2024
2 parents 6b4b5a3 + f96ee5b commit b1927fd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions halo2_gadgets/goldenfiles/cost-model/generic_range_check.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
max_deg,advice_columns,lookups,permutations,column_queries,point_sets,proof_size
6,2,1,3,19,4,2400
2 changes: 2 additions & 0 deletions halo2_gadgets/goldenfiles/cost-model/pow2_range_check.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
max_deg,advice_columns,lookups,permutations,column_queries,point_sets,proof_size
6,1,1,2,17,3,2240
10 changes: 10 additions & 0 deletions halo2_gadgets/src/utilities/generic_range_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,5 +423,15 @@ mod test {
}
}
}

#[test]
fn cost_model() {
use crate::utilities::cost_model::circuit_to_csv;
let b = -pallas::Base::from(1);
let x = pallas::Base::from(0);
let mode = Mode { x, b };
let circuit = MyCircuit::<pallas::Base> { mode };
circuit_to_csv(11, "generic_range_check", &[], circuit);
}
}
}
13 changes: 13 additions & 0 deletions halo2_gadgets/src/utilities/pow2_range_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,17 @@ mod tests {
test_any_error(mode);
}
}

#[test]
fn cost_model() {
use crate::utilities::cost_model::circuit_to_csv;
let circuit = MyCircuit {
mode: Mode::Pow2RangeCheck {
element: pallas::Base::ZERO,
num_bits: 254,
strict: true,
},
};
circuit_to_csv::<pallas::Base>(11, "pow2_range_check", &[], circuit);
}
}

0 comments on commit b1927fd

Please sign in to comment.