Skip to content

Commit

Permalink
Change the API of eval to take an array instead
Browse files Browse the repository at this point in the history
There is really no reason for taking an iterator, just makes things worse for the compiler
  • Loading branch information
akoshelev committed Nov 7, 2024
1 parent 875e70a commit 59a6fb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions ipa-core/src/protocol/ipa_prf/malicious_security/lagrange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,8 @@ where
/// that were used to generate this table.
/// It is assumed that the `y_coordinates` provided to this function correspond the values of the _input_ "x coordinates"
/// that were used to generate this table.
pub fn eval<I>(&self, y_coordinates: I) -> [F; M]
where
I: IntoIterator + Copy,
I::IntoIter: ExactSizeIterator,
I::Item: Borrow<F>,
pub fn eval(&self, y_coordinates: &[F; N]) -> [F; M]
{
debug_assert_eq!(y_coordinates.into_iter().len(), N);

self.table
.iter()
.map(|table_row| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ where
last_array[1..last_u_or_v_values.len()].copy_from_slice(&last_u_or_v_values[1..]);

// compute and output p_or_q
tables.last().unwrap().eval(last_array)[0]
tables.last().unwrap().eval(&last_array)[0]
}

#[cfg(all(test, unit_test))]
Expand Down

0 comments on commit 59a6fb3

Please sign in to comment.