fix typos in comments

This commit is contained in:
poma 2020-01-17 22:17:29 +07:00
parent 7ba88b2e70
commit 82592ae2e7
No known key found for this signature in database
GPG Key ID: BA20CB01FE165657
2 changed files with 8 additions and 8 deletions

@ -62,7 +62,7 @@ pub struct BatchedAccumulator<E: Engine, P: PowersOfTauParameters> {
} }
impl<E:Engine, P: PowersOfTauParameters> BatchedAccumulator<E, P> { impl<E:Engine, P: PowersOfTauParameters> BatchedAccumulator<E, P> {
/// Calcualte the contibution hash from the resulting file. Original powers of tau implementaiton /// Calculate the contribution hash from the resulting file. Original powers of tau implementation
/// used a specially formed writer to write to the file and calculate a hash on the fly, but memory-constrained /// used a specially formed writer to write to the file and calculate a hash on the fly, but memory-constrained
/// implementation now writes without a particular order, so plain recalculation at the end /// implementation now writes without a particular order, so plain recalculation at the end
/// of the procedure is more efficient /// of the procedure is more efficient
@ -831,7 +831,7 @@ impl<E:Engine, P: PowersOfTauParameters> BatchedAccumulator<E, P> {
/// Due to large amount of data in a previous accumulator even in the compressed form /// Due to large amount of data in a previous accumulator even in the compressed form
/// this function can now work on compressed input. Output can be made in any form /// this function can now work on compressed input. Output can be made in any form
/// WARNING: Contributor does not have to check that values from challenge file were serialized /// WARNING: Contributor does not have to check that values from challenge file were serialized
/// corrently, but we may want to enforce it if a ceremony coordinator does not recompress the previous /// correctly, but we may want to enforce it if a ceremony coordinator does not recompress the previous
/// contribution into the new challenge file /// contribution into the new challenge file
pub fn transform( pub fn transform(
input_map: &Mmap, input_map: &Mmap,
@ -887,7 +887,7 @@ impl<E:Engine, P: PowersOfTauParameters> BatchedAccumulator<E, P> {
// Turn it all back into affine points // Turn it all back into affine points
for (projective, affine) in projective.iter().zip(bases.iter_mut()) { for (projective, affine) in projective.iter().zip(bases.iter_mut()) {
*affine = projective.into_affine(); *affine = projective.into_affine();
assert!(!affine.is_zero(), "your contribution happed to produce a point at infinity, please re-run"); assert!(!affine.is_zero(), "your contribution happened to produce a point at infinity, please re-run");
} }
} }
@ -923,7 +923,7 @@ impl<E:Engine, P: PowersOfTauParameters> BatchedAccumulator<E, P> {
batch_exp::<E, _>(&mut accumulator.alpha_tau_powers_g1, &taupowers[0..], Some(&key.alpha)); batch_exp::<E, _>(&mut accumulator.alpha_tau_powers_g1, &taupowers[0..], Some(&key.alpha));
batch_exp::<E, _>(&mut accumulator.beta_tau_powers_g1, &taupowers[0..], Some(&key.beta)); batch_exp::<E, _>(&mut accumulator.beta_tau_powers_g1, &taupowers[0..], Some(&key.beta));
accumulator.beta_g2 = accumulator.beta_g2.mul(key.beta).into_affine(); accumulator.beta_g2 = accumulator.beta_g2.mul(key.beta).into_affine();
assert!(!accumulator.beta_g2.is_zero(), "your contribution happed to produce a point at infinity, please re-run"); assert!(!accumulator.beta_g2.is_zero(), "your contribution happened to produce a point at infinity, please re-run");
accumulator.write_chunk(start, compress_the_output, output_map)?; accumulator.write_chunk(start, compress_the_output, output_map)?;
println!("Done processing {} powers of tau", end); println!("Done processing {} powers of tau", end);
} else { } else {
@ -957,7 +957,7 @@ impl<E:Engine, P: PowersOfTauParameters> BatchedAccumulator<E, P> {
batch_exp::<E, _>(&mut accumulator.tau_powers_g1, &taupowers[0..], None); batch_exp::<E, _>(&mut accumulator.tau_powers_g1, &taupowers[0..], None);
//accumulator.beta_g2 = accumulator.beta_g2.mul(key.beta).into_affine(); //accumulator.beta_g2 = accumulator.beta_g2.mul(key.beta).into_affine();
//assert!(!accumulator.beta_g2.is_zero(), "your contribution happed to produce a point at infinity, please re-run"); //assert!(!accumulator.beta_g2.is_zero(), "your contribution happened to produce a point at infinity, please re-run");
accumulator.write_chunk(start, compress_the_output, output_map)?; accumulator.write_chunk(start, compress_the_output, output_map)?;
println!("Done processing {} powers of tau", end); println!("Done processing {} powers of tau", end);

@ -70,9 +70,9 @@ pub fn keypair<R: Rng, E: Engine>(rng: &mut R, digest: &[u8]) -> (PublicKey<E>,
{ {
assert_eq!(digest.len(), 64); assert_eq!(digest.len(), 64);
// tau is a conribution to the "powers of tau", in a set of points of the form "tau^i * G" // tau is a contribution to the "powers of tau", in a set of points of the form "tau^i * G"
let tau = E::Fr::rand(rng); let tau = E::Fr::rand(rng);
// alpha and beta are a set of conrtibuitons in a form "alpha * tau^i * G" and that are required // alpha and beta are a set of contributions in a form "alpha * tau^i * G" and that are required
// for construction of the polynomials // for construction of the polynomials
let alpha = E::Fr::rand(rng); let alpha = E::Fr::rand(rng);
let beta = E::Fr::rand(rng); let beta = E::Fr::rand(rng);
@ -99,7 +99,7 @@ pub fn keypair<R: Rng, E: Engine>(rng: &mut R, digest: &[u8]) -> (PublicKey<E>,
((g1_s, g1_s_x), g2_s_x) ((g1_s, g1_s_x), g2_s_x)
}; };
// these "public keys" are requried for for next participants to check that points are in fact // these "public keys" are required for for next participants to check that points are in fact
// sequential powers // sequential powers
let pk_tau = op(tau, 0); let pk_tau = op(tau, 0);
let pk_alpha = op(alpha, 1); let pk_alpha = op(alpha, 1);