diff --git a/ceno_emul/src/rv32im.rs b/ceno_emul/src/rv32im.rs index 2abd03cce..25a13f22b 100644 --- a/ceno_emul/src/rv32im.rs +++ b/ceno_emul/src/rv32im.rs @@ -88,7 +88,6 @@ pub struct Emulator { } #[derive(Debug)] -#[allow(dead_code)] pub enum TrapCause { InstructionAddressMisaligned, InstructionAccessFault, diff --git a/ceno_zkvm/src/instructions/riscv/arith.rs b/ceno_zkvm/src/instructions/riscv/arith.rs index 1d0d2146a..0b0a287e6 100644 --- a/ceno_zkvm/src/instructions/riscv/arith.rs +++ b/ceno_zkvm/src/instructions/riscv/arith.rs @@ -171,8 +171,6 @@ impl Instruction for ArithInstruction Instruction for AddiInstruction { mod test { use ceno_emul::{Change, InsnKind, PC_STEP_SIZE, StepRecord, encode_rv32}; use goldilocks::GoldilocksExt2; - use itertools::Itertools; - use multilinear_extensions::mle::IntoMLEs; use crate::{ circuit_builder::{CircuitBuilder, ConstraintSystem}, @@ -124,18 +122,7 @@ mod test { ) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] @@ -168,17 +155,6 @@ mod test { ) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } } diff --git a/ceno_zkvm/src/instructions/riscv/b_insn.rs b/ceno_zkvm/src/instructions/riscv/b_insn.rs index b7c74543f..399798398 100644 --- a/ceno_zkvm/src/instructions/riscv/b_insn.rs +++ b/ceno_zkvm/src/instructions/riscv/b_insn.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] // TODO: remove after BLT, BEQ, … - use ceno_emul::{InsnKind, StepRecord}; use ff_ext::ExtensionField; diff --git a/ceno_zkvm/src/instructions/riscv/branch/test.rs b/ceno_zkvm/src/instructions/riscv/branch/test.rs index 36746fff3..9847c66d5 100644 --- a/ceno_zkvm/src/instructions/riscv/branch/test.rs +++ b/ceno_zkvm/src/instructions/riscv/branch/test.rs @@ -1,7 +1,5 @@ use ceno_emul::{ByteAddr, Change, PC_STEP_SIZE, StepRecord, Word, encode_rv32}; use goldilocks::GoldilocksExt2; -use itertools::Itertools; -use multilinear_extensions::mle::IntoMLEs; use super::*; use crate::{ @@ -49,18 +47,7 @@ fn impl_opcode_beq(equal: bool) { ]) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] @@ -98,18 +85,7 @@ fn impl_opcode_bne(equal: bool) { ]) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] @@ -150,18 +126,7 @@ fn impl_bltu_circuit(taken: bool, a: u32, b: u32) -> Result<(), ZKVMError> { ]) .unwrap(); - MockProver::assert_satisfied( - &circuit_builder, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&circuit_builder, raw_witin, &[insn_code], None, Some(lkm)); Ok(()) } @@ -202,18 +167,7 @@ fn impl_bgeu_circuit(taken: bool, a: u32, b: u32) -> Result<(), ZKVMError> { ]) .unwrap(); - MockProver::assert_satisfied( - &circuit_builder, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&circuit_builder, raw_witin, &[insn_code], None, Some(lkm)); Ok(()) } @@ -255,18 +209,7 @@ fn impl_blt_circuit(taken: bool, a: i32, b: i32) -> Result<(), ZKVMError> { ]) .unwrap(); - MockProver::assert_satisfied( - &circuit_builder, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&circuit_builder, raw_witin, &[insn_code], None, Some(lkm)); Ok(()) } @@ -308,17 +251,6 @@ fn impl_bge_circuit(taken: bool, a: i32, b: i32) -> Result<(), ZKVMError> { ]) .unwrap(); - MockProver::assert_satisfied( - &circuit_builder, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&circuit_builder, raw_witin, &[insn_code], None, Some(lkm)); Ok(()) } diff --git a/ceno_zkvm/src/instructions/riscv/jump/test.rs b/ceno_zkvm/src/instructions/riscv/jump/test.rs index a1b17e911..887db8da3 100644 --- a/ceno_zkvm/src/instructions/riscv/jump/test.rs +++ b/ceno_zkvm/src/instructions/riscv/jump/test.rs @@ -1,7 +1,5 @@ use ceno_emul::{ByteAddr, Change, InsnKind, PC_STEP_SIZE, StepRecord, Word, encode_rv32}; use goldilocks::GoldilocksExt2; -use itertools::Itertools; -use multilinear_extensions::mle::IntoMLEs; use crate::{ circuit_builder::{CircuitBuilder, ConstraintSystem}, @@ -45,18 +43,7 @@ fn test_opcode_jal() { ) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] @@ -93,18 +80,7 @@ fn test_opcode_jalr() { ) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] @@ -137,18 +113,7 @@ fn test_opcode_lui() { ) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] @@ -181,16 +146,5 @@ fn test_opcode_auipc() { ) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } diff --git a/ceno_zkvm/src/instructions/riscv/logic/test.rs b/ceno_zkvm/src/instructions/riscv/logic/test.rs index 50d73751e..b35c12bcb 100644 --- a/ceno_zkvm/src/instructions/riscv/logic/test.rs +++ b/ceno_zkvm/src/instructions/riscv/logic/test.rs @@ -1,7 +1,5 @@ use ceno_emul::{Change, StepRecord, Word, encode_rv32}; use goldilocks::GoldilocksExt2; -use itertools::Itertools; -use multilinear_extensions::mle::IntoMLEs; use crate::{ circuit_builder::{CircuitBuilder, ConstraintSystem}, @@ -52,18 +50,7 @@ fn test_opcode_and() { .require_equal(|| "assert_rd_written", &mut cb, &expected_rd_written) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] @@ -103,18 +90,7 @@ fn test_opcode_or() { .require_equal(|| "assert_rd_written", &mut cb, &expected_rd_written) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] @@ -154,16 +130,5 @@ fn test_opcode_xor() { .require_equal(|| "assert_rd_written", &mut cb, &expected_rd_written) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } diff --git a/ceno_zkvm/src/instructions/riscv/logic_imm/logic_imm_circuit.rs b/ceno_zkvm/src/instructions/riscv/logic_imm/logic_imm_circuit.rs index 8972766f5..7fb061b5c 100644 --- a/ceno_zkvm/src/instructions/riscv/logic_imm/logic_imm_circuit.rs +++ b/ceno_zkvm/src/instructions/riscv/logic_imm/logic_imm_circuit.rs @@ -126,8 +126,6 @@ impl LogicConfig { mod test { use ceno_emul::{Change, InsnKind, PC_STEP_SIZE, StepRecord, encode_rv32}; use goldilocks::GoldilocksExt2; - use itertools::Itertools; - use multilinear_extensions::mle::IntoMLEs; use crate::{ chip_handler::test::DebugIndex, @@ -205,17 +203,6 @@ mod test { cb.require_equal(|| "assert_rd_written", rd_written_expr, expected.value()) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } } diff --git a/ceno_zkvm/src/instructions/riscv/memory/store.rs b/ceno_zkvm/src/instructions/riscv/memory/store.rs index fc8f0455f..ddf76d0fd 100644 --- a/ceno_zkvm/src/instructions/riscv/memory/store.rs +++ b/ceno_zkvm/src/instructions/riscv/memory/store.rs @@ -38,8 +38,7 @@ impl RIVInstruction for SWOp { const INST_KIND: InsnKind = InsnKind::SW; } -// this is actually used in test -#[allow(dead_code)] +#[cfg(test)] pub type SwInstruction = StoreInstruction; pub struct SHOp; @@ -48,8 +47,7 @@ impl RIVInstruction for SHOp { const INST_KIND: InsnKind = InsnKind::SH; } -// this is actually used in test -#[allow(dead_code)] +#[cfg(test)] pub type ShInstruction = StoreInstruction; pub struct SBOp; @@ -58,8 +56,7 @@ impl RIVInstruction for SBOp { const INST_KIND: InsnKind = InsnKind::SB; } -// this is actually used in test -#[allow(dead_code)] +#[cfg(test)] pub type SbInstruction = StoreInstruction; impl Instruction diff --git a/ceno_zkvm/src/instructions/riscv/memory/test.rs b/ceno_zkvm/src/instructions/riscv/memory/test.rs index ad4ee4b3e..6243f197b 100644 --- a/ceno_zkvm/src/instructions/riscv/memory/test.rs +++ b/ceno_zkvm/src/instructions/riscv/memory/test.rs @@ -19,8 +19,6 @@ use crate::{ use ceno_emul::{ByteAddr, Change, InsnKind, ReadOp, StepRecord, Word, WriteOp, encode_rv32}; use ff_ext::ExtensionField; use goldilocks::GoldilocksExt2; -use itertools::Itertools; -use multilinear_extensions::mle::IntoMLEs; use std::hash::Hash; fn sb(prev: Word, rs2: Word, shift: u32) -> Word { @@ -121,18 +119,7 @@ fn impl_opcode_store>(imm: u32) { @@ -176,18 +163,7 @@ fn impl_opcode_load Instruction for MulhInstruction { pub struct ShiftLogicalInstruction(PhantomData<(E, I)>); -#[allow(dead_code)] +#[cfg(test)] struct SllOp; +#[cfg(test)] impl RIVInstruction for SllOp { const INST_KIND: InsnKind = InsnKind::SLL; } -#[allow(dead_code)] +#[cfg(test)] struct SrlOp; +#[cfg(test)] impl RIVInstruction for SrlOp { const INST_KIND: InsnKind = InsnKind::SRL; } @@ -193,8 +195,6 @@ impl Instruction for ShiftLogicalInstru mod tests { use ceno_emul::{Change, InsnKind, StepRecord, encode_rv32}; use goldilocks::GoldilocksExt2; - use itertools::Itertools; - use multilinear_extensions::mle::IntoMLEs; use crate::{ Value, @@ -294,17 +294,6 @@ mod tests { ) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } } diff --git a/ceno_zkvm/src/instructions/riscv/shift_imm.rs b/ceno_zkvm/src/instructions/riscv/shift_imm.rs index d1af0871b..81688089e 100644 --- a/ceno_zkvm/src/instructions/riscv/shift_imm.rs +++ b/ceno_zkvm/src/instructions/riscv/shift_imm.rs @@ -179,8 +179,6 @@ impl Instruction for ShiftImmInstructio mod test { use ceno_emul::{Change, InsnKind, PC_STEP_SIZE, StepRecord, encode_rv32}; use goldilocks::GoldilocksExt2; - use itertools::Itertools; - use multilinear_extensions::mle::IntoMLEs; use super::{ShiftImmInstruction, SlliOp, SraiOp, SrliOp}; use crate::{ @@ -300,17 +298,6 @@ mod test { ) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } } diff --git a/ceno_zkvm/src/instructions/riscv/slt.rs b/ceno_zkvm/src/instructions/riscv/slt.rs index fb138f2aa..830f571cd 100644 --- a/ceno_zkvm/src/instructions/riscv/slt.rs +++ b/ceno_zkvm/src/instructions/riscv/slt.rs @@ -17,7 +17,7 @@ pub struct SltConfig { rs1_read: UInt, rs2_read: UInt, - #[allow(dead_code)] + #[cfg_attr(not(test), allow(dead_code))] rd_written: UInt, signed_lt: SignedLtConfig, @@ -90,8 +90,6 @@ mod test { use ceno_emul::{Change, StepRecord, Word, encode_rv32}; use goldilocks::GoldilocksExt2; - use itertools::Itertools; - use multilinear_extensions::mle::IntoMLEs; use rand::Rng; use super::*; @@ -137,18 +135,7 @@ mod test { .require_equal(|| "assert_rd_written", &mut cb, &expected_rd_written) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] diff --git a/ceno_zkvm/src/instructions/riscv/slti.rs b/ceno_zkvm/src/instructions/riscv/slti.rs index a0db3fbc0..4ba2ced3a 100644 --- a/ceno_zkvm/src/instructions/riscv/slti.rs +++ b/ceno_zkvm/src/instructions/riscv/slti.rs @@ -122,8 +122,6 @@ mod test { use ceno_emul::{Change, PC_STEP_SIZE, StepRecord, Word, encode_rv32}; use goldilocks::GoldilocksExt2; - use itertools::Itertools; - use multilinear_extensions::mle::IntoMLEs; use rand::Rng; use super::*; @@ -168,18 +166,7 @@ mod test { .require_equal(|| "assert_rd_written", &mut cb, &expected_rd_written) .unwrap(); - MockProver::assert_satisfied( - &cb, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), - &[insn_code], - None, - Some(lkm), - ); + MockProver::assert_satisfied_raw(&cb, raw_witin, &[insn_code], None, Some(lkm)); } #[test] diff --git a/ceno_zkvm/src/instructions/riscv/sltu.rs b/ceno_zkvm/src/instructions/riscv/sltu.rs index 71ffd9f09..26f15b9bc 100644 --- a/ceno_zkvm/src/instructions/riscv/sltu.rs +++ b/ceno_zkvm/src/instructions/riscv/sltu.rs @@ -21,7 +21,7 @@ pub struct ArithConfig { rs1_read: UInt, rs2_read: UInt, - #[allow(dead_code)] + #[cfg_attr(not(test), allow(dead_code))] rd_written: UInt, is_lt: IsLtConfig, @@ -107,8 +107,6 @@ impl Instruction for ArithInstruction, + raw_witin: RowMajorMatrix, + programs: &[u32], + challenge: Option<[E; 2]>, + lkm: Option, + ) { + let wits_in = raw_witin + .de_interleaving() + .into_mles() + .into_iter() + .map(|v| v.into()) + .collect_vec(); + Self::assert_satisfied(cb, &wits_in, programs, challenge, lkm); + } pub fn assert_satisfied( cb: &CircuitBuilder, wits_in: &[ArcMultilinearExtension<'a, E>], @@ -698,13 +713,15 @@ mod tests { }; use ff::Field; use goldilocks::{Goldilocks, GoldilocksExt2}; - use multilinear_extensions::mle::{IntoMLE, IntoMLEs}; + use multilinear_extensions::mle::IntoMLE; #[derive(Debug)] - #[allow(dead_code)] struct AssertZeroCircuit { + #[allow(dead_code)] pub a: WitIn, + #[allow(dead_code)] pub b: WitIn, + #[allow(dead_code)] pub c: WitIn, } @@ -832,7 +849,6 @@ mod tests { assert_eq!(err[0].inst_id(), 0); } - #[allow(dead_code)] #[derive(Debug)] struct AssertLtCircuit { pub a: WitIn, @@ -905,14 +921,9 @@ mod tests { ) .unwrap(); - MockProver::assert_satisfied( + MockProver::assert_satisfied_raw( &builder, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), + raw_witin, &[], Some([1.into(), 1000.into()]), None, @@ -943,14 +954,9 @@ mod tests { ) .unwrap(); - MockProver::assert_satisfied( + MockProver::assert_satisfied_raw( &builder, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), + raw_witin, &[], Some([1.into(), 1000.into()]), None, @@ -1029,14 +1035,9 @@ mod tests { ) .unwrap(); - MockProver::assert_satisfied( + MockProver::assert_satisfied_raw( &builder, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), + raw_witin, &[], Some([1.into(), 1000.into()]), None, @@ -1068,14 +1069,9 @@ mod tests { ) .unwrap(); - MockProver::assert_satisfied( + MockProver::assert_satisfied_raw( &builder, - &raw_witin - .de_interleaving() - .into_mles() - .into_iter() - .map(|v| v.into()) - .collect_vec(), + raw_witin, &[], Some([1.into(), 1000.into()]), None, diff --git a/ceno_zkvm/src/scheme/utils.rs b/ceno_zkvm/src/scheme/utils.rs index e09e70574..fc4b7a444 100644 --- a/ceno_zkvm/src/scheme/utils.rs +++ b/ceno_zkvm/src/scheme/utils.rs @@ -352,7 +352,7 @@ pub(crate) fn wit_infer_by_expr<'a, E: ExtensionField, const N: usize>( ) } -#[allow(dead_code)] +#[cfg(test)] pub(crate) fn eval_by_expr( witnesses: &[E], challenges: &[E], @@ -361,7 +361,7 @@ pub(crate) fn eval_by_expr( eval_by_expr_with_fixed(&[], witnesses, challenges, expr) } -#[allow(dead_code)] +#[cfg(test)] pub(crate) fn eval_by_expr_with_fixed( fixed: &[E], witnesses: &[E], diff --git a/ceno_zkvm/src/uint.rs b/ceno_zkvm/src/uint.rs index 6a9732e0e..d8f53f200 100644 --- a/ceno_zkvm/src/uint.rs +++ b/ceno_zkvm/src/uint.rs @@ -637,7 +637,6 @@ impl ValueMul { #[derive(Clone)] pub struct Value<'a, T: Into + From + Copy + Default> { - #[allow(dead_code)] val: T, pub limbs: Cow<'a, [u16]>, } diff --git a/ceno_zkvm/src/utils.rs b/ceno_zkvm/src/utils.rs index 47af02967..3b7ef187c 100644 --- a/ceno_zkvm/src/utils.rs +++ b/ceno_zkvm/src/utils.rs @@ -5,13 +5,6 @@ use itertools::Itertools; use multilinear_extensions::util::max_usable_threads; use transcript::Transcript; -/// convert ext field element to u64, assume it is inside the range -#[allow(dead_code)] -pub fn ext_to_u64(x: &E) -> u64 { - let bases = x.as_bases(); - bases[0].to_canonical_u64() -} - pub fn i64_to_base(x: i64) -> F { if x >= 0 { F::from(x as u64) @@ -20,20 +13,6 @@ pub fn i64_to_base(x: i64) -> F { } } -/// This is helper function to convert witness of u8 limb into u16 limb -/// TODO: need a better way to keep consistency of LIMB_BITS -#[allow(dead_code)] -pub fn limb_u8_to_u16(input: &[u8]) -> Vec { - input - .chunks(2) - .map(|chunk| { - let low = chunk[0] as u16; - let high = if chunk.len() > 1 { chunk[1] as u16 } else { 0 }; - high * 256 + low - }) - .collect() -} - pub fn split_to_u8>(value: u32) -> Vec { (0..(u32::BITS / 8)) .scan(value, |acc, _| { @@ -72,15 +51,6 @@ pub(crate) fn add_one_to_big_num(limb_modulo: F, limbs: &[F]) -> Vec(x: i64) -> E::BaseField { - if x >= 0 { - E::BaseField::from(x as u64) - } else { - -E::BaseField::from((-x) as u64) - } -} - /// derive challenge from transcript and return all pows result pub fn get_challenge_pows( size: usize, diff --git a/ceno_zkvm/src/witness.rs b/ceno_zkvm/src/witness.rs index bdffa2ec6..41306a8ed 100644 --- a/ceno_zkvm/src/witness.rs +++ b/ceno_zkvm/src/witness.rs @@ -133,7 +133,6 @@ pub struct LkMultiplicity { multiplicity: Arc; mem::variant_count::()]>>>, } -#[allow(dead_code)] impl LkMultiplicity { /// assert within range #[inline(always)] diff --git a/gkr-graph/src/structs.rs b/gkr-graph/src/structs.rs index 00bb4bfb3..4e206ee2a 100644 --- a/gkr-graph/src/structs.rs +++ b/gkr-graph/src/structs.rs @@ -45,7 +45,7 @@ pub enum PredType { #[derive(Clone, Debug)] pub struct CircuitNode { pub(crate) id: usize, - // TODO(Matthias): See whether we can remove this field. + // Note: only for debug output. #[allow(dead_code)] pub(crate) label: &'static str, pub(crate) circuit: Arc>, diff --git a/gkr/src/circuit.rs b/gkr/src/circuit.rs index 5e8c1ec93..d5459f328 100644 --- a/gkr/src/circuit.rs +++ b/gkr/src/circuit.rs @@ -42,14 +42,6 @@ where in_eq_vec: &[E], challenges: &HashMap>, ) -> E; - // TODO(Matthias, by 2024-11-01): review whether we need this function after all. - #[allow(dead_code)] - fn fix_out_variables( - &self, - in_size: usize, - out_eq_vec: &[E], - challenges: &HashMap>, - ) -> Vec; } impl EvaluateGate1In for &[Gate1In>] @@ -68,18 +60,6 @@ where * gate.scalar.eval(challenges) }) } - fn fix_out_variables( - &self, - in_size: usize, - out_eq_vec: &[E], - challenges: &HashMap>, - ) -> Vec { - let mut ans = vec![E::ZERO; in_size]; - for gate in self.iter() { - ans[gate.idx_in[0]] += out_eq_vec[gate.idx_out] * gate.scalar.eval(challenges); - } - ans - } } pub trait EvaluateGate2In diff --git a/gkr/src/circuit/circuit_witness.rs b/gkr/src/circuit/circuit_witness.rs index 1089e8d80..dd88319aa 100644 --- a/gkr/src/circuit/circuit_witness.rs +++ b/gkr/src/circuit/circuit_witness.rs @@ -487,603 +487,3 @@ impl<'a, F: ExtensionField> Debug for CircuitWitness<'a, F> { writeln!(f, "}}") } } - -// #[cfg(test)] -// mod test { -// use std::{collections::HashMap, ops::Neg}; - -// use ff::Field; -// use ff_ext::ExtensionField; -// use goldilocks::GoldilocksExt2; -// use itertools::Itertools; -// use simple_frontend::structs::{ChallengeConst, ChallengeId, CircuitBuilder, ConstantType}; - -// use crate::{ -// structs::{Circuit, CircuitWitness, LayerWitness}, -// utils::i64_to_field, -// }; - -// fn copy_and_paste_circuit() -> Circuit { -// let mut circuit_builder = CircuitBuilder::::new(); -// // Layer 3 -// let (_, input) = circuit_builder.create_witness_in(4); - -// // Layer 2 -// let mul_01 = circuit_builder.create_cell(); -// circuit_builder.mul2(mul_01, input[0], input[1], Ext::BaseField::ONE); - -// // Layer 1 -// let mul_012 = circuit_builder.create_cell(); -// circuit_builder.mul2(mul_012, mul_01, input[2], Ext::BaseField::ONE); - -// // Layer 0 -// let (_, mul_001123) = circuit_builder.create_witness_out(1); -// circuit_builder.mul3( -// mul_001123[0], -// mul_01, -// mul_012, -// input[3], -// Ext::BaseField::ONE, -// ); - -// circuit_builder.configure(); -// let circuit = Circuit::new(&circuit_builder); - -// circuit -// } - -// fn copy_and_paste_witness() -> ( -// Vec>, -// CircuitWitness, -// ) { -// // witness_in, single instance -// let inputs = vec![vec![ -// i64_to_field(5), -// i64_to_field(7), -// i64_to_field(11), -// i64_to_field(13), -// ]]; -// let witness_in = vec![LayerWitness { instances: inputs }]; - -// let layers = vec![ -// LayerWitness { -// instances: vec![vec![i64_to_field(175175)]], -// }, -// LayerWitness { -// instances: vec![vec![ -// i64_to_field(385), -// i64_to_field(35), -// i64_to_field(13), -// i64_to_field(0), // pad -// ]], -// }, -// LayerWitness { -// instances: vec![vec![i64_to_field(35), i64_to_field(11)]], -// }, -// LayerWitness { -// instances: vec![vec![ -// i64_to_field(5), -// i64_to_field(7), -// i64_to_field(11), -// i64_to_field(13), -// ]], -// }, -// ]; - -// let outputs = vec![vec![i64_to_field(175175)]]; -// let witness_out = vec![LayerWitness { instances: outputs }]; - -// ( -// witness_in.clone(), -// CircuitWitness { -// layers, -// witness_in, -// witness_out, -// n_instances: 1, -// challenges: HashMap::new(), -// }, -// ) -// } - -// fn paste_from_wit_in_circuit() -> Circuit { -// let mut circuit_builder = CircuitBuilder::::new(); - -// // Layer 2 -// let (_leaf_id1, leaves1) = circuit_builder.create_witness_in(3); -// let (_leaf_id2, leaves2) = circuit_builder.create_witness_in(3); -// // Unused input elements should also be in the circuit. -// let (_dummy_id, _) = circuit_builder.create_witness_in(3); -// let _ = circuit_builder.create_counter_in(1); -// let _ = circuit_builder.create_constant_in(2, 1); - -// // Layer 1 -// let (_, inners) = circuit_builder.create_witness_out(2); -// circuit_builder.mul2(inners[0], leaves1[0], leaves1[1], Ext::BaseField::ONE); -// circuit_builder.mul2(inners[1], leaves1[2], leaves2[0], Ext::BaseField::ONE); - -// // Layer 0 -// let (_, root) = circuit_builder.create_witness_out(1); -// circuit_builder.mul2(root[0], inners[0], inners[1], Ext::BaseField::ONE); - -// circuit_builder.configure(); -// let circuit = Circuit::new(&circuit_builder); -// circuit -// } - -// fn paste_from_wit_in_witness() -> ( -// Vec>, -// CircuitWitness, -// ) { -// // witness_in, single instance -// let leaves1 = vec![vec![i64_to_field(5), i64_to_field(7), i64_to_field(11)]]; -// let leaves2 = vec![vec![i64_to_field(13), i64_to_field(17), i64_to_field(19)]]; -// let dummy = vec![vec![i64_to_field(13), i64_to_field(17), i64_to_field(19)]]; -// let witness_in = vec![ -// LayerWitness { instances: leaves1 }, -// LayerWitness { instances: leaves2 }, -// LayerWitness { instances: dummy }, -// ]; - -// let layers = vec![ -// LayerWitness { -// instances: vec![vec![ -// i64_to_field(5005), -// i64_to_field(35), -// i64_to_field(143), -// i64_to_field(0), // pad -// ]], -// }, -// LayerWitness { -// instances: vec![vec![i64_to_field(35), i64_to_field(143)]], -// }, -// LayerWitness { -// instances: vec![vec![ -// i64_to_field(5), // leaves1 -// i64_to_field(7), -// i64_to_field(11), -// i64_to_field(13), // leaves2 -// i64_to_field(17), -// i64_to_field(19), -// i64_to_field(13), // dummy -// i64_to_field(17), -// i64_to_field(19), -// i64_to_field(0), // counter -// i64_to_field(1), -// i64_to_field(1), // constant -// i64_to_field(1), -// i64_to_field(0), // pad -// i64_to_field(0), -// i64_to_field(0), -// ]], -// }, -// ]; - -// let outputs1 = vec![vec![i64_to_field(35), i64_to_field(143)]]; -// let outputs2 = vec![vec![i64_to_field(5005)]]; -// let witness_out = vec![ -// LayerWitness { -// instances: outputs1, -// }, -// LayerWitness { -// instances: outputs2, -// }, -// ]; - -// ( -// witness_in.clone(), -// CircuitWitness { -// layers, -// witness_in, -// witness_out, -// n_instances: 1, -// challenges: HashMap::new(), -// }, -// ) -// } - -// fn copy_to_wit_out_circuit() -> Circuit { -// let mut circuit_builder = CircuitBuilder::::new(); -// // Layer 2 -// let (_, leaves) = circuit_builder.create_witness_in(4); - -// // Layer 1 -// let (_inner_id, inners) = circuit_builder.create_witness_out(2); -// circuit_builder.mul2(inners[0], leaves[0], leaves[1], Ext::BaseField::ONE); -// circuit_builder.mul2(inners[1], leaves[2], leaves[3], Ext::BaseField::ONE); - -// // Layer 0 -// let root = circuit_builder.create_cell(); -// circuit_builder.mul2(root, inners[0], inners[1], Ext::BaseField::ONE); -// circuit_builder.assert_const(root, 5005); - -// circuit_builder.configure(); -// let circuit = Circuit::new(&circuit_builder); - -// circuit -// } - -// fn copy_to_wit_out_witness() -> ( -// Vec>, -// CircuitWitness, -// ) { -// // witness_in, single instance -// let leaves = vec![vec![ -// i64_to_field(5), -// i64_to_field(7), -// i64_to_field(11), -// i64_to_field(13), -// ]]; -// let witness_in = vec![LayerWitness { instances: leaves }]; - -// let layers = vec![ -// LayerWitness { -// instances: vec![vec![ -// i64_to_field(5005), -// i64_to_field(35), -// i64_to_field(143), -// i64_to_field(0), // pad -// ]], -// }, -// LayerWitness { -// instances: vec![vec![i64_to_field(35), i64_to_field(143)]], -// }, -// LayerWitness { -// instances: vec![vec![ -// i64_to_field(5), -// i64_to_field(7), -// i64_to_field(11), -// i64_to_field(13), -// ]], -// }, -// ]; - -// let outputs = vec![vec![i64_to_field(35), i64_to_field(143)]]; -// let witness_out = vec![LayerWitness { instances: outputs }]; - -// ( -// witness_in.clone(), -// CircuitWitness { -// layers, -// witness_in, -// witness_out, -// n_instances: 1, -// challenges: HashMap::new(), -// }, -// ) -// } - -// fn copy_to_wit_out_witness_2() -> ( -// Vec>, -// CircuitWitness, -// ) { -// // witness_in, 2 instances -// let leaves = vec![ -// vec![ -// i64_to_field(5), -// i64_to_field(7), -// i64_to_field(11), -// i64_to_field(13), -// ], -// vec![ -// i64_to_field(5), -// i64_to_field(13), -// i64_to_field(11), -// i64_to_field(7), -// ], -// ]; -// let witness_in = vec![LayerWitness { instances: leaves }]; - -// let layers = vec![ -// LayerWitness { -// instances: vec![ -// vec![ -// i64_to_field(5005), -// i64_to_field(35), -// i64_to_field(143), -// i64_to_field(0), // pad -// ], -// vec![ -// i64_to_field(5005), -// i64_to_field(65), -// i64_to_field(77), -// i64_to_field(0), // pad -// ], -// ], -// }, -// LayerWitness { -// instances: vec![ -// vec![i64_to_field(35), i64_to_field(143)], -// vec![i64_to_field(65), i64_to_field(77)], -// ], -// }, -// LayerWitness { -// instances: vec![ -// vec![ -// i64_to_field(5), -// i64_to_field(7), -// i64_to_field(11), -// i64_to_field(13), -// ], -// vec![ -// i64_to_field(5), -// i64_to_field(13), -// i64_to_field(11), -// i64_to_field(7), -// ], -// ], -// }, -// ]; - -// let outputs = vec![ -// vec![i64_to_field(35), i64_to_field(143)], -// vec![i64_to_field(65), i64_to_field(77)], -// ]; -// let witness_out = vec![LayerWitness { instances: outputs }]; - -// ( -// witness_in.clone(), -// CircuitWitness { -// layers, -// witness_in, -// witness_out, -// n_instances: 2, -// challenges: HashMap::new(), -// }, -// ) -// } - -// fn rlc_circuit() -> Circuit { -// let mut circuit_builder = CircuitBuilder::::new(); -// // Layer 2 -// let (_, leaves) = circuit_builder.create_witness_in(4); - -// // Layer 1 -// let inners = circuit_builder.create_ext_cells(2); -// circuit_builder.rlc(&inners[0], &[leaves[0], leaves[1]], 0 as ChallengeId); -// circuit_builder.rlc(&inners[1], &[leaves[2], leaves[3]], 1 as ChallengeId); - -// // Layer 0 -// let (_root_id, roots) = circuit_builder.create_ext_witness_out(1); -// circuit_builder.mul2_ext(&roots[0], &inners[0], &inners[1], Ext::BaseField::ONE); - -// circuit_builder.configure(); -// let circuit = Circuit::new(&circuit_builder); - -// circuit -// } - -// fn rlc_witness_2() -> ( -// Vec>, -// CircuitWitness, -// Vec, -// ) -// where -// Ext: ExtensionField, -// { -// let challenges = vec![ -// Ext::from_bases(&[i64_to_field(31), i64_to_field(37)]), -// Ext::from_bases(&[i64_to_field(97), i64_to_field(23)]), -// ]; -// let challenge_pows = challenges -// .iter() -// .enumerate() -// .map(|(i, x)| { -// (0..3) -// .map(|j| { -// ( -// ChallengeConst { -// challenge: i as u8, -// exp: j as u64, -// }, -// x.pow(&[j as u64]), -// ) -// }) -// .collect_vec() -// }) -// .collect_vec(); - -// // witness_in, double instances -// let leaves = vec![ -// vec![ -// i64_to_field(5), -// i64_to_field(7), -// i64_to_field(11), -// i64_to_field(13), -// ], -// vec![ -// i64_to_field(5), -// i64_to_field(13), -// i64_to_field(11), -// i64_to_field(7), -// ], -// ]; -// let witness_in = vec![LayerWitness { -// instances: leaves.clone(), -// }]; - -// let inner00: Ext = challenge_pows[0][0].1 * (&leaves[0][0]) -// + challenge_pows[0][1].1 * (&leaves[0][1]) -// + challenge_pows[0][2].1; -// let inner01: Ext = challenge_pows[1][0].1 * (&leaves[0][2]) -// + challenge_pows[1][1].1 * (&leaves[0][3]) -// + challenge_pows[1][2].1; -// let inner10: Ext = challenge_pows[0][0].1 * (&leaves[1][0]) -// + challenge_pows[0][1].1 * (&leaves[1][1]) -// + challenge_pows[0][2].1; -// let inner11: Ext = challenge_pows[1][0].1 * (&leaves[1][2]) -// + challenge_pows[1][1].1 * (&leaves[1][3]) -// + challenge_pows[1][2].1; - -// let inners = vec![ -// [ -// inner00.clone().as_bases().to_vec(), -// inner01.clone().as_bases().to_vec(), -// ] -// .concat(), -// [ -// inner10.clone().as_bases().to_vec(), -// inner11.clone().as_bases().to_vec(), -// ] -// .concat(), -// ]; - -// let root_tmp0 = vec![ -// inners[0][0] * inners[0][2], -// inners[0][0] * inners[0][3], -// inners[0][1] * inners[0][2], -// inners[0][1] * inners[0][3], -// ]; -// let root_tmp1 = vec![ -// inners[1][0] * inners[1][2], -// inners[1][0] * inners[1][3], -// inners[1][1] * inners[1][2], -// inners[1][1] * inners[1][3], -// ]; -// let root_tmps = vec![root_tmp0, root_tmp1]; - -// let root0 = inner00 * inner01; -// let root1 = inner10 * inner11; -// let roots = vec![root0.as_bases().to_vec(), root1.as_bases().to_vec()]; - -// let layers = vec![ -// LayerWitness { -// instances: roots.clone(), -// }, -// LayerWitness { -// instances: root_tmps, -// }, -// LayerWitness { instances: inners }, -// LayerWitness { instances: leaves }, -// ]; - -// let outputs = roots; -// let witness_out = vec![LayerWitness { instances: outputs }]; - -// ( -// witness_in.clone(), -// CircuitWitness { -// layers, -// witness_in, -// witness_out, -// n_instances: 2, -// challenges: challenge_pows -// .iter() -// .flatten() -// .cloned() -// .map(|(k, v)| (k, v.as_bases().to_vec())) -// .collect::>(), -// }, -// challenges, -// ) -// } - -// #[test] -// fn test_add_instances() { -// let circuit = copy_and_paste_circuit::(); -// let (wits_in, expect_circuit_wits) = copy_and_paste_witness::(); - -// let mut circuit_wits = CircuitWitness::new(&circuit, vec![]); -// circuit_wits.add_instances(&circuit, wits_in, 1); - -// assert_eq!(circuit_wits, expect_circuit_wits); - -// let circuit = paste_from_wit_in_circuit::(); -// let (wits_in, expect_circuit_wits) = paste_from_wit_in_witness::(); - -// let mut circuit_wits = CircuitWitness::new(&circuit, vec![]); -// circuit_wits.add_instances(&circuit, wits_in, 1); - -// assert_eq!(circuit_wits, expect_circuit_wits); - -// let circuit = copy_to_wit_out_circuit::(); -// let (wits_in, expect_circuit_wits) = copy_to_wit_out_witness::(); - -// let mut circuit_wits = CircuitWitness::new(&circuit, vec![]); -// circuit_wits.add_instances(&circuit, wits_in, 1); - -// assert_eq!(circuit_wits, expect_circuit_wits); - -// let (wits_in, expect_circuit_wits) = copy_to_wit_out_witness_2::(); -// let mut circuit_wits = CircuitWitness::new(&circuit, vec![]); -// circuit_wits.add_instances(&circuit, wits_in, 2); - -// assert_eq!(circuit_wits, expect_circuit_wits); -// } - -// #[test] -// fn test_check_correctness() { -// let circuit = copy_to_wit_out_circuit::(); -// let (_wits_in, expect_circuit_wits) = copy_to_wit_out_witness_2::(); - -// expect_circuit_wits.check_correctness(&circuit); -// } - -// #[test] -// fn test_challenges() { -// let circuit = rlc_circuit::(); -// let (wits_in, expect_circuit_wits, challenges) = rlc_witness_2::(); -// let mut circuit_wits = CircuitWitness::new(&circuit, challenges); -// circuit_wits.add_instances(&circuit, wits_in, 2); - -// assert_eq!(circuit_wits, expect_circuit_wits); -// } - -// #[test] -// fn test_orphan_const_input() { -// // create circuit -// let mut circuit_builder = CircuitBuilder::::new(); - -// let (_, leaves) = circuit_builder.create_witness_in(3); -// let mul_0_1_res = circuit_builder.create_cell(); - -// // 2 * 3 = 6 -// circuit_builder.mul2( -// mul_0_1_res, -// leaves[0], -// leaves[1], -// ::BaseField::ONE, -// ); - -// let (_, out) = circuit_builder.create_witness_out(2); -// // like a bypass gate, passing 6 to output out[0] -// circuit_builder.add( -// out[0], -// mul_0_1_res, -// ::BaseField::ONE, -// ); - -// // assert const 2 -// circuit_builder.assert_const(leaves[2], 5); - -// // 5 + -5 = 0, put in out[1] -// circuit_builder.add( -// out[1], -// leaves[2], -// ::BaseField::ONE, -// ); -// circuit_builder.add_const( -// out[1], -// ::BaseField::from(5).neg(), // -5 -// ); - -// // assert out[1] == 0 -// circuit_builder.assert_const(out[1], 0); - -// circuit_builder.configure(); -// let circuit = Circuit::new(&circuit_builder); - -// let mut circuit_wits = CircuitWitness::new(&circuit, vec![]); -// let witness_in = vec![LayerWitness { -// instances: vec![vec![i64_to_field(2), i64_to_field(3), i64_to_field(5)]], -// }]; -// circuit_wits.add_instances(&circuit, witness_in, 1); - -// println!("circuit_wits {:?}", circuit_wits); -// let output_layer_witness = &circuit_wits.layers[0]; -// for gate in circuit.assert_consts.iter() { -// if let ConstantType::Field(constant) = gate.scalar { -// assert_eq!(output_layer_witness.instances[0][gate.idx_out], constant); -// } -// } -// } -// } diff --git a/multilinear_extensions/src/virtual_poly.rs b/multilinear_extensions/src/virtual_poly.rs index 45e4e9fb7..7d889111e 100644 --- a/multilinear_extensions/src/virtual_poly.rs +++ b/multilinear_extensions/src/virtual_poly.rs @@ -8,7 +8,7 @@ use ark_std::{end_timer, iterable::Iterable, rand::Rng, start_timer}; use ff::{Field, PrimeField}; use ff_ext::ExtensionField; use rayon::{ - iter::{IntoParallelIterator, IntoParallelRefIterator}, + iter::IntoParallelIterator, prelude::{IndexedParallelIterator, ParallelIterator}, slice::ParallelSliceMut, }; @@ -478,37 +478,6 @@ pub fn build_eq_x_r_vec(r: &[E]) -> Vec { } } -/// A helper function to build eq(x, r) via dynamic programing tricks. -/// This function takes 2^num_var iterations, and per iteration with 1 multiplication. -#[allow(dead_code)] -fn build_eq_x_r_helper(r: &[E], buf: &mut [Vec; 2]) { - buf[0][0] = E::ONE; - if r.is_empty() { - buf[0].resize(1, E::ZERO); - return; - } - for (i, r) in r.iter().rev().enumerate() { - let [current, next] = buf; - let (cur_size, next_size) = (1 << i, 1 << (i + 1)); - // suppose at the previous step we processed buf [0..size] - // for the current step we are populating new buf[0..2*size] - // for j travese 0..size - // buf[2*j + 1] = r * buf[j] - // buf[2*j] = (1 - r) * buf[j] - current[0..cur_size] - .par_iter() - .zip_eq(next[0..next_size].par_chunks_mut(2)) - .with_min_len(64) - .for_each(|(prev_val, next_vals)| { - assert!(next_vals.len() == 2); - let tmp = *r * prev_val; - next_vals[1] = tmp; - next_vals[0] = *prev_val - tmp; - }); - buf.swap(0, 1); // swap rolling buffer - } -} - #[cfg(test)] mod tests { use crate::virtual_poly::{build_eq_x_r_vec, build_eq_x_r_vec_sequential}; diff --git a/singer/src/scheme.rs b/singer/src/scheme.rs index d3b5e847d..6c5448e2e 100644 --- a/singer/src/scheme.rs +++ b/singer/src/scheme.rs @@ -1,30 +1,15 @@ use ff_ext::ExtensionField; // TODO: to be changed to a real PCS scheme. -type BatchedPCSProof = Vec>; -type Commitment = Vec; pub mod prover; pub mod verifier; -pub struct CommitPhaseProof { - // TODO(Matthias): Check whether we need this field. - #[allow(dead_code)] - commitments: Vec>, -} - pub type GKRGraphProof = gkr_graph::structs::IOPProof; pub type GKRGraphProverState = gkr_graph::structs::IOPProverState; pub type GKRGraphVerifierState = gkr_graph::structs::IOPVerifierState; -pub struct OpenPhaseProof { - // TODO(Matthias): Check whether we need this field. - #[allow(dead_code)] - pcs_proof: BatchedPCSProof, -} - pub struct SingerProof { - // commitment_phase_proof: CommitPhaseProof, + // TODO: restore and implement `commitment_phase_proof` and `open_phase_proof` gkr_phase_proof: GKRGraphProof, - // open_phase_proof: OpenPhaseProof, } diff --git a/singer/src/utils.rs b/singer/src/utils.rs index 02df9a112..c9cca791c 100644 --- a/singer/src/utils.rs +++ b/singer/src/utils.rs @@ -3,16 +3,6 @@ use ff_ext::ExtensionField; use itertools::izip; use simple_frontend::structs::{CellId, CircuitBuilder}; -// TODO(Matthias): Check whether we need this function. -#[allow(dead_code)] -pub(crate) fn i64_to_base_field(x: i64) -> E::BaseField { - if x >= 0 { - E::BaseField::from(x as u64) - } else { - -E::BaseField::from((-x) as u64) - } -} - pub(crate) fn add_assign_each_cell( circuit_builder: &mut CircuitBuilder, dest: &[CellId], diff --git a/sumcheck/src/structs.rs b/sumcheck/src/structs.rs index 2397a9cb8..a6089722a 100644 --- a/sumcheck/src/structs.rs +++ b/sumcheck/src/structs.rs @@ -14,7 +14,6 @@ pub struct IOPProof { pub proofs: Vec>, } impl IOPProof { - #[allow(dead_code)] pub fn extract_sum(&self) -> E { self.proofs[0].evaluations[0] + self.proofs[0].evaluations[1] }