Skip to content

Commit

Permalink
Simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgoergens committed Nov 25, 2024
1 parent da17644 commit 04a5c3b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ceno_zkvm/src/uint/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,14 @@ impl<const M: usize, const C: usize, E: ExtensionField> UIntLimbs<M, C, E> {
if u.is_expr() {
circuit_builder.namespace(
|| name.to_owned(),
|cb| -> Result<(), ZKVMError> {
|cb| {
let existing_expr = u.expr();
// this will overwrite existing expressions
u.replace_limbs_with_witin(|| "replace_limbs_with_witin".to_string(), cb)?;
// check if the new witness equals the existing expression
izip!(u.expr(), existing_expr).try_for_each(|(lhs, rhs)| {
cb.require_equal(|| "new_witin_equal_expr".to_string(), lhs, rhs)
})?;
Ok(())
})
},
)?;
}
Expand Down

0 comments on commit 04a5c3b

Please sign in to comment.