@@ -14,7 +14,7 @@ use crate::nodes::{Nodes, PartyId};
1414use crate :: polynomial:: { Eval , Poly } ;
1515use crate :: random_oracle:: RandomOracle ;
1616use crate :: threshold_schnorr:: bcs:: BCSSerialized ;
17- use crate :: threshold_schnorr:: complaint:: { Complaint , ComplaintResponse } ;
17+ use crate :: threshold_schnorr:: complaint:: { ComplaintResponse , RecoveryProof } ;
1818use crate :: threshold_schnorr:: Extensions :: Encryption ;
1919use crate :: threshold_schnorr:: { random_oracle_from_sid, EG , G , S } ;
2020use crate :: types;
@@ -63,6 +63,14 @@ pub enum ProcessedMessage {
6363 Complaint ( Complaint ) ,
6464}
6565
66+ /// A complaint by a receiver who could not decrypt or verify its shares from the dealer's
67+ /// broadcast. Given enough responses, the accuser can recover its shares.
68+ #[ derive( Clone , Debug , Serialize , Deserialize ) ]
69+ pub struct Complaint {
70+ pub accuser_id : PartyId ,
71+ pub proof : RecoveryProof ,
72+ }
73+
6674/// The output of a receiver after a single instance of AVSS: The shares for each nonce + commitments for the next round.
6775#[ derive( Debug , Clone , Serialize , Deserialize ) ]
6876pub struct PartialOutput {
@@ -284,13 +292,16 @@ impl Receiver {
284292 my_shares,
285293 feldman_commitment : message. feldman_commitment . clone ( ) ,
286294 } ) ) ,
287- Err ( _) => Ok ( ProcessedMessage :: Complaint ( Complaint :: create (
288- self . id ,
289- & message. ciphertext . shared ( ) ,
290- & self . enc_secret_key ,
291- & self . random_oracle ( ) ,
292- & mut rand:: thread_rng ( ) ,
293- ) ) ) ,
295+ Err ( _) => Ok ( ProcessedMessage :: Complaint ( Complaint {
296+ accuser_id : self . id ,
297+ proof : RecoveryProof :: create (
298+ self . id ,
299+ & message. ciphertext . shared ( ) ,
300+ & self . enc_secret_key ,
301+ & self . random_oracle ( ) ,
302+ & mut rand:: thread_rng ( ) ,
303+ ) ,
304+ } ) ) ,
294305 }
295306 }
296307
@@ -301,7 +312,8 @@ impl Receiver {
301312 complaint : & Complaint ,
302313 my_output : & PartialOutput ,
303314 ) -> FastCryptoResult < ComplaintResponse < SharesForNode > > {
304- complaint. check (
315+ complaint. proof . check (
316+ complaint. accuser_id ,
305317 & self . nodes . node_id_to_node ( complaint. accuser_id ) ?. pk ,
306318 & message. ciphertext . encs [ complaint. accuser_id as usize ] ,
307319 & message. ciphertext . shared ( ) ,
@@ -550,11 +562,11 @@ mod tests {
550562 use crate :: ecies_v1:: { MultiRecipientEncryption , PublicKey } ;
551563 use crate :: nodes:: { Node , Nodes , PartyId } ;
552564 use crate :: polynomial:: Poly ;
565+ use crate :: threshold_schnorr:: avss:: Complaint ;
553566 use crate :: threshold_schnorr:: avss:: { Dealer , Message , Receiver } ;
554567 use crate :: threshold_schnorr:: avss:: { PartialOutput , ProcessedMessage } ;
555568 use crate :: threshold_schnorr:: avss:: { ReceiverOutput , SharesForNode } ;
556569 use crate :: threshold_schnorr:: bcs:: BCSSerialized ;
557- use crate :: threshold_schnorr:: complaint:: Complaint ;
558570 use crate :: threshold_schnorr:: tests:: restrict;
559571 use crate :: threshold_schnorr:: Extensions :: Encryption ;
560572 use crate :: threshold_schnorr:: { EG , G , S } ;
0 commit comments