Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
moven0831 committed Dec 24, 2024
1 parent 715a224 commit 27fd973
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_unsafe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ pub fn test_bigint_add_unsafe() {
let (a, b, expected) = loop {
let a = BigInt::rand(&mut rng);
let b = BigInt::rand(&mut rng);

let mut expected = a.clone();
let overflow = expected.add_with_carry(&b);

// Break the loop if addition does not overflow
if !overflow {
break (a, b, expected);
Expand Down
11 changes: 5 additions & 6 deletions mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_wide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use ark_ff::{BigInt, BigInteger, UniformRand};
use ark_std::rand;
use metal::*;


#[test]
#[serial_test::serial]
pub fn test_bigint_add_no_overflow() {
Expand All @@ -22,10 +21,10 @@ pub fn test_bigint_add_no_overflow() {
let (a, b, expected) = loop {
let a = BigInt::rand(&mut rng);
let b = BigInt::rand(&mut rng);

let mut expected = a.clone();
let overflow = expected.add_with_carry(&b);

// Break the loop if addition does not overflow
if !overflow {
break (a, b, expected);
Expand Down Expand Up @@ -110,10 +109,10 @@ pub fn test_bigint_add_overflow() {
let (a, b, expected) = loop {
let a = BigInt::rand(&mut rng);
let b = BigInt::rand(&mut rng);

let mut expected = a.clone();
let overflow = expected.add_with_carry(&b);

// Break the loop if addition overflow
if overflow {
break (a, b, expected);
Expand Down Expand Up @@ -184,4 +183,4 @@ pub fn test_bigint_add_overflow() {

let result = BigInt::from_limbs(&result_limbs, log_limb_size);
assert_eq!(result, expected);
}
}
8 changes: 4 additions & 4 deletions mopro-msm/src/msm/metal_msm/tests/bigint/bigint_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ pub fn test_bigint_sub_no_underflow() {
let (a, b, expected) = loop {
let a = BigInt::rand(&mut rng);
let b = BigInt::rand(&mut rng);

let mut expected = a.clone();
let underflow = expected.sub_with_borrow(&b);

// Break the loop if subtraction does not underflow
if !underflow {
break (a, b, expected);
Expand Down Expand Up @@ -107,10 +107,10 @@ fn test_bigint_sub_underflow() {
let (a, b, expected) = loop {
let a = BigInt::rand(&mut rng);
let b = BigInt::rand(&mut rng);

let mut expected = a.clone();
let underflow = expected.sub_with_borrow(&b);

// Break the loop if subtraction does not underflow
if underflow {
break (a, b, expected);
Expand Down

0 comments on commit 27fd973

Please sign in to comment.