This commit is contained in:
wborgeaud 2021-11-09 17:33:14 +01:00
parent 067f81e24f
commit 3717ff701e
3 changed files with 4 additions and 10 deletions

View File

@ -190,8 +190,8 @@ pub struct CommonCircuitData<F: RichField + Extendable<D>, const D: usize> {
/// The `{k_i}` valued used in `S_ID_i` in Plonk's permutation argument.
pub(crate) k_is: Vec<F>,
/// The number of partial products needed to compute the `Z` polynomials and the number
/// of partial products needed to compute the final product.
/// The number of partial products needed to compute the `Z` polynomials and
/// the number of original elements consumed in `partial_products()`.
pub(crate) num_partial_products: (usize, usize),
/// A digest of the "circuit" (i.e. the instance, minus public inputs), which can be used to

View File

@ -17,7 +17,7 @@ use crate::plonk::vanishing_poly::eval_vanishing_poly_base_batch;
use crate::plonk::vars::EvaluationVarsBase;
use crate::polynomial::polynomial::{PolynomialCoeffs, PolynomialValues};
use crate::timed;
use crate::util::partial_products::{check_partial_products, partial_products};
use crate::util::partial_products::partial_products;
use crate::util::timing::TimingTree;
use crate::util::{log2_ceil, transpose};

View File

@ -1,11 +1,7 @@
use std::iter::Product;
use std::ops::{MulAssign, Sub};
use crate::field::extension_field::target::ExtensionTarget;
use crate::field::extension_field::Extendable;
use crate::field::field_types::{Field, RichField};
use crate::plonk::circuit_builder::CircuitBuilder;
use crate::util::ceil_div_usize;
/// Compute partial products of the original vector `v` such that all products consist of `max_degree`
/// or less elements. This is done until we've computed the product `P` of all elements in the vector.
@ -38,7 +34,7 @@ pub fn num_partial_products(n: usize, max_degree: usize) -> (usize, usize) {
/// Checks that the partial products of `v` are coherent with those in `partials` by only computing
/// products of size `max_degree` or less.
pub fn check_partial_products<F: Field>(v: &[F], mut partials: &[F], max_degree: usize) -> Vec<F> {
pub fn check_partial_products<F: Field>(v: &[F], partials: &[F], max_degree: usize) -> Vec<F> {
debug_assert!(max_degree > 1);
let mut partials = partials.iter();
let mut res = Vec::new();
@ -86,8 +82,6 @@ pub fn check_partial_products_recursively<F: RichField + Extendable<D>, const D:
#[cfg(test)]
mod tests {
use num::Zero;
use super::*;
use crate::field::goldilocks_field::GoldilocksField;