Skip to content

Commit

Permalink
add Debug derives for some DKG types (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschran authored Jan 24, 2024
1 parent 40d9a2f commit ea66012
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fastcrypto-tbls/src/dkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,31 @@ pub struct Message<G: GroupElement, EG: GroupElement> {
}

/// A complaint/fraud claim against a dealer that created invalid encrypted share.
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Complaint<EG: GroupElement> {
accused_sender: PartyId,
proof: RecoveryPackage<EG>,
}

/// A [Confirmation] is sent during the second phase of the protocol. It includes complaints
/// created by receiver of invalid encrypted shares (if any).
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Confirmation<EG: GroupElement> {
pub sender: PartyId,
/// List of complaints against other parties. Empty if there are none.
pub complaints: Vec<Complaint<EG>>,
}

/// Wrapper for collecting everything related to a processed message.
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProcessedMessage<G: GroupElement, EG: GroupElement> {
pub message: Message<G, EG>,
pub shares: Vec<Share<G::ScalarType>>, //possibly empty
pub complaint: Option<Complaint<EG>>,
}

/// Unique processed messages that are being used in the protocol.
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct UsedProcessedMessages<G: GroupElement, EG: GroupElement>(
pub Vec<ProcessedMessage<G, EG>>,
);
Expand Down

0 comments on commit ea66012

Please sign in to comment.