Skip to content

Commit

Permalink
add TryFrom<u128> trait bound
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmasny committed Feb 26, 2024
1 parent 0c88a39 commit 5ea2171
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ipa-core/src/protocol/ipa_prf/malicious_security/lagrange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct CanonicalLagrangeDenominator<F: Field, N: ArrayLength> {

impl<F, N> CanonicalLagrangeDenominator<F, N>
where
F: PrimeField,
F: PrimeField + TryFrom<u128>,
N: ArrayLength,
{
/// generates canonical Lagrange denominators
Expand Down Expand Up @@ -70,7 +70,7 @@ pub struct LagrangeTable<F: Field, N: ArrayLength, M: ArrayLength> {

impl<F, N> LagrangeTable<F, N, U1>
where
F: Field,
F: Field + TryFrom<u128>,
N: ArrayLength,
{
/// generates a `CanonicalLagrangeTable` from `CanoncialLagrangeDenominators` for a single output point
Expand Down Expand Up @@ -122,7 +122,7 @@ where
/// When the field size is too small for `N` evaluation points
fn compute_table_row(x_output: &F, table_row: &mut GenericArray<F, N>)
where
F: Field,
F: Field + TryFrom<u128>,
N: ArrayLength,
{
for (entry, i) in table_row.iter_mut().zip(0u64..) {
Expand All @@ -135,7 +135,7 @@ where

impl<F, N, M> From<CanonicalLagrangeDenominator<F, N>> for LagrangeTable<F, N, M>
where
F: Field,
F: Field + TryFrom<u128>,
N: ArrayLength,
M: ArrayLength,
{
Expand Down Expand Up @@ -209,7 +209,7 @@ mod test {

impl<F, N> From<MonomialFormPolynomial<F, N>> for Polynomial<F, N>
where
F: Field,
F: Field + TryFrom<u128>,
N: ArrayLength,
{
fn from(value: MonomialFormPolynomial<F, N>) -> Self {
Expand Down

0 comments on commit 5ea2171

Please sign in to comment.