Skip to content

Commit

Permalink
removed unconstrained
Browse files Browse the repository at this point in the history
  • Loading branch information
kevjue committed Feb 9, 2024
1 parent 5696d0f commit 81c6c1c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions baby-bear/src/baby_bear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl Field for BabyBear {
// Uses 30 Squares + 7 Multiplications => 37 Operations total.
#[cfg(target_os = "zkvm")]
{
unconstrained!
// unconstrained!
{
let p1 = *self;
let p100000000 = p1.exp_power_of_2(8);
Expand Down Expand Up @@ -375,7 +375,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);
Expand Down Expand Up @@ -441,7 +441,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 };
Expand Down Expand Up @@ -505,7 +505,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 {
Expand Down Expand Up @@ -565,7 +565,7 @@ impl Div for BabyBear {

#[cfg(target_os = "zkvm")]
{
unconstrained!
// unconstrained!
{
let ret = self * rhs.inverse();

Expand Down

0 comments on commit 81c6c1c

Please sign in to comment.