diff --git a/src/lib.rs b/src/lib.rs index cedd7c2..832ae04 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -614,6 +614,19 @@ impl PublicKeySet { Ok(Signature(interpolate(self.commit.degree(), samples)?)) } + /// Combines the shares into a signature that can be verified with the main public key. taking a threshold value as argument + pub fn combine_signatures_with_threshold<'a, T, I>( + threshold: usize, + shares: I, + ) -> Result + where + I: IntoIterator, + T: IntoFr, + { + let samples = shares.into_iter().map(|(i, share)| (i, &(share.0).0)); + Ok(Signature(interpolate(threshold, samples)?)) + } + /// Combines the shares to decrypt the ciphertext. pub fn decrypt<'a, T, I>(&self, shares: I, ct: &Ciphertext) -> Result> where