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

Support streaming and raw i/o in contribution #10

Merged
merged 1 commit into from
Jun 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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