11use blake2:: digest:: { Digest , FixedOutput } ;
22
33use crate :: {
4- AggregationError , ClosedKeyRegistration , CoreVerifier , Index , Parameters , Signer ,
5- SingleSignature , SingleSignatureWithRegisteredParty , Stake , StmAggrSig , StmAggrVerificationKey ,
6- StmVerificationKey ,
4+ AggregateSignature , AggregateVerificationKey , AggregationError , BasicVerifier ,
5+ ClosedKeyRegistration , Index , Parameters , Signer , SingleSignature ,
6+ SingleSignatureWithRegisteredParty , Stake , StmVerificationKey ,
77} ;
88
99/// `StmClerk` can verify and aggregate `StmSig`s and verify `StmMultiSig`s.
1010/// Clerks can only be generated with the registration closed.
1111/// This avoids that a Merkle Tree is computed before all parties have registered.
1212#[ derive( Debug , Clone ) ]
13- pub struct StmClerk < D : Clone + Digest > {
13+ pub struct Clerk < D : Clone + Digest > {
1414 pub ( crate ) closed_reg : ClosedKeyRegistration < D > ,
1515 pub ( crate ) params : Parameters ,
1616}
1717
18- impl < D : Digest + Clone + FixedOutput > StmClerk < D > {
18+ impl < D : Digest + Clone + FixedOutput > Clerk < D > {
1919 /// Create a new `Clerk` from a closed registration instance.
2020 pub fn from_registration ( params : & Parameters , closed_reg : & ClosedKeyRegistration < D > ) -> Self {
2121 Self {
@@ -48,7 +48,7 @@ impl<D: Digest + Clone + FixedOutput> StmClerk<D> {
4848 & self ,
4949 sigs : & [ SingleSignature ] ,
5050 msg : & [ u8 ] ,
51- ) -> Result < StmAggrSig < D > , AggregationError > {
51+ ) -> Result < AggregateSignature < D > , AggregationError > {
5252 let sig_reg_list = sigs
5353 . iter ( )
5454 . map ( |sig| SingleSignatureWithRegisteredParty {
@@ -57,9 +57,9 @@ impl<D: Digest + Clone + FixedOutput> StmClerk<D> {
5757 } )
5858 . collect :: < Vec < SingleSignatureWithRegisteredParty > > ( ) ;
5959
60- let avk = StmAggrVerificationKey :: from ( & self . closed_reg ) ;
60+ let avk = AggregateVerificationKey :: from ( & self . closed_reg ) ;
6161 let msgp = avk. get_mt_commitment ( ) . concat_with_msg ( msg) ;
62- let mut unique_sigs = CoreVerifier :: dedup_sigs_for_indices (
62+ let mut unique_sigs = BasicVerifier :: dedup_sigs_for_indices (
6363 & self . closed_reg . total_stake ,
6464 & self . params ,
6565 & msgp,
@@ -75,15 +75,15 @@ impl<D: Digest + Clone + FixedOutput> StmClerk<D> {
7575
7676 let batch_proof = self . closed_reg . merkle_tree . get_batched_path ( mt_index_list) ;
7777
78- Ok ( StmAggrSig {
78+ Ok ( AggregateSignature {
7979 signatures : unique_sigs,
8080 batch_proof,
8181 } )
8282 }
8383
8484 /// Compute the `StmAggrVerificationKey` related to the used registration.
85- pub fn compute_avk ( & self ) -> StmAggrVerificationKey < D > {
86- StmAggrVerificationKey :: from ( & self . closed_reg )
85+ pub fn compute_avk ( & self ) -> AggregateVerificationKey < D > {
86+ AggregateVerificationKey :: from ( & self . closed_reg )
8787 }
8888
8989 /// Get the (VK, stake) of a party given its index.
0 commit comments