From f5a84496bbc946d133bd9a646417d6b5eee8e249 Mon Sep 17 00:00:00 2001 From: Avory Date: Fri, 25 Jul 2025 15:27:03 +0300 Subject: [PATCH] Update arithmetic_tests.rs --- tests/arithmetic_tests.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/arithmetic_tests.rs b/tests/arithmetic_tests.rs index 9607969d..79504961 100644 --- a/tests/arithmetic_tests.rs +++ b/tests/arithmetic_tests.rs @@ -82,7 +82,7 @@ fn addition_test( let a_plus_b = a + &b; let a_plus_b_actual = a_plus_b.value().unwrap(); - let a_plus_b_expected = a_native + &b_native; + let a_plus_b_expected = a_native + b_native; assert!(a_plus_b_actual.eq(&a_plus_b_expected), "a + b failed"); } @@ -107,7 +107,7 @@ fn multiplication_test( let a_times_b = a * &b; let a_times_b_actual = a_times_b.value().unwrap(); - let a_times_b_expected = a_native * &b_native; + let a_times_b_expected = a_native * b_native; assert!( a_times_b_actual.eq(&a_times_b_expected), @@ -161,7 +161,7 @@ fn equality_test( let a_times_b = a * &b; - let a_times_b_expected = a_native * &b_native; + let a_times_b_expected = a_native * b_native; let a_times_b_expected_gadget = EmulatedFpVar::::new_witness( ark_relations::ns!(cs, "alloc a * b"), || Ok(a_times_b_expected), @@ -180,7 +180,7 @@ fn edge_cases_test( let one = EmulatedFpVar::::one(); let a_native = TargetF::rand(rng); - let minus_a_native = TargetF::zero() - &a_native; + let minus_a_native = TargetF::zero() - a_native; let a = EmulatedFpVar::::new_witness(ark_relations::ns!(cs, "alloc a"), || { Ok(a_native) @@ -265,11 +265,11 @@ fn distribution_law_test let b_native = TargetF::rand(rng); let c_native = TargetF::rand(rng); - let a_plus_b_native = a_native.clone() + &b_native; - let a_times_c_native = a_native.clone() * &c_native; - let b_times_c_native = b_native.clone() * &c_native; - let a_plus_b_times_c_native = a_plus_b_native.clone() * &c_native; - let a_times_c_plus_b_times_c_native = a_times_c_native + &b_times_c_native; + let a_plus_b_native = a_native + b_native; + let a_times_c_native = a_native * c_native; + let b_times_c_native = b_native * c_native; + let a_plus_b_times_c_native = a_plus_b_native * c_native; + let a_times_c_plus_b_times_c_native = a_times_c_native + b_times_c_native; assert!( a_plus_b_times_c_native.eq(&a_times_c_plus_b_times_c_native), @@ -442,7 +442,7 @@ fn mul_and_add_stress_test( // overflowing for _ in 0..TEST_COUNT + BaseField::MODULUS_BIT_SIZE as usize { // double - num_native = num_native + &num_native; + num_native = num_native + num_native; num = &num + # assert!(num.value().unwrap().eq(&num_native), "result incorrect"); @@ -519,7 +519,7 @@ fn double_stress_test_2( assert!(num.value().unwrap().eq(&num_native)); // square - let num_square_native = num_native * &num_native; + let num_square_native = num_native * num_native; let num_square = &num * # assert!(num_square.value().unwrap().eq(&num_square_native)); } @@ -537,13 +537,13 @@ fn double_stress_test_3( .unwrap(); for _ in 0..TEST_COUNT { // double - num_native = num_native + &num_native; + num_native = num_native + num_native; num = &num + # assert!(num.value().unwrap().eq(&num_native)); // square - let num_square_native = num_native * &num_native; + let num_square_native = num_native * num_native; let num_square = &num * # let num_square_native_gadget = EmulatedFpVar::::new_witness( ark_relations::ns!(cs, "repetition: alloc_native num"),