@@ -498,20 +498,13 @@ impl<C: CurveGroup> ShoupVess<C> {
498
498
. io_pattern ( & vss_pp, aad, & mode)
499
499
. to_verifier_state ( & ct. transcript ) ;
500
500
501
- // verifier logic until Step 4b
502
- let ( expected_comm, h, subset_seed, mut shifted_polys, mut mre_cts) =
501
+ // verifier logic
502
+ let ( expected_comm, h, subset_seed, mut shifted_polys, mut mre_cts, mut seeds ) =
503
503
self . verify_core ( & vss_pp, & mut verifier_state, & mode) ?;
504
504
if & expected_comm != comm {
505
505
return Err ( VessError :: WrongCommitment ) ;
506
506
}
507
507
508
- // parse out prover's response for k notin S
509
- let mut seeds = VecDeque :: new ( ) ;
510
- for _ in self . subset_size ..self . num_repetition {
511
- let seed: [ u8 ; 32 ] = verifier_state. next_bytes ( ) ?;
512
- seeds. push_back ( seed) ;
513
- }
514
-
515
508
// recompute the hash of all the dealings,
516
509
let mut hasher = sha2:: Sha256 :: new ( ) ;
517
510
hasher. update ( aad) ;
@@ -570,13 +563,13 @@ impl<C: CurveGroup> ShoupVess<C> {
570
563
}
571
564
}
572
565
573
- // Verifier's core logic until step 4.b (exclusive) , shared between `verify()` and `decrypt()`.
566
+ // Verifier's core logic, shared between `verify()` and `decrypt()`.
574
567
fn verify_core (
575
568
& self ,
576
569
vss_pp : & FeldmanVssPublicParam ,
577
570
verifier_state : & mut VerifierState ,
578
571
mode : & Mode < C > ,
579
- ) -> Result < ProverMessageUntilStep4b < C > , VessError > {
572
+ ) -> Result < ProverMessage < C > , VessError > {
580
573
let t = vss_pp. t . get ( ) ;
581
574
let n = vss_pp. n . get ( ) ;
582
575
@@ -624,7 +617,15 @@ impl<C: CurveGroup> ShoupVess<C> {
624
617
}
625
618
mre_cts. push_back ( MultiRecvCiphertext { epk, cts } ) ;
626
619
}
627
- Ok ( ( comm. into ( ) , h, subset_seed, shifted_polys, mre_cts) )
620
+
621
+ // parse out prover's response for k notin S (now internalized)
622
+ let mut seeds = VecDeque :: new ( ) ;
623
+ for _ in self . subset_size ..self . num_repetition {
624
+ let seed: [ u8 ; 32 ] = verifier_state. next_bytes ( ) ?;
625
+ seeds. push_back ( seed) ;
626
+ }
627
+
628
+ Ok ( ( comm. into ( ) , h, subset_seed, shifted_polys, mre_cts, seeds) )
628
629
}
629
630
630
631
// core logic to decrypt
@@ -643,8 +644,8 @@ impl<C: CurveGroup> ShoupVess<C> {
643
644
. io_pattern ( & vss_pp, aad, & mode)
644
645
. to_verifier_state ( & ct. transcript ) ;
645
646
646
- // verifier logic until Step 4b
647
- let ( comm, _h, subset_seed, shifted_polys, mre_cts) =
647
+ // verifier logic
648
+ let ( comm, _h, subset_seed, shifted_polys, mre_cts, _seeds ) =
648
649
self . verify_core ( & vss_pp, & mut verifier_state, & mode) ?;
649
650
let subset_indices = self . map_subset_seed ( subset_seed) ;
650
651
debug_assert_eq ! ( subset_indices. len( ) , shifted_polys. len( ) ) ;
@@ -675,17 +676,19 @@ impl<C: CurveGroup> ShoupVess<C> {
675
676
}
676
677
}
677
678
678
- /// (C, h, s, { rho_k.shifted_poly }_{k in S}, { rho_k.mre_ciphertext }_{k in S})
679
+ /// (C, h, s, { rho_k.shifted_poly }_{k in S}, { rho_k.mre_ciphertext }_{k in S}, seeds )
679
680
/// where C is Feldman commitment, h is output of H_compress of all dealings,
680
681
/// s is subset seed, S is the corresponding subset
681
682
/// shifted_poly is omega''_k in paper
683
+ /// seeds are the random seeds for k not in S
682
684
#[ allow( type_alias_bounds) ]
683
- type ProverMessageUntilStep4b < C : CurveGroup > = (
685
+ type ProverMessage < C : CurveGroup > = (
684
686
FeldmanCommitment < C > ,
685
687
[ u8 ; 32 ] ,
686
688
[ u8 ; 16 ] ,
687
689
VecDeque < Vec < C :: ScalarField > > ,
688
690
VecDeque < MultiRecvCiphertext < C > > ,
691
+ VecDeque < [ u8 ; 32 ] > ,
689
692
) ;
690
693
691
694
// returns x * a / b without overflow panic, assuming the result < u128::MAX
0 commit comments