diff --git a/Cargo.toml b/Cargo.toml index c9bc29a5f..7ab3cc902 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ strum = { version = "0.26", features = ["derive"] } syn = "2.0" test-strategy = "0.3.1" thiserror = "1.0" -twenty-first = "0.38" +twenty-first = "0.40" unicode-width = "0.1" [workspace.lints.clippy] @@ -111,6 +111,3 @@ verbose_bit_mask = "warn" version = "1.5" default-features = false features = ["precommit-hook", "run-cargo-clippy", "run-cargo-fmt"] - -[patch.crates-io] -twenty-first = { git = "https://github.com/Neptune-Crypto/twenty-first.git", rev = "b57ed599" } diff --git a/triton-vm/src/arithmetic_domain.rs b/triton-vm/src/arithmetic_domain.rs index bd92b2f19..7c9d9ca02 100644 --- a/triton-vm/src/arithmetic_domain.rs +++ b/triton-vm/src/arithmetic_domain.rs @@ -69,7 +69,7 @@ impl ArithmeticDomain { { self.domain_values() .iter() - .map(|&v| polynomial.evaluate(&v.into())) + .map(|&v| polynomial.evaluate(v.into())) .collect() } @@ -235,7 +235,7 @@ mod tests { // Verify that batch-evaluated values match a manual evaluation for i in 0..order { assert_eq!( - poly.evaluate(&b_domain.domain_value(i as u32)), + poly.evaluate(b_domain.domain_value(i as u32)), values[i as usize] ); } diff --git a/triton-vm/src/stark.rs b/triton-vm/src/stark.rs index ecddf8800..126db84a9 100644 --- a/triton-vm/src/stark.rs +++ b/triton-vm/src/stark.rs @@ -263,7 +263,7 @@ impl Stark { let out_of_domain_point_curr_row_pow_num_segments = out_of_domain_point_curr_row.mod_pow_u32(NUM_QUOTIENT_SEGMENTS as u32); let out_of_domain_curr_row_quot_segments = quotient_segment_polynomials - .map(|poly| poly.evaluate(&out_of_domain_point_curr_row_pow_num_segments)) + .map(|poly| poly.evaluate(out_of_domain_point_curr_row_pow_num_segments)) .to_vec() .try_into() .unwrap(); @@ -345,7 +345,7 @@ impl Stark { prof_stop!(maybe_profiler, "interpolate"); prof_start!(maybe_profiler, "base&ext curr row"); let out_of_domain_curr_row_base_and_ext_value = - base_and_ext_interpolation_poly.evaluate(&out_of_domain_point_curr_row); + base_and_ext_interpolation_poly.evaluate(out_of_domain_point_curr_row); let base_and_ext_curr_row_deep_codeword = Self::deep_codeword( &base_and_ext_codeword.to_vec(), short_domain, @@ -356,7 +356,7 @@ impl Stark { prof_start!(maybe_profiler, "base&ext next row"); let out_of_domain_next_row_base_and_ext_value = - base_and_ext_interpolation_poly.evaluate(&out_of_domain_point_next_row); + base_and_ext_interpolation_poly.evaluate(out_of_domain_point_next_row); let base_and_ext_next_row_deep_codeword = Self::deep_codeword( &base_and_ext_codeword.to_vec(), short_domain, @@ -367,7 +367,7 @@ impl Stark { prof_start!(maybe_profiler, "segmented quotient"); let out_of_domain_curr_row_quot_segments_value = quotient_segments_interpolation_poly - .evaluate(&out_of_domain_point_curr_row_pow_num_segments); + .evaluate(out_of_domain_point_curr_row_pow_num_segments); let quotient_segments_curr_row_deep_codeword = Self::deep_codeword( "ient_segments_codeword.to_vec(), short_domain, @@ -2418,7 +2418,7 @@ pub(crate) mod tests { let low_deg_codeword = domain.evaluate(&low_deg_poly); let out_of_domain_point: XFieldElement = thread_rng().gen(); - let out_of_domain_value = low_deg_poly.evaluate(&out_of_domain_point); + let out_of_domain_value = low_deg_poly.evaluate(out_of_domain_point); let deep_poly = Stark::deep_codeword( &low_deg_codeword, @@ -2449,11 +2449,11 @@ pub(crate) mod tests { ) { let x_pow_n = x.mod_pow_u32(N as u32); let evaluate_segment = |(segment_idx, segment): (_, &Polynomial<_>)| { - segment.evaluate(&x_pow_n) * x.mod_pow_u32(segment_idx as u32) + segment.evaluate(x_pow_n) * x.mod_pow_u32(segment_idx as u32) }; let evaluated_segments = segments.iter().enumerate().map(evaluate_segment); let sum_of_evaluated_segments = evaluated_segments.fold(FF::zero(), |acc, x| acc + x); - assert!(f.evaluate(&x) == sum_of_evaluated_segments); + assert!(f.evaluate(x) == sum_of_evaluated_segments); } fn assert_segments_degrees_are_small_enough( diff --git a/triton-vm/src/table/master_table.rs b/triton-vm/src/table/master_table.rs index 156540e73..d0e7b5fde 100644 --- a/triton-vm/src/table/master_table.rs +++ b/triton-vm/src/table/master_table.rs @@ -456,7 +456,7 @@ impl MasterTable for MasterBaseTable { fn row(&self, row_index: XFieldElement) -> Array1 { self.interpolation_polynomials() .into_par_iter() - .map(|polynomial| polynomial.evaluate(&row_index)) + .map(|polynomial| polynomial.evaluate(row_index)) .collect::>() .into() } @@ -557,7 +557,7 @@ impl MasterTable for MasterExtTable { self.interpolation_polynomials() .slice(s![..NUM_EXT_COLUMNS]) .into_par_iter() - .map(|polynomial| polynomial.evaluate(&row_index)) + .map(|polynomial| polynomial.evaluate(row_index)) .collect::>() .into() } @@ -1266,7 +1266,7 @@ mod tests { assert_eq!(big_order as usize, initial_zerofier_inv.len()); assert_eq!(1, initial_zerofier_poly.degree()); assert!(initial_zerofier_poly - .evaluate(&small_domain.domain_value(0)) + .evaluate(small_domain.domain_value(0)) .is_zero()); let consistency_zerofier_inv = @@ -1277,7 +1277,7 @@ mod tests { assert_eq!(big_order as usize, consistency_zerofier_inv.len()); assert_eq!(small_order as isize, consistency_zerofier_poly.degree()); for val in small_domain.domain_values() { - assert!(consistency_zerofier_poly.evaluate(&val).is_zero()); + assert!(consistency_zerofier_poly.evaluate(val).is_zero()); } let transition_zerofier_inv = @@ -1286,7 +1286,7 @@ mod tests { let transition_zerofier_poly = big_domain.interpolate(&transition_zerofier); assert_eq!(big_order as usize, transition_zerofier_inv.len()); assert_eq!(small_order as isize - 1, transition_zerofier_poly.degree()); - for val in small_domain + for &val in small_domain .domain_values() .iter() .take(small_order as usize - 1) @@ -1300,7 +1300,7 @@ mod tests { assert_eq!(big_order as usize, terminal_zerofier_inv.len()); assert_eq!(1, terminal_zerofier_poly.degree()); assert!(terminal_zerofier_poly - .evaluate(&small_domain.domain_value(small_order as u32 - 1)) + .evaluate(small_domain.domain_value(small_order as u32 - 1)) .is_zero()); }