Address review comments from @daira.

This commit is contained in:
Sean Bowe 2021-07-10 08:12:08 -06:00
parent 20653acc39
commit 1be7bf1df0
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
1 changed files with 7 additions and 9 deletions

View File

@ -63,6 +63,7 @@ impl Argument {
// We need to multiply by z(X) and (1 - (l_last(X) + l_blind(X))). This // We need to multiply by z(X) and (1 - (l_last(X) + l_blind(X))). This
// will never underflow because of the requirement of at least a degree // will never underflow because of the requirement of at least a degree
// 3 circuit for the permutation argument. // 3 circuit for the permutation argument.
assert!(pk.vk.cs.degree() >= 3);
let chunk_len = pk.vk.cs.degree() - 2; let chunk_len = pk.vk.cs.degree() - 2;
let blinding_factors = pk.vk.cs.blinding_factors(); let blinding_factors = pk.vk.cs.blinding_factors();
@ -251,19 +252,16 @@ impl<C: CurveAffine> Committed<C> {
.skip(1) .skip(1)
.zip(self.sets.iter()) .zip(self.sets.iter())
.map(|(set, last_set)| { .map(|(set, last_set)| {
( (set.permutation_product_coset.clone()
set.permutation_product_coset.clone(), - &last_set.permutation_product_coset_last.as_ref().unwrap())
last_set.permutation_product_coset_last.clone().unwrap(), * &pk.l0
)
}) })
.collect::<Vec<_>>() .collect::<Vec<_>>(),
.into_iter()
.map(move |(coset, coset_last)| (coset - &coset_last) * &pk.l0),
) )
// And for all the sets we enforce: // And for all the sets we enforce:
// (1 - (l_last + l_blind)) * ( // (1 - (l_last + l_blind)) * (
// z_i(\omega X) \prod (p(X) + \beta s_i(X) + \gamma) // z_i(\omega X) \prod_j (p(X) + \beta s_j(X) + \gamma)
// - z_i(X) \prod (p(X) + \delta^i \beta X + \gamma) // - z_i(X) \prod_j (p(X) + \delta^j \beta X + \gamma)
// ) // )
.chain( .chain(
self.sets self.sets