From 73e0a27106a9f748cb0bc85e4fa8d42b32ca9663 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 3 Oct 2024 17:02:08 +0800 Subject: [PATCH] chores: more comments --- ceno_zkvm/src/uint.rs | 4 ++-- ceno_zkvm/src/uint/util.rs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ceno_zkvm/src/uint.rs b/ceno_zkvm/src/uint.rs index 64797647e..dbe0b3c8a 100644 --- a/ceno_zkvm/src/uint.rs +++ b/ceno_zkvm/src/uint.rs @@ -234,9 +234,9 @@ impl UIntLimbs { .unwrap_or_default(), "assign input length mismatch", ); - if let Some(carries_auxiliray_lt_config) = &self.carries_auxiliary_lt_config { + if let Some(carries_auxiliary_lt_config) = &self.carries_auxiliary_lt_config { // constrain carry range - for (lt_config, carry) in carries_auxiliray_lt_config.iter().zip_eq(carry_values) { + for (lt_config, carry) in carries_auxiliary_lt_config.iter().zip_eq(carry_values) { lt_config.assign_instance(instance, lkm, Into::::into(*carry), max_carry)?; } } diff --git a/ceno_zkvm/src/uint/util.rs b/ceno_zkvm/src/uint/util.rs index 7beba50c0..7919ebddc 100644 --- a/ceno_zkvm/src/uint/util.rs +++ b/ceno_zkvm/src/uint/util.rs @@ -54,7 +54,10 @@ mod tests { #[test] fn test_max_combinations_degree() { + // degree=1 is pure add, therefore only one term assert_eq!(1, max_combinations(1, 4)); + // for degree=2 mul, we have u[0]*v[3], u[1]*v[2], u[2]*v[1], u[3]*v[0] + // thus 4 terms assert_eq!(4, max_combinations(2, 4)); }