From 6fe62c88b68570b0321beaa1b6560fe0b4a1f256 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 21 Feb 2024 15:21:08 +0100 Subject: [PATCH] apply pr suggestions --- ferveo/src/api.rs | 4 ++++ ferveo/src/pvss.rs | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ferveo/src/api.rs b/ferveo/src/api.rs index caa0d9b4..d467eb64 100644 --- a/ferveo/src/api.rs +++ b/ferveo/src/api.rs @@ -710,6 +710,10 @@ mod test_ferveo_api { dkg.aggregate_transcripts(not_enough_messages).unwrap(); let result = insufficient_aggregate.verify(validators_num, &messages); assert!(result.is_err()); + assert!(matches!( + result, + Err(Error::InvalidAggregateVerificationParameters(_, _)) + )); // Unexpected transcripts in the aggregate or transcripts from a different ritual // Using same DKG parameters, but different DKG instances and validators diff --git a/ferveo/src/pvss.rs b/ferveo/src/pvss.rs index 34695bd3..5108f6b9 100644 --- a/ferveo/src/pvss.rs +++ b/ferveo/src/pvss.rs @@ -154,6 +154,7 @@ impl PubliclyVerifiableSS { .values() .map(|validator| { // ek_{i}^{eval_i}, i = validator index + // TODO: Replace with regular, single-element exponentiation fast_multiexp( // &evals.evals[i..i] = &evals.evals[i] &[evals[validator.share_index as usize]], // one share per validator @@ -399,9 +400,9 @@ pub(crate) fn aggregate( let mut shares = batch_to_projective_g2::(&first_pvss.shares); - // So now we're iterating over the PVSS instances, and adding their coefficients and shares, and their sigma + // So now we're iterating over the PVSS instances, and adding their coefficients and shares, and their // sigma is the sum of all the sigma_i, which is the proof of knowledge of the secret polynomial - // Aggregating is just adding the corresponding values in PVSS instances, so PVSS_i = PVSS_(i-1) PVSS_i + // Aggregating is just adding the corresponding values in PVSS instances, so PVSS = PVSS + PVSS_i for next_pvss in pvss_iter { sigma = (sigma + next_pvss.sigma).into(); coeffs