Skip to content

Commit

Permalink
Improving error message
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminsavage committed Mar 16, 2024
1 parent c8be623 commit 98c0543
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ipa-core/src/protocol/ipa_prf/malicious_security/lagrange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,19 @@ 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,
F: PrimeField,
N: ArrayLength,
M: ArrayLength,
{
fn from(value: CanonicalLagrangeDenominator<F, N>) -> Self {
// assertion that field is large enough
// when it is large enough, `F::try_from().unwrap()` below does not panic
assert!(
F::BITS > usize::BITS - (N::USIZE + M::USIZE).leading_zeros(),
u128::from(N::U64 + M::U64) < F::PRIME.into(),
"Field size {} is not large enough to hold {} + {} points",
F::BITS,
N::USIZE,
M::USIZE
F::PRIME.into(),

Check warning on line 149 in ipa-core/src/protocol/ipa_prf/malicious_security/lagrange.rs

View check run for this annotation

Codecov / codecov/patch

ipa-core/src/protocol/ipa_prf/malicious_security/lagrange.rs#L149

Added line #L149 was not covered by tests
N::U64,
M::U64
);

// assertion that table is not too large for the stack
Expand Down

0 comments on commit 98c0543

Please sign in to comment.