mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-07 16:23:12 +00:00
chore: from_values takes ref
This commit is contained in:
parent
64cc1000e7
commit
7cc123e0a4
@ -722,15 +722,11 @@ mod tests {
|
|||||||
stark.generate_trace(input, 8, &mut timing)
|
stark.generate_trace(input, 8, &mut timing)
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Cloning this isn't great; consider having `from_values` accept a reference,
|
|
||||||
// or having `compute_permutation_z_polys` read trace values from the `PolynomialBatch`.
|
|
||||||
let cloned_trace_poly_values = timed!(timing, "clone", trace_poly_values.clone());
|
|
||||||
|
|
||||||
let trace_commitments = timed!(
|
let trace_commitments = timed!(
|
||||||
timing,
|
timing,
|
||||||
"compute trace commitment",
|
"compute trace commitment",
|
||||||
PolynomialBatch::<F, C, D>::from_values(
|
PolynomialBatch::<F, C, D>::from_values(
|
||||||
cloned_trace_poly_values,
|
&trace_poly_values,
|
||||||
config.fri_config.rate_bits,
|
config.fri_config.rate_bits,
|
||||||
false,
|
false,
|
||||||
config.fri_config.cap_height,
|
config.fri_config.cap_height,
|
||||||
|
|||||||
@ -102,14 +102,7 @@ where
|
|||||||
timing,
|
timing,
|
||||||
&format!("compute trace commitment for {:?}", table),
|
&format!("compute trace commitment for {:?}", table),
|
||||||
PolynomialBatch::<F, C, D>::from_values(
|
PolynomialBatch::<F, C, D>::from_values(
|
||||||
// TODO: Cloning this isn't great; consider having `from_values` accept a reference,
|
trace, rate_bits, false, cap_height, timing, None,
|
||||||
// or having `compute_permutation_z_polys` read trace values from the `PolynomialBatch`.
|
|
||||||
trace.clone(),
|
|
||||||
rate_bits,
|
|
||||||
false,
|
|
||||||
cap_height,
|
|
||||||
timing,
|
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -380,7 +373,7 @@ where
|
|||||||
timing,
|
timing,
|
||||||
"compute auxiliary polynomials commitment",
|
"compute auxiliary polynomials commitment",
|
||||||
PolynomialBatch::from_values(
|
PolynomialBatch::from_values(
|
||||||
auxiliary_polys,
|
&auxiliary_polys,
|
||||||
rate_bits,
|
rate_bits,
|
||||||
false,
|
false,
|
||||||
config.fri_config.cap_height,
|
config.fri_config.cap_height,
|
||||||
|
|||||||
@ -55,7 +55,7 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
|
|||||||
{
|
{
|
||||||
/// Creates a list polynomial commitment for the polynomials interpolating the values in `values`.
|
/// Creates a list polynomial commitment for the polynomials interpolating the values in `values`.
|
||||||
pub fn from_values(
|
pub fn from_values(
|
||||||
values: Vec<PolynomialValues<F>>,
|
values: &[PolynomialValues<F>],
|
||||||
rate_bits: usize,
|
rate_bits: usize,
|
||||||
blinding: bool,
|
blinding: bool,
|
||||||
cap_height: usize,
|
cap_height: usize,
|
||||||
@ -65,7 +65,11 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
|
|||||||
let coeffs = timed!(
|
let coeffs = timed!(
|
||||||
timing,
|
timing,
|
||||||
"IFFT",
|
"IFFT",
|
||||||
values.into_par_iter().map(|v| v.ifft()).collect::<Vec<_>>()
|
values
|
||||||
|
.into_par_iter()
|
||||||
|
.cloned()
|
||||||
|
.map(|v| v.ifft())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
);
|
);
|
||||||
|
|
||||||
Self::from_coeffs(
|
Self::from_coeffs(
|
||||||
|
|||||||
@ -1029,7 +1029,7 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
|||||||
let constants_sigmas_commitment = if commit_to_sigma {
|
let constants_sigmas_commitment = if commit_to_sigma {
|
||||||
let constants_sigmas_vecs = [constant_vecs, sigma_vecs.clone()].concat();
|
let constants_sigmas_vecs = [constant_vecs, sigma_vecs.clone()].concat();
|
||||||
PolynomialBatch::<F, C, D>::from_values(
|
PolynomialBatch::<F, C, D>::from_values(
|
||||||
constants_sigmas_vecs,
|
&constants_sigmas_vecs,
|
||||||
rate_bits,
|
rate_bits,
|
||||||
PlonkOracle::CONSTANTS_SIGMAS.blinding,
|
PlonkOracle::CONSTANTS_SIGMAS.blinding,
|
||||||
cap_height,
|
cap_height,
|
||||||
|
|||||||
@ -171,7 +171,7 @@ where
|
|||||||
timing,
|
timing,
|
||||||
"compute wires commitment",
|
"compute wires commitment",
|
||||||
PolynomialBatch::<F, C, D>::from_values(
|
PolynomialBatch::<F, C, D>::from_values(
|
||||||
wires_values,
|
&wires_values,
|
||||||
config.fri_config.rate_bits,
|
config.fri_config.rate_bits,
|
||||||
config.zero_knowledge && PlonkOracle::WIRES.blinding,
|
config.zero_knowledge && PlonkOracle::WIRES.blinding,
|
||||||
config.fri_config.cap_height,
|
config.fri_config.cap_height,
|
||||||
@ -238,7 +238,7 @@ where
|
|||||||
timing,
|
timing,
|
||||||
"commit to partial products, Z's and, if any, lookup polynomials",
|
"commit to partial products, Z's and, if any, lookup polynomials",
|
||||||
PolynomialBatch::from_values(
|
PolynomialBatch::from_values(
|
||||||
zs_partial_products_lookups,
|
&zs_partial_products_lookups,
|
||||||
config.fri_config.rate_bits,
|
config.fri_config.rate_bits,
|
||||||
config.zero_knowledge && PlonkOracle::ZS_PARTIAL_PRODUCTS.blinding,
|
config.zero_knowledge && PlonkOracle::ZS_PARTIAL_PRODUCTS.blinding,
|
||||||
config.fri_config.cap_height,
|
config.fri_config.cap_height,
|
||||||
|
|||||||
@ -55,9 +55,7 @@ where
|
|||||||
timing,
|
timing,
|
||||||
"compute trace commitment",
|
"compute trace commitment",
|
||||||
PolynomialBatch::<F, C, D>::from_values(
|
PolynomialBatch::<F, C, D>::from_values(
|
||||||
// TODO: Cloning this isn't great; consider having `from_values` accept a reference,
|
&trace_poly_values,
|
||||||
// or having `compute_permutation_z_polys` read trace values from the `PolynomialBatch`.
|
|
||||||
trace_poly_values.clone(),
|
|
||||||
rate_bits,
|
rate_bits,
|
||||||
false,
|
false,
|
||||||
cap_height,
|
cap_height,
|
||||||
@ -88,7 +86,7 @@ where
|
|||||||
timing,
|
timing,
|
||||||
"compute permutation Z commitments",
|
"compute permutation Z commitments",
|
||||||
PolynomialBatch::from_values(
|
PolynomialBatch::from_values(
|
||||||
permutation_z_polys,
|
&permutation_z_polys,
|
||||||
rate_bits,
|
rate_bits,
|
||||||
false,
|
false,
|
||||||
config.fri_config.cap_height,
|
config.fri_config.cap_height,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user