Skip to content

Commit 85fbd37

Browse files
author
Kunming Jiang
committed
Minor fixes
1 parent 98fd060 commit 85fbd37

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

spartan_parallel/src/lib.rs

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ impl<E: ExtensionField, Pcs: PolynomialCommitmentScheme<E>> VerifierWitnessSecIn
562562
VerifierWitnessSecInfo {
563563
num_inputs: vec![1],
564564
num_proofs: vec![1],
565-
comm_w: vec![Pcs::Commitment::default()],
565+
comm_w: Vec::new(),
566566
}
567567
}
568568

@@ -1686,8 +1686,7 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
16861686
] {
16871687
match op_comm {
16881688
Some(comm) => {
1689-
Pcs::write_commitment(comm, transcript);
1690-
()
1689+
Pcs::write_commitment(comm, transcript).unwrap()
16911690
},
16921691
None => (),
16931692
}
@@ -1751,7 +1750,7 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
17511750
&vir_mem_addr_w3_v_comm,
17521751
&vir_mem_addr_w3_shifted_v_comm,
17531752
] {
1754-
Pcs::write_commitment(comm, transcript);
1753+
Pcs::write_commitment(comm, transcript).unwrap();
17551754
}
17561755

17571756
let vir_mem_addr_w2_prover =
@@ -1794,9 +1793,9 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
17941793
let (block_vars_prover, block_vars_v_comm_list) = Self::mats_to_prove_wit_sec(block_vars_mat, &poly_pp);
17951794
let (exec_inputs_prover, exec_inputs_v_comm) = Self::mat_to_prove_wit_sec(exec_inputs_list, &poly_pp);
17961795
for comm in block_vars_v_comm_list.iter() {
1797-
Pcs::write_commitment(comm, transcript);
1796+
Pcs::write_commitment(comm, transcript).unwrap();
17981797
}
1799-
Pcs::write_commitment(&exec_inputs_v_comm, transcript);
1798+
Pcs::write_commitment(&exec_inputs_v_comm, transcript).unwrap();
18001799

18011800
let init_phy_mems_prover = if total_num_init_phy_mem_accesses > 0 {
18021801
Self::mat_to_prover_wit_sec_no_commit(init_phy_mems_list)
@@ -1819,7 +1818,7 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
18191818
&addr_phy_mems_v_comm,
18201819
&addr_phy_mems_shifted_v_comm,
18211820
] {
1822-
Pcs::write_commitment(comm, transcript);
1821+
Pcs::write_commitment(comm, transcript).unwrap();
18231822
}
18241823

18251824
(addr_phy_mems_prover, Some(addr_phy_mems_v_comm), addr_phy_mems_shifted_prover, Some(addr_phy_mems_shifted_v_comm))
@@ -1840,7 +1839,7 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
18401839
&addr_vir_mems_shifted_v_comm,
18411840
&addr_ts_bits_v_comm,
18421841
] {
1843-
Pcs::write_commitment(comm, transcript);
1842+
Pcs::write_commitment(comm, transcript).unwrap();
18441843
}
18451844

18461845
(
@@ -2833,16 +2832,16 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
28332832
&self.perm_exec_w3_comm,
28342833
&self.perm_exec_w3_shifted_comm,
28352834
] {
2836-
Pcs::write_commitment(comm, transcript);
2835+
Pcs::write_commitment(comm, transcript).unwrap();
28372836
}
28382837
for comm in self.block_w2_comm_list.iter() {
2839-
Pcs::write_commitment(comm, transcript);
2838+
Pcs::write_commitment(comm, transcript).unwrap();
28402839
}
28412840
for comm in self.block_w3_comm_list.iter() {
2842-
Pcs::write_commitment(comm, transcript);
2841+
Pcs::write_commitment(comm, transcript).unwrap();
28432842
}
28442843
for comm in self.block_w3_shifted_comm_list.iter() {
2845-
Pcs::write_commitment(comm, transcript);
2844+
Pcs::write_commitment(comm, transcript).unwrap();
28462845
}
28472846

28482847
let (init_phy_mem_w2_verifier, init_phy_mem_w3_verifier, init_phy_mem_w3_shifted_verifier) = {
@@ -2903,9 +2902,9 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
29032902

29042903
let (vir_mem_addr_w2_verifier, vir_mem_addr_w3_verifier, vir_mem_addr_w3_shifted_verifier) = {
29052904
if total_num_vir_mem_accesses > 0 {
2906-
Pcs::write_commitment(self.vir_mem_addr_w2_comm.as_ref().clone().expect("valid commitment expected"), transcript);
2907-
Pcs::write_commitment(self.vir_mem_addr_w3_comm.as_ref().clone().expect("valid commitment expected"), transcript);
2908-
Pcs::write_commitment(self.vir_mem_addr_w3_shifted_comm.as_ref().clone().expect("valid commitment expected"), transcript);
2905+
Pcs::write_commitment(self.vir_mem_addr_w2_comm.as_ref().clone().expect("valid commitment expected"), transcript).unwrap();
2906+
Pcs::write_commitment(self.vir_mem_addr_w3_comm.as_ref().clone().expect("valid commitment expected"), transcript).unwrap();
2907+
Pcs::write_commitment(self.vir_mem_addr_w3_shifted_comm.as_ref().clone().expect("valid commitment expected"), transcript).unwrap();
29092908

29102909
(
29112910
VerifierWitnessSecInfo::new(vec![VIR_MEM_WIDTH], &vec![total_num_vir_mem_accesses], vec![self.vir_mem_addr_w2_comm.clone().expect("valid commitment expected")]),
@@ -2924,9 +2923,9 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
29242923
let (block_vars_verifier, exec_inputs_verifier) = {
29252924
// add the commitment to the verifier's transcript
29262925
for comm in self.block_vars_comm_list.iter() {
2927-
Pcs::write_commitment(comm, transcript);
2926+
Pcs::write_commitment(comm, transcript).unwrap();
29282927
}
2929-
Pcs::write_commitment(&self.exec_inputs_comm, transcript);
2928+
Pcs::write_commitment(&self.exec_inputs_comm, transcript).unwrap();
29302929

29312930
(
29322931
VerifierWitnessSecInfo::new(block_num_vars, &block_num_proofs, self.block_vars_comm_list.clone()),
@@ -3007,8 +3006,8 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
30073006

30083007
let (addr_phy_mems_verifier, addr_phy_mems_shifted_verifier) = {
30093008
if total_num_phy_mem_accesses > 0 {
3010-
Pcs::write_commitment(&self.addr_phy_mems_comm.clone().expect("valid commitment expected"), transcript);
3011-
Pcs::write_commitment(&self.addr_phy_mems_shifted_comm.clone().expect("valid commitment expected"), transcript);
3009+
Pcs::write_commitment(&self.addr_phy_mems_comm.clone().expect("valid commitment expected"), transcript).unwrap();
3010+
Pcs::write_commitment(&self.addr_phy_mems_shifted_comm.clone().expect("valid commitment expected"), transcript).unwrap();
30123011

30133012
(
30143013
VerifierWitnessSecInfo::new(vec![PHY_MEM_WIDTH], &vec![total_num_phy_mem_accesses], vec![self.addr_phy_mems_comm.clone().expect("commitment should exist")]),
@@ -3024,9 +3023,9 @@ impl<E: ExtensionField + Send + Sync, Pcs: PolynomialCommitmentScheme<E>> SNARK<
30243023

30253024
let (addr_vir_mems_verifier, addr_vir_mems_shifted_verifier, addr_ts_bits_verifier) = {
30263025
if total_num_vir_mem_accesses > 0 {
3027-
Pcs::write_commitment(self.addr_vir_mems_comm.clone().as_ref().expect("valid commitment expected"), transcript);
3028-
Pcs::write_commitment(self.addr_vir_mems_shifted_comm.clone().as_ref().expect("valid commitment expected"), transcript);
3029-
Pcs::write_commitment(self.addr_ts_bits_comm.clone().as_ref().expect("valid commitment expected"), transcript);
3026+
Pcs::write_commitment(self.addr_vir_mems_comm.clone().as_ref().expect("valid commitment expected"), transcript).unwrap();
3027+
Pcs::write_commitment(self.addr_vir_mems_shifted_comm.clone().as_ref().expect("valid commitment expected"), transcript).unwrap();
3028+
Pcs::write_commitment(self.addr_ts_bits_comm.clone().as_ref().expect("valid commitment expected"), transcript).unwrap();
30303029

30313030
(
30323031
VerifierWitnessSecInfo::new(vec![VIR_MEM_WIDTH], &vec![total_num_vir_mem_accesses], vec![self.addr_vir_mems_comm.clone().expect("commitment should exist")]),

0 commit comments

Comments
 (0)