Minor improvements to multiopen.

This commit is contained in:
Sean Bowe 2020-10-15 17:16:44 -06:00
parent 9d572c181d
commit 1e9f7f37c6
No known key found for this signature in database
GPG key ID: 95684257D8F8B031
2 changed files with 67 additions and 54 deletions

View file

@ -224,7 +224,8 @@ mod tests {
Fp::random(), Fp::random(),
]; ];
let queries = vec![ let build_queries = || {
vec![
MyQuery { MyQuery {
commitment: 0, commitment: 0,
point: points[0], point: points[0],
@ -275,10 +276,22 @@ mod tests {
point: points[4], point: points[4],
eval: Fp::random(), eval: Fp::random(),
}, },
]; ]
};
let queries = build_queries();
let (commitment_data, point_sets) = construct_intermediate_sets(queries); let (commitment_data, point_sets) = construct_intermediate_sets(queries);
// It shouldn't matter what the point or eval values are; we should get
// the same exact point sets again.
{
let new_queries = build_queries();
let (_, new_point_sets) = construct_intermediate_sets(new_queries);
assert_eq!(point_sets, new_point_sets);
}
let mut a = false; let mut a = false;
let mut a_set = 0; let mut a_set = 0;
let mut b = false; let mut b = false;

View file

@ -102,9 +102,9 @@ impl<C: CurveAffine> Proof<C> {
} else { } else {
f_poly.map(|f_poly| f_poly * x_5 + &poly) f_poly.map(|f_poly| f_poly * x_5 + &poly)
} }
}); })
.unwrap();
let f_poly = f_poly.unwrap();
let mut f_blind = Blind(C::Scalar::random()); let mut f_blind = Blind(C::Scalar::random());
let mut f_commitment = params.commit(&f_poly, f_blind).to_affine(); let mut f_commitment = params.commit(&f_poly, f_blind).to_affine();