Skip to content

Commit

Permalink
add debug trait bound
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmasny committed Feb 26, 2024
1 parent 5ea2171 commit 0a81a8e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ipa-core/src/protocol/ipa_prf/malicious_security/lagrange.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::fmt::Debug;

use generic_array::{sequence::GenericSequence, ArrayLength, GenericArray};
use typenum::{Unsigned, U1};

Expand All @@ -22,6 +24,7 @@ pub struct CanonicalLagrangeDenominator<F: Field, N: ArrayLength> {
impl<F, N> CanonicalLagrangeDenominator<F, N>
where
F: PrimeField + TryFrom<u128>,
<F as TryFrom<u128>>::Error: Debug,
N: ArrayLength,
{
/// generates canonical Lagrange denominators
Expand Down Expand Up @@ -71,6 +74,7 @@ pub struct LagrangeTable<F: Field, N: ArrayLength, M: ArrayLength> {
impl<F, N> LagrangeTable<F, N, U1>
where
F: Field + TryFrom<u128>,
<F as TryFrom<u128>>::Error: Debug,
N: ArrayLength,
{
/// generates a `CanonicalLagrangeTable` from `CanoncialLagrangeDenominators` for a single output point
Expand Down Expand Up @@ -123,6 +127,7 @@ where
fn compute_table_row(x_output: &F, table_row: &mut GenericArray<F, N>)
where
F: Field + TryFrom<u128>,
<F as TryFrom<u128>>::Error: Debug,
N: ArrayLength,
{
for (entry, i) in table_row.iter_mut().zip(0u64..) {
Expand All @@ -136,6 +141,7 @@ where
impl<F, N, M> From<CanonicalLagrangeDenominator<F, N>> for LagrangeTable<F, N, M>
where
F: Field + TryFrom<u128>,
<F as TryFrom<u128>>::Error: Debug,
N: ArrayLength,
M: ArrayLength,
{
Expand Down Expand Up @@ -163,6 +169,8 @@ where

#[cfg(all(test, unit_test))]
mod test {
use std::fmt::Debug;

use generic_array::{sequence::GenericSequence, ArrayLength, GenericArray};
use proptest::{prelude::*, proptest};
use typenum::{U1, U32, U7, U8};
Expand Down Expand Up @@ -210,6 +218,7 @@ mod test {
impl<F, N> From<MonomialFormPolynomial<F, N>> for Polynomial<F, N>
where
F: Field + TryFrom<u128>,
<F as TryFrom<u128>>::Error: Debug,
N: ArrayLength,
{
fn from(value: MonomialFormPolynomial<F, N>) -> Self {
Expand Down

0 comments on commit 0a81a8e

Please sign in to comment.