diff --git a/kimchi/src/circuits/polynomials/foreign_field_add/witness.rs b/kimchi/src/circuits/polynomials/foreign_field_add/witness.rs index c10db4d294..c54236197b 100644 --- a/kimchi/src/circuits/polynomials/foreign_field_add/witness.rs +++ b/kimchi/src/circuits/polynomials/foreign_field_add/witness.rs @@ -127,7 +127,7 @@ fn compute_ffadd_values( /// opcode: true for addition, false for subtraction /// modulus: modulus of the foreign field pub fn create_chain( - inputs: &Vec, + inputs: &[BigUint], opcodes: &[FFOps], modulus: BigUint, ) -> [Vec; COLUMNS] { diff --git a/kimchi/src/tests/foreign_field_add.rs b/kimchi/src/tests/foreign_field_add.rs index 55b6bcebbd..97697d635c 100644 --- a/kimchi/src/tests/foreign_field_add.rs +++ b/kimchi/src/tests/foreign_field_add.rs @@ -259,7 +259,7 @@ fn full_circuit( // Creates the witness with the public input for FFAdd containing the 1 value fn short_witness( - inputs: &Vec, + inputs: &[BigUint], opcodes: &[FFOps], modulus: BigUint, ) -> [Vec; COLUMNS] { @@ -277,7 +277,7 @@ fn short_witness( // opcode: true for addition, false for subtraction // modulus: modulus of the foreign field fn long_witness( - inputs: &Vec, + inputs: &[BigUint], opcodes: &[FFOps], modulus: BigUint, ) -> [Vec; COLUMNS] { @@ -1406,7 +1406,7 @@ where // Compute addition witness let witness = short_witness( - &vec![left_input, right_input], + &[left_input, right_input], &[FFOps::Add], foreign_field_modulus.clone(), ); @@ -1481,7 +1481,7 @@ fn test_ffadd_finalization() { let left = modulus.clone() - BigUint::one(); let right = modulus.clone() - BigUint::one(); // create a chain of 1 addition - let add_witness = witness::create_chain::(&vec![left, right], operation, modulus); + let add_witness = witness::create_chain::(&[left, right], operation, modulus); for col in 0..COLUMNS { witness[col].extend(add_witness[col].iter()); } @@ -1553,7 +1553,7 @@ fn test_gate_invalid_foreign_field_modulus() { #[test] fn test_witness_max_foreign_field_modulus() { short_witness::( - &vec![BigUint::zero(), BigUint::zero()], + &[BigUint::zero(), BigUint::zero()], &[FFOps::Add], BigUint::max_foreign_field_modulus::(), ); @@ -1563,7 +1563,7 @@ fn test_witness_max_foreign_field_modulus() { #[should_panic] fn test_witness_invalid_foreign_field_modulus() { short_witness::( - &vec![BigUint::zero(), BigUint::zero()], + &[BigUint::zero(), BigUint::zero()], &[FFOps::Add], BigUint::max_foreign_field_modulus::() + BigUint::one(), ); diff --git a/msm/src/prover.rs b/msm/src/prover.rs index 2ea2534da2..e342c80d3a 100644 --- a/msm/src/prover.rs +++ b/msm/src/prover.rs @@ -64,7 +64,7 @@ pub fn prove< >( domain: EvaluationDomains, srs: &OpeningProof::SRS, - constraints: &Vec>, + constraints: &[E], fixed_selectors: Box<[Vec; N_FSEL]>, inputs: ProofInputs, rng: &mut RNG, @@ -288,7 +288,7 @@ where // Compute ∑ α^i constraint_i as an expression let combined_expr = - Expr::combine_constraints(0..(constraints.len() as u32), constraints.clone()); + Expr::combine_constraints(0..(constraints.len() as u32), constraints.to_vec()); // We want to compute the quotient polynomial, i.e. // t(X) = (∑ α^i constraint_i(X)) / Z_H(X). diff --git a/msm/src/verifier.rs b/msm/src/verifier.rs index 74d0cd0769..523510d635 100644 --- a/msm/src/verifier.rs +++ b/msm/src/verifier.rs @@ -45,7 +45,7 @@ pub fn verify< >( domain: EvaluationDomains, srs: &OpeningProof::SRS, - constraints: &Vec>, + constraints: &[E], fixed_selectors: Box<[Vec; N_FSEL]>, proof: &Proof, public_inputs: Witness>, @@ -286,7 +286,7 @@ where }; let combined_expr = - Expr::combine_constraints(0..(constraints.len() as u32), constraints.clone()); + Expr::combine_constraints(0..(constraints.len() as u32), constraints.to_vec()); // Note the minus! ft polynomial at zeta (ft_eval0) is minus evaluation of the expression. let ft_eval0 = -PolishToken::evaluate( combined_expr.to_polish().as_slice(), diff --git a/mvpoly/src/pbt.rs b/mvpoly/src/pbt.rs index 130c6c9fc4..413003c706 100644 --- a/mvpoly/src/pbt.rs +++ b/mvpoly/src/pbt.rs @@ -9,7 +9,6 @@ //! use mvpoly::prime::Dense; //! use mina_curves::pasta::Fp; //! -//! #[test] //! fn test_mul_by_one() { //! mvpoly::pbt::test_mul_by_one::>(); //! mvpoly::pbt::test_mul_by_one::>(); diff --git a/poly-commitment/src/kzg.rs b/poly-commitment/src/kzg.rs index 958b2b494c..18322848b5 100644 --- a/poly-commitment/src/kzg.rs +++ b/poly-commitment/src/kzg.rs @@ -51,7 +51,7 @@ use std::ops::Neg; /// P2_1(ζ) + P2_2(ζ) * polyscale + P2_1(ζω) polyscale^2 + P2_2(ζω) * polyscale^3 /// ``` pub fn combine_evaluations( - evaluations: &Vec>, + evaluations: &[Evaluation], polyscale: G::ScalarField, ) -> Vec { let mut polyscale_i = G::ScalarField::one(); @@ -431,10 +431,10 @@ impl< /// Also, chunking is not supported. pub fn verify( &self, - srs: &PairingSRS, // SRS - evaluations: &Vec>, // commitments to the polynomials - polyscale: F, // scaling factor for polynoms - elm: &[F], // vector of evaluation points + srs: &PairingSRS, // SRS + evaluations: &[Evaluation], // commitments to the polynomials + polyscale: F, // scaling factor for polynoms + elm: &[F], // vector of evaluation points ) -> bool { let poly_commitment: G::Group = { let mut scalars: Vec = Vec::new(); diff --git a/poly-commitment/tests/kzg.rs b/poly-commitment/tests/kzg.rs index 0b553fa1fb..c5ce7710e7 100644 --- a/poly-commitment/tests/kzg.rs +++ b/poly-commitment/tests/kzg.rs @@ -38,7 +38,7 @@ fn test_combine_evaluations() { ], }; - let output = combine_evaluations::(&vec![eval_p1], polyscale); + let output = combine_evaluations::(&[eval_p1], polyscale); // We have 2 evaluation points. assert_eq!(output.len(), 2); // polyscale is not used. @@ -60,7 +60,7 @@ fn test_combine_evaluations() { ], }; - let output = combine_evaluations::(&vec![eval_p2], polyscale); + let output = combine_evaluations::(&[eval_p2], polyscale); // We have 2 evaluation points assert_eq!(output.len(), 2); // polyscale is not used. @@ -92,7 +92,7 @@ fn test_combine_evaluations() { ], }; - let output = combine_evaluations::(&vec![eval_p1, eval_p2], polyscale); + let output = combine_evaluations::(&[eval_p1, eval_p2], polyscale); // We have 2 evaluation points assert_eq!(output.len(), 2); let exp_output = [Fp::from(1 + 3 * 2), Fp::from(2 + 4 * 2)]; @@ -123,7 +123,7 @@ fn test_combine_evaluations() { ], }; - let output = combine_evaluations::(&vec![eval_p1, eval_p2], polyscale); + let output = combine_evaluations::(&[eval_p1, eval_p2], polyscale); // We have 2 evaluation points assert_eq!(output.len(), 2); let o1 = Fp::from(1 + 3 * 2 + 5 * 4 + 7 * 8);