Skip to content

Commit

Permalink
fix: borrow flags miscalculation on lower limb limits
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo-Dallegri committed Dec 12, 2024
1 parent 0d12343 commit 2fd30f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/fns/unconstrained_helpers.nr
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ pub(crate) unconstrained fn __validate_gt_remainder<let N: u32>(
let mut b_u60: U60Repr<N, 2> = U60Repr::from(rhs);

let underflow = b_u60.gte(a_u60);
b_u60 += U60Repr::one();
assert(underflow == false, "BigNum::validate_gt check fails");
let mut result_u60: U60Repr<N, 2> = U60Repr { limbs: [0; 2 * N] };

let mut carry_in: u64 = 0;
let mut borrow_in: u64 = 0;
let mut borrow_in: u64 = 1;
let mut borrow_flags: [bool; N] = [false; N];
let mut carry_flags: [bool; N] = [false; N];
for i in 0..2 * N {
Expand Down

0 comments on commit 2fd30f9

Please sign in to comment.