diff --git a/spartan_parallel/src/sparse_mlpoly.rs b/spartan_parallel/src/sparse_mlpoly.rs index fc85f109..f968ca09 100644 --- a/spartan_parallel/src/sparse_mlpoly.rs +++ b/spartan_parallel/src/sparse_mlpoly.rs @@ -13,6 +13,7 @@ use super::random::RandomTape; use super::timer::Timer; use super::transcript::{AppendToTranscript, ProofTranscript}; use core::cmp::Ordering; +use ff::Field; use merlin::Transcript; use serde::{Deserialize, Serialize}; @@ -20,11 +21,11 @@ use serde::{Deserialize, Serialize}; pub struct SparseMatEntry { row: usize, col: usize, - val: S, + val: S::BaseField, } impl SparseMatEntry { - pub fn new(row: usize, col: usize, val: S) -> Self { + pub fn new(row: usize, col: usize, val: S::BaseField) -> Self { SparseMatEntry { row, col, val } } } @@ -264,6 +265,7 @@ pub struct SparseMatPolyCommitment { batch_size: usize, num_ops: usize, num_mem_cells: usize, + // TODO: add mpcs commitment _phantom: S, } @@ -288,11 +290,11 @@ impl SparseMatPolynomial { self.M.len().next_power_of_two() } - fn sparse_to_dense_vecs(&self, N: usize) -> (Vec, Vec, Vec) { + fn sparse_to_dense_vecs(&self, N: usize) -> (Vec, Vec, Vec) { assert!(N >= self.get_num_nz_entries()); let mut ops_row: Vec = vec![0; N]; let mut ops_col: Vec = vec![0; N]; - let mut val: Vec = vec![S::field_zero(); N]; + let mut val: Vec = vec![S::BaseField::ZERO; N]; for i in 0..self.M.len() { ops_row[i] = self.M[i].row;