From 27fd9730d4ad07d7ed446d64881897e152f752de Mon Sep 17 00:00:00 2001 From: moven0831 Date: Tue, 24 Dec 2024 16:45:58 +0800 Subject: [PATCH] lint --- .../msm/metal_msm/tests/bigint/bigint_add_unsafe.rs | 4 ++-- .../src/msm/metal_msm/tests/bigint/bigint_add_wide.rs | 11 +++++------ .../src/msm/metal_msm/tests/bigint/bigint_sub.rs | 8 ++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_unsafe.rs b/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_unsafe.rs index 6911321..c3001aa 100644 --- a/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_unsafe.rs +++ b/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_unsafe.rs @@ -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); diff --git a/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_wide.rs b/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_wide.rs index 8e7b572..6524102 100644 --- a/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_wide.rs +++ b/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_wide.rs @@ -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() { @@ -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); @@ -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); @@ -184,4 +183,4 @@ pub fn test_bigint_add_overflow() { let result = BigInt::from_limbs(&result_limbs, log_limb_size); assert_eq!(result, expected); -} \ No newline at end of file +} diff --git a/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_sub.rs b/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_sub.rs index e658206..3d0a077 100644 --- a/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_sub.rs +++ b/mopro-msm/src/msm/metal_msm/tests/bigint/bigint_sub.rs @@ -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); @@ -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);