@@ -24,13 +24,13 @@ mod tests {
24
24
use rand_chacha:: ChaCha20Rng ;
25
25
use rand_core:: { RngCore , SeedableRng } ;
26
26
27
- use crate :: bls_multi_signature:: BlsVerificationKey ;
28
27
use crate :: merkle_tree:: MerkleBatchPath ;
29
28
use crate :: {
30
29
AggregateSignature , AggregationError , BasicVerifier , Clerk , CoreVerifierError , Initializer ,
31
30
KeyRegistration , Parameters , Signer , SingleSignature , SingleSignatureWithRegisteredParty ,
32
31
Stake ,
33
32
} ;
33
+ use crate :: { AggregateSignatureType , bls_multi_signature:: BlsVerificationKey } ;
34
34
35
35
type Sig = AggregateSignature < D > ;
36
36
type D = Blake2b < U32 > ;
@@ -169,7 +169,8 @@ mod tests {
169
169
let all_ps: Vec < usize > = ( 0 ..n) . collect ( ) ;
170
170
let sigs = find_signatures ( & msg, & ps, & all_ps) ;
171
171
172
- let msig = clerk. aggregate_signatures ( & sigs, & msg) ;
172
+ let aggr_sig_type = AggregateSignatureType :: Concatenation ;
173
+ let msig = clerk. aggregate_signatures_with_type ( & sigs, & msg, aggr_sig_type) ;
173
174
ProofTest { msig, clerk, msg }
174
175
} )
175
176
} )
@@ -252,10 +253,11 @@ mod tests {
252
253
let params = Parameters { m, k, phi_f: 0.2 } ;
253
254
let ps = setup_equal_parties( params, nparties) ;
254
255
let clerk = Clerk :: new_clerk_from_signer( & ps[ 0 ] ) ;
256
+ let aggr_sig_type = AggregateSignatureType :: Concatenation ;
255
257
256
258
let all_ps: Vec <usize > = ( 0 ..nparties) . collect( ) ;
257
259
let sigs = find_signatures( & msg, & ps, & all_ps) ;
258
- let msig = clerk. aggregate_signatures ( & sigs, & msg) ;
260
+ let msig = clerk. aggregate_signatures_with_type ( & sigs, & msg, aggr_sig_type ) ;
259
261
260
262
match msig {
261
263
Ok ( aggr) => {
@@ -265,7 +267,9 @@ mod tests {
265
267
Err ( AggregationError :: NotEnoughSignatures ( n, k) ) =>
266
268
assert!( n < params. k || k == params. k) ,
267
269
Err ( AggregationError :: UsizeConversionInvalid ) =>
268
- unreachable!( )
270
+ unreachable!( ) ,
271
+ Err ( AggregationError :: UnsupportedProofSystem ( _) ) =>
272
+ unreachable!( ) ,
269
273
}
270
274
}
271
275
@@ -277,6 +281,7 @@ mod tests {
277
281
seed in any:: <[ u8 ; 32 ] >( ) ,
278
282
batch_size in 2 ..10 ,
279
283
) {
284
+ let aggr_sig_type = AggregateSignatureType :: Concatenation ;
280
285
let mut rng = ChaCha20Rng :: from_seed( seed) ;
281
286
let mut aggr_avks = Vec :: new( ) ;
282
287
let mut aggr_stms = Vec :: new( ) ;
@@ -291,7 +296,7 @@ mod tests {
291
296
292
297
let all_ps: Vec <usize > = ( 0 ..nparties) . collect( ) ;
293
298
let sigs = find_signatures( & msg, & ps, & all_ps) ;
294
- let msig = clerk. aggregate_signatures ( & sigs, & msg) ;
299
+ let msig = clerk. aggregate_signatures_with_type ( & sigs, & msg, aggr_sig_type ) ;
295
300
296
301
match msig {
297
302
Ok ( aggr) => {
@@ -304,6 +309,7 @@ mod tests {
304
309
assert!( sigs. len( ) < params. k as usize )
305
310
}
306
311
Err ( AggregationError :: UsizeConversionInvalid ) => unreachable!( ) ,
312
+ Err ( AggregationError :: UnsupportedProofSystem ( _) ) => unreachable!( ) ,
307
313
}
308
314
}
309
315
@@ -317,7 +323,7 @@ mod tests {
317
323
318
324
let all_ps: Vec <usize > = ( 0 ..nparties) . collect( ) ;
319
325
let sigs = find_signatures( & msg, & ps, & all_ps) ;
320
- let fake_msig = clerk. aggregate_signatures ( & sigs, & msg) ;
326
+ let fake_msig = clerk. aggregate_signatures_with_type ( & sigs, & msg, aggr_sig_type ) ;
321
327
322
328
aggr_stms[ 0 ] = fake_msig. unwrap( ) ;
323
329
assert!( AggregateSignature :: batch_verify( & aggr_stms, & batch_msgs, & aggr_avks, & batch_params) . is_err( ) ) ;
@@ -381,10 +387,11 @@ mod tests {
381
387
let params = Parameters { m: 10 , k: 5 , phi_f: 1.0 } ;
382
388
let ps = setup_equal_parties( params, nparties) ;
383
389
let clerk = Clerk :: new_clerk_from_signer( & ps[ 0 ] ) ;
390
+ let aggr_sig_type = AggregateSignatureType :: Concatenation ;
384
391
385
392
let all_ps: Vec <usize > = ( 0 ..nparties) . collect( ) ;
386
393
let sigs = find_signatures( & msg, & ps, & all_ps) ;
387
- let msig = clerk. aggregate_signatures ( & sigs, & msg) ;
394
+ let msig = clerk. aggregate_signatures_with_type ( & sigs, & msg, aggr_sig_type ) ;
388
395
if let Ok ( aggr) = msig {
389
396
let bytes: Vec <u8 > = aggr. to_bytes( ) ;
390
397
let aggr2 = AggregateSignature :: from_bytes( & bytes) . unwrap( ) ;
@@ -421,8 +428,9 @@ mod tests {
421
428
assert!( sigs. len( ) < params. k as usize ) ;
422
429
423
430
let clerk = Clerk :: new_clerk_from_signer( & ps[ 0 ] ) ;
431
+ let aggr_sig_type = AggregateSignatureType :: Concatenation ;
424
432
425
- let msig = clerk. aggregate_signatures ( & sigs, & msg) ;
433
+ let msig = clerk. aggregate_signatures_with_type ( & sigs, & msg, aggr_sig_type ) ;
426
434
match msig {
427
435
Err ( AggregationError :: NotEnoughSignatures ( n, k) ) =>
428
436
assert!( n < params. k && params. k == k) ,
0 commit comments