Skip to content

Commit

Permalink
refactor documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
taniasaleem committed Jul 12, 2024
1 parent 45dc27c commit 245e18d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
16 changes: 10 additions & 6 deletions tss/src/dkg.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
//! # Distributed Key Generation (DKG) Module
//! The DKG module is responsible for managing the Distributed Key Generation process, which allows a set of participants to collectively generate a shared secret key. This process involves multiple rounds of communication and ensures that no single participant has access to the entire secret key. The module supports handling messages, committing to secret shares, and transitioning through different stages of the DKG process.
//! The DKG module is responsible for managing the Distributed Key Generation
//! process, which allows a set of participants to collectively generate a
//! shared secret key. This process involves multiple rounds of communication
//! and ensures that no single participant has access to the entire secret key.
//! The module supports handling messages, committing to secret shares, and
//! transitioning through different stages of the DKG process.
//!
//!
use frost_evm::frost_secp256k1::Signature;
Expand All @@ -13,16 +18,15 @@ use serde::{Deserialize, Serialize};
use std::collections::{BTreeSet, HashMap};

/// Defines different actions that can occur during the DKG process:
///
/// - Commit: Send a commitment with a proof.
/// - Send: Send messages to other participants.
/// - Complete: Completion of the DKG process with a key package and commitment.
/// - Failure: Represents a failure in the process.
#[derive(Clone)]
pub enum DkgAction {
/// Send a commitment with a proof.
Commit(VerifiableSecretSharingCommitment, Signature),
/// Send messages to other participants.
Send(Vec<(Identifier, DkgMessage)>),
/// Completion of the DKG process with a key package and commitment.
Complete(KeyPackage, PublicKeyPackage, VerifiableSecretSharingCommitment),
/// Represents a failure in the process.
Failure(Error),
}

Expand Down
17 changes: 10 additions & 7 deletions tss/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#![allow(clippy::large_enum_variant)]
//!
//! # Threshold Signature Scheme (TSS)
//! The TSS (Threshold Signature Scheme) module handles cryptographic operations related to distributed key generation (DKG) and signature generation using the Roast protocol. This flowchart illustrates the key states and actions within the TSS module.
//! The TSS (Threshold Signature Scheme) module handles cryptographic operations
//! related to distributed key generation (DKG) and signature generation using
//! the Roast protocol. This flowchart illustrates the key states and actions
//! within the TSS module.
//!
#![doc = simple_mermaid::mermaid!("../docs/tss.mmd")]

Expand Down Expand Up @@ -44,25 +47,25 @@ enum TssState<I> {

/// Represents possible actions in the TSS process.
///
/// - 'Send': Action to send messages.
/// - 'Commit': Action to commit a secret.
/// - 'Ready': Action indicating readiness.
/// - 'Signature': Action to provide a signature.
#[derive(Clone)]
pub enum TssAction<I, P> {
/// Action to send messages.
Send(Vec<(P, TssMessage<I>)>),
/// Action to commit a secret.
Commit(VerifiableSecretSharingCommitment, ProofOfKnowledge),
/// Action indicating readiness.
Ready(SigningShare, VerifiableSecretSharingCommitment, VerifyingKey),
/// Action to provide a signature.
Signature(I, [u8; 32], Signature),
}

/// Represents messages in the TSS process.
///
/// - Dkg : Message for DKG.
/// - Roast : Message for ROAST.
#[derive(Clone, Deserialize, Serialize)]
pub enum TssMessage<I> {
/// Message for DKG.
Dkg { msg: DkgMessage },
/// Message for ROAST.
Roast { id: I, msg: RoastMessage },
}

Expand Down
7 changes: 6 additions & 1 deletion tss/src/roast.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
//! # Roast Module Documentation
//! The Roast module implements a state machine for managing the Robust Online Asynchronous Schnorr Threshold (ROAST) protocol. This protocol allows a distributed set of signers to collaboratively generate Schnorr signatures in a secure and robust manner, ensuring that the signature process can continue even if some participants fail to respond or act maliciously.
//!
//! The Roast module implements a state machine for managing the Robust Online
//! Asynchronous Schnorr Threshold (ROAST) protocol. This protocol allows a
//! distributed set of signers to collaboratively generate Schnorr signatures
//! in a secure and robust manner, ensuring that the signature process can
//! continue even if some participants fail to respond or act maliciously.
//!
//! ## Overview
//! The main components of the Roast module include:
Expand Down

0 comments on commit 245e18d

Please sign in to comment.