Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ceno_zkvm/src/uint/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,7 @@ impl<const M: usize, const C: usize, E: ExtensionField> UIntLimbs<M, C, E> {
.into_iter()
.unzip();

let sum_expr = is_equal_per_limb
.iter()
.fold(Expression::ZERO, |acc, flag| acc.clone() + flag.expr());
let sum_expr = is_equal_per_limb.iter().map(ToExpr::expr).sum();

let sum_flag = WitIn::from_expr(|| "sum_flag", circuit_builder, sum_expr, false)?;
let (is_equal, diff_inv) =
Expand Down
4 changes: 1 addition & 3 deletions mpcs/src/sum_check/classic/coeff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ impl<E: ExtensionField> ClassicSumCheckRoundMessage<E> for Coefficients<E> {
}

fn sum(&self) -> E {
self[1..]
.iter()
.fold(self[0].double(), |acc, coeff| acc + coeff)
self[0] + self[..].iter().sum::<E>()
Copy link
Contributor Author

@matthiasgoergens matthiasgoergens Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doubling the first element is a bit weird. But the tests seem to expect it. What's the reason for it?

@yczhangsjtu I think you wrote that code? Could you please enlighten me? (I'll probably make a documenting comment out of your answer later.) Thanks!

}

fn evaluate(&self, _: &Self::Auxiliary, challenge: &E) -> E {
Expand Down