Skip to content

Commit

Permalink
MVPoly: implement compute_cross_terms
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Aug 28, 2024
1 parent 6612a08 commit bb7257e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions mvpoly/src/prime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,40 @@ impl<F: PrimeField, const N: usize, const D: usize> Dense<F, N, D> {
}
})
}

/// Compute the cross-terms as described in [Behind Nova: cross-terms
/// computation for high degree
/// gates](https://hackmd.io/@dannywillems/Syo5MBq90)
///
/// The polynomial must not necessarily be homogeneous. For this reason, the
/// values `u1` and `u2` represents the extra variable that is used to make
/// the polynomial homogeneous.
///
/// The homogeneous degree is supposed to be the one defined by the type of
/// the polynomial, i.e. `D`.
///
/// A randomizer, coined, `r`, is used to compute the cross-terms.
///
/// The output is a list of `D - 1` values that represents the cross-terms
/// for each power of `r`.
/// The output type is a vector because it is not possible for now to
/// perform computation on `const usize`
// IMPROVEME: Dummy implementation, a cache can be used to save the
// previously computed multiplications and powers.
pub fn compute_cross_terms(
&self,
_eval1: [F; N],
_eval2: [F; N],
_r: F,
_u1: F,
_u2: F,
) -> Vec<F> {
assert!(
D >= 2,
"The degree of the polynomial must be greater than 2"
);
unimplemented!()
}
}

impl<F: PrimeField, const N: usize, const D: usize> Default for Dense<F, N, D> {
Expand Down

0 comments on commit bb7257e

Please sign in to comment.