From 956fdaa2b80ff72cda2eafefda3f62a57589ddbd Mon Sep 17 00:00:00 2001 From: Marcin Date: Thu, 25 Jan 2024 14:32:35 +0100 Subject: [PATCH] Repo maintenance: catch up with changes in `ark-poly`; bump version (#77) --- Cargo.toml | 2 +- src/gkr_round_sumcheck/data_structures.rs | 6 ++---- src/gkr_round_sumcheck/mod.rs | 6 ++++-- src/ml_sumcheck/data_structures.rs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index de84461..11fb80d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ark-linear-sumcheck" -version = "0.3.0" +version = "0.4.0" authors = [ "Tom Shen ", "arkworks contributors" diff --git a/src/gkr_round_sumcheck/data_structures.rs b/src/gkr_round_sumcheck/data_structures.rs index 9702eb1..14f5eba 100644 --- a/src/gkr_round_sumcheck/data_structures.rs +++ b/src/gkr_round_sumcheck/data_structures.rs @@ -2,7 +2,7 @@ use crate::ml_sumcheck::protocol::prover::ProverMsg; use ark_ff::Field; -use ark_poly::{DenseMultilinearExtension, MultilinearExtension, SparseMultilinearExtension}; +use ark_poly::{DenseMultilinearExtension, Polynomial, SparseMultilinearExtension}; use ark_std::vec::Vec; /// Proof for GKR Round Function @@ -50,9 +50,7 @@ impl GKRRoundSumcheckSubClaim { .chain(self.v.iter()) .copied() .collect(); - let actual_evaluation = f1.evaluate(&guv).unwrap() - * f2.evaluate(&self.u).unwrap() - * f3.evaluate(&self.v).unwrap(); + let actual_evaluation = f1.evaluate(&guv) * f2.evaluate(&self.u) * f3.evaluate(&self.v); actual_evaluation == self.expected_evaluation } diff --git a/src/gkr_round_sumcheck/mod.rs b/src/gkr_round_sumcheck/mod.rs index 5c0c622..dc605c6 100644 --- a/src/gkr_round_sumcheck/mod.rs +++ b/src/gkr_round_sumcheck/mod.rs @@ -11,7 +11,9 @@ use crate::ml_sumcheck::protocol::prover::ProverState; use crate::ml_sumcheck::protocol::{IPForMLSumcheck, ListOfProductsOfPolynomials, PolynomialInfo}; use crate::rng::FeedableRNG; use ark_ff::{Field, Zero}; -use ark_poly::{DenseMultilinearExtension, MultilinearExtension, SparseMultilinearExtension}; +use ark_poly::{ + DenseMultilinearExtension, MultilinearExtension, Polynomial, SparseMultilinearExtension, +}; use ark_std::marker::PhantomData; use ark_std::rc::Rc; use ark_std::vec::Vec; @@ -117,7 +119,7 @@ impl GKRRoundSumcheck { } let f1_gu = initialize_phase_two(&f1_g, &u); - let mut phase2_ps = start_phase2_sumcheck(&f1_gu, f3, f2.evaluate(&u).unwrap()); + let mut phase2_ps = start_phase2_sumcheck(&f1_gu, f3, f2.evaluate(&u)); let mut phase2_vm = None; let mut phase2_prover_msgs = Vec::with_capacity(dim); let mut v = Vec::with_capacity(dim); diff --git a/src/ml_sumcheck/data_structures.rs b/src/ml_sumcheck/data_structures.rs index 5db5445..17cbb21 100644 --- a/src/ml_sumcheck/data_structures.rs +++ b/src/ml_sumcheck/data_structures.rs @@ -1,7 +1,7 @@ //! Defines the data structures used by the `MLSumcheck` protocol. use ark_ff::Field; -use ark_poly::{DenseMultilinearExtension, MultilinearExtension}; +use ark_poly::{DenseMultilinearExtension, Polynomial}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::cmp::max; use ark_std::rc::Rc; @@ -102,7 +102,7 @@ impl ListOfProductsOfPolynomials { .map(|(c, p)| { *c * p .iter() - .map(|&i| self.flattened_ml_extensions[i].evaluate(point).unwrap()) + .map(|&i| self.flattened_ml_extensions[i].evaluate(&point.to_vec())) .product::() }) .sum()