File tree Expand file tree Collapse file tree 2 files changed +22
-15
lines changed Expand file tree Collapse file tree 2 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -230,11 +230,17 @@ impl<C: CurveGroup> KeyResharing<Self> for FeldmanVss<C> {
230
230
old_commitment : & FeldmanCommitment < C > ,
231
231
row_commitment : & FeldmanCommitment < C > ,
232
232
reshare : & C :: ScalarField ,
233
- ) -> Result < bool , VssError > {
233
+ ) -> Result < ( ) , VssError > {
234
234
let old_public_share = Self :: derive_public_share ( old_pp, send_node_idx, old_commitment) ?;
235
235
let new_public_share = Self :: derive_public_share ( new_pp, recv_node_idx, row_commitment) ?;
236
- Ok ( C :: generator ( ) . mul ( reshare) == new_public_share
237
- && row_commitment[ 0 ] == old_public_share. into_affine ( ) )
236
+
237
+ if C :: generator ( ) . mul ( reshare) == new_public_share
238
+ && row_commitment[ 0 ] == old_public_share. into_affine ( )
239
+ {
240
+ Ok ( ( ) )
241
+ } else {
242
+ Err ( VssError :: FailedVerification )
243
+ }
238
244
}
239
245
240
246
fn combine (
@@ -416,17 +422,18 @@ mod tests {
416
422
// Verify reshares
417
423
for i in 0 ..old_n as usize {
418
424
for j in 0 ..new_n as usize {
419
- let is_valid = FeldmanVss :: < G1Projective > :: verify_reshare (
420
- & old_pp,
421
- & new_pp,
422
- i,
423
- j,
424
- & old_commitment,
425
- & row_commitments[ i] ,
426
- & reshare_matrix[ i] [ j] ,
427
- )
428
- . unwrap ( ) ;
429
- assert ! ( is_valid) ;
425
+ assert ! (
426
+ FeldmanVss :: <G1Projective >:: verify_reshare(
427
+ & old_pp,
428
+ & new_pp,
429
+ i,
430
+ j,
431
+ & old_commitment,
432
+ & row_commitments[ i] ,
433
+ & reshare_matrix[ i] [ j] ,
434
+ )
435
+ . is_ok( )
436
+ ) ;
430
437
}
431
438
}
432
439
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ pub trait KeyResharing<VSS: VerifiableSecretSharing> {
88
88
old_commitment : & VSS :: Commitment ,
89
89
row_commitment : & VSS :: Commitment ,
90
90
reshare : & VSS :: SecretShare ,
91
- ) -> Result < bool , VssError > ;
91
+ ) -> Result < ( ) , VssError > ;
92
92
93
93
/// Combine resharings to derive the new secret share
94
94
fn combine (
You can’t perform that action at this time.
0 commit comments