Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Commit

Permalink
Threshold Cleanup (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Lazovic authored Sep 21, 2023
1 parent 5473dd1 commit dc6bf03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions eigentrust-zk/src/circuits/threshold/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ impl<
let scale = max_limb_value.clone();

let mut val = limbs[0].clone();
for i in 1..NUM_LIMBS {
for i in 1..limbs.len() {
let mul_add_chipset = MulAddChipset::new(val, scale.clone(), limbs[i].clone());
val = mul_add_chipset.synthesize(
&config.common,
Expand All @@ -539,7 +539,7 @@ impl<
let scale = max_limb_value;

let mut val = limbs[0].clone();
for i in 1..NUM_LIMBS {
for i in 1..limbs.len() {
let mul_add_chipset = MulAddChipset::new(val, scale.clone(), limbs[i].clone());
val = mul_add_chipset.synthesize(
&config.common,
Expand Down Expand Up @@ -968,7 +968,7 @@ mod tests {
&sets, &scores, &num_decomposed, &den_decomposed, svk, snarks, as_proof,
);

let k = 12;
let k = 21;
let prover = match MockProver::<N>::run(k, &threshold_circuit, vec![pub_ins]) {
Ok(prover) => prover,
Err(e) => panic!("{}", e),
Expand Down Expand Up @@ -1067,7 +1067,7 @@ mod tests {
&sets, &scores, &num_decomposed, &den_decomposed, svk, snarks, as_proof,
);

let k = 12;
let k = 21;
let rng = &mut rand::thread_rng();
let params = generate_params(k);
let res =
Expand Down
4 changes: 3 additions & 1 deletion eigentrust-zk/src/verifier/aggregator/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use halo2::{
},
transcript::{TranscriptReadBuffer, TranscriptWriterBuffer},
};
use itertools::Itertools;
use rand::{thread_rng, RngCore};
use snark_verifier::{
pcs::{
Expand Down Expand Up @@ -75,7 +76,8 @@ where
params: &ParamsKZG<E>, circuit: C, instances: Vec<Vec<E::Scalar>>, rng: &mut R,
) -> Self {
let pk = gen_pk(params, &circuit);
let config = Config::kzg().with_num_instance(vec![instances.len()]);
let inst_len = instances.iter().map(|x| x.len()).collect_vec();
let config = Config::kzg().with_num_instance(inst_len);

let protocol = compile(params, pk.get_vk(), config);

Expand Down

0 comments on commit dc6bf03

Please sign in to comment.