Skip to content

Commit

Permalink
put back input size check in aggregate
Browse files Browse the repository at this point in the history
  • Loading branch information
aschran committed Dec 12, 2023
1 parent 18c7fa0 commit 7e7b0f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions fastcrypto-tbls/src/tbls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::borrow::Borrow;
use crate::dl_verification::{batch_coefficients, get_random_scalars};
use crate::polynomial::Poly;
use crate::types::IndexedValue;
use fastcrypto::error::FastCryptoResult;
use fastcrypto::error::{FastCryptoError, FastCryptoResult};
use fastcrypto::groups::{GroupElement, HashToGroupElement, MultiScalarMul, Scalar};
use fastcrypto::traits::AllowedRng;
use itertools::Itertools;
Expand Down Expand Up @@ -97,10 +97,9 @@ pub trait ThresholdBls {
let unique_partials = partials
.unique_by(|p| p.borrow().index)
.take(threshold as usize);
// TODO-DNS: I think this can be removed because it's already verified in `get_lagrange_coefficients_for_c0`, correct?
// if unique_partials.len() != threshold as usize {
// return Err(FastCryptoError::NotEnoughInputs);
// }
if unique_partials.clone().count() != threshold as usize {
return Err(FastCryptoError::NotEnoughInputs);
}
// No conversion is required since PartialSignature<S> and Eval<S> are different aliases to
// IndexedValue<S>.
Poly::<Self::Signature>::recover_c0_msm(threshold, unique_partials)
Expand Down
1 change: 0 additions & 1 deletion fastcrypto-tbls/src/tests/polynomial_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ mod scalar_tests {
for _ in 0..10 {
shares.shuffle(&mut thread_rng());
let used_shares = shares.iter().take(124);
// TODO-DNS verify
assert_eq!(c0, &Poly::<S>::recover_c0(124, used_shares).unwrap());
}
}
Expand Down

0 comments on commit 7e7b0f1

Please sign in to comment.