@@ -30,10 +30,9 @@ use frost_core::SigningPackage;
3030use frost_core:: {
3131 self as frost,
3232 keys:: { KeyPackage , PublicKeyPackage , SigningShare , VerifyingShare } ,
33- round1:: encode_group_commitments,
34- round1:: SigningCommitments ,
33+ round1:: { encode_group_commitments, SigningCommitments } ,
3534 serialization:: SerializableScalar ,
36- Ciphersuite , Error , Field , Group , Identifier , Scalar , VerifyingKey ,
35+ CheaterDetection , Ciphersuite , Error , Field , Group , Identifier , Scalar , VerifyingKey ,
3736} ;
3837
3938#[ cfg( feature = "serde" ) ]
@@ -161,9 +160,8 @@ pub fn sign_with_randomizer_seed<C: RandomizedCiphersuite>(
161160 frost:: round2:: sign ( signing_package, signer_nonces, & randomized_key_package)
162161}
163162
164- /// Re-randomized FROST signature share aggregation with the given [`RandomizedParams`],
165- /// which can be computed from the previously generated randomizer using
166- /// [`RandomizedParams::from_randomizer`].
163+ /// Re-randomized FROST signature share aggregation with the given
164+ /// [`RandomizedParams`].
167165///
168166/// See [`frost::aggregate`] for documentation on the other parameters.
169167pub fn aggregate < C > (
@@ -183,6 +181,29 @@ where
183181 )
184182}
185183
184+ /// Re-randomized FROST signature share aggregation with the given
185+ /// [`RandomizedParams`] using the given cheater detection strategy.
186+ ///
187+ /// See [`frost::aggregate_custom`] for documentation on the other parameters.
188+ pub fn aggregate_custom < C > (
189+ signing_package : & frost:: SigningPackage < C > ,
190+ signature_shares : & BTreeMap < frost:: Identifier < C > , frost:: round2:: SignatureShare < C > > ,
191+ pubkeys : & frost:: keys:: PublicKeyPackage < C > ,
192+ cheater_detection : CheaterDetection ,
193+ randomized_params : & RandomizedParams < C > ,
194+ ) -> Result < frost_core:: Signature < C > , Error < C > >
195+ where
196+ C : Ciphersuite ,
197+ {
198+ let randomized_public_key_package = pubkeys. randomize ( randomized_params) ?;
199+ frost:: aggregate_custom (
200+ signing_package,
201+ signature_shares,
202+ & randomized_public_key_package,
203+ cheater_detection,
204+ )
205+ }
206+
186207/// A randomizer. A random scalar which is used to randomize the key.
187208#[ derive( Copy , Clone , PartialEq , Eq ) ]
188209#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
0 commit comments