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

Commit

Permalink
Support streaming and fast i/o in contribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
porcuquine committed Jun 28, 2020
1 parent 0e98259 commit 21d2252
Show file tree
Hide file tree
Showing 3 changed files with 457 additions and 59 deletions.
30 changes: 16 additions & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,23 +799,18 @@ impl MPCParameters {
for (base, projective) in bases.iter_mut().zip(projective.iter_mut()) {
*projective = wnaf.base(base.into_projective(), 1).scalar(coeff);
}

C::Projective::batch_normalization(projective);
projective
.iter()
.zip(bases.iter_mut())
.for_each(|(projective, affine)| {
*affine = projective.into_affine();
});
});
}
})
.unwrap();

// Perform batch normalization
projective
.par_chunks_mut(chunk_size)
.for_each(|p| C::Projective::batch_normalization(p));

// Turn it all back into affine points
projective
.par_iter()
.zip(bases.par_iter_mut())
.for_each(|(projective, affine)| {
*affine = projective.into_affine();
});
}

let delta_inv = privkey.delta.inverse().expect("nonzero");
Expand Down Expand Up @@ -1131,7 +1126,14 @@ impl MPCParameters {
"small params are internally inconsistent wrt. G1 deltas"
);

let MPCSmall { delta_g1, delta_g2, h, l, contributions, .. } = contrib;
let MPCSmall {
delta_g1,
delta_g2,
h,
l,
contributions,
..
} = contrib;
self.params.vk.delta_g1 = delta_g1;
self.params.vk.delta_g2 = delta_g2;
self.params.h = Arc::new(h);
Expand Down
Loading

0 comments on commit 21d2252

Please sign in to comment.