diff --git a/tss/src/dkg.rs b/tss/src/dkg.rs index e546c7baa..56d9b9682 100644 --- a/tss/src/dkg.rs +++ b/tss/src/dkg.rs @@ -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; @@ -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), } diff --git a/tss/src/lib.rs b/tss/src/lib.rs index 0ed3f8ee4..d19477b62 100644 --- a/tss/src/lib.rs +++ b/tss/src/lib.rs @@ -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")] @@ -44,25 +47,25 @@ enum TssState { /// 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 { + /// Action to send messages. Send(Vec<(P, TssMessage)>), + /// 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 { + /// Message for DKG. Dkg { msg: DkgMessage }, + /// Message for ROAST. Roast { id: I, msg: RoastMessage }, } diff --git a/tss/src/roast.rs b/tss/src/roast.rs index 7e0102af4..4247a152d 100644 --- a/tss/src/roast.rs +++ b/tss/src/roast.rs @@ -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: