From f8f672cd40e4963140d43cb561c6956d99f7e56a Mon Sep 17 00:00:00 2001 From: Kevin Jue Date: Fri, 9 Feb 2024 11:58:20 -0800 Subject: [PATCH] fix --- baby-bear/src/baby_bear.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/baby-bear/src/baby_bear.rs b/baby-bear/src/baby_bear.rs index 709c2d3c..03a90474 100644 --- a/baby-bear/src/baby_bear.rs +++ b/baby-bear/src/baby_bear.rs @@ -342,7 +342,7 @@ impl Add for BabyBear { // .or_insert(0) += 1; #[cfg(target_os = "zkvm")] { - // unconstrained! + unconstrained! { let mut sum = self.value + rhs.value; let (corr_sum, over) = sum.overflowing_sub(P); @@ -355,7 +355,7 @@ impl Add for BabyBear { let mut bytes: [u8; 4] = [0; 4]; io::read_hint_slice(&mut bytes); - Babybear::from_canonical_u32(u32::from_le_bytes(bytes)); + Babybear::from_canonical_u32(u32::from_le_bytes(bytes)) } // if !*in_hash { @@ -407,7 +407,7 @@ impl Sub for BabyBear { #[cfg(target_os = "zkvm")] { - // unconstrained! + unconstrained! { let (mut diff, over) = self.value.overflowing_sub(rhs.value); let corr = if over { P } else { 0 }; @@ -418,7 +418,7 @@ impl Sub for BabyBear { let mut bytes: [u8; 4] = [0; 4]; io::read_hint_slice(&mut bytes); - BabyBear::from_canonical_u32(u32::from_le_bytes(bytes)); + BabyBear::from_canonical_u32(u32::from_le_bytes(bytes)) } // if !*in_hash { @@ -470,7 +470,7 @@ impl Mul for BabyBear { #[cfg(target_os = "zkvm")] { - // unconstrained! + unconstrained! { let long_prod = self.value as u64 * rhs.value as u64; let ret = Self { @@ -482,7 +482,7 @@ impl Mul for BabyBear { let mut bytes: [u8; 4] = [0; 4]; io::read_hint_slice(&mut bytes); - BabyBear::from_canonical_u32(u32::from_le_bytes(bytes)); + BabyBear::from_canonical_u32(u32::from_le_bytes(bytes)) } // if !*in_hash { // println!("cycle-tracker-end: BabyBear_mul");