-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
33: feat: eddsa signing protocol r=jfdreis a=jfdreis Implementation of the State Machines for the EdDSA signature ## Motivation <!-- Explain the context and why you're making that change. What is the problem you're trying to solve? In some cases there is not a problem and this can be thought of as being the motivation for your change. --> ## Solution <!-- Summarize the solution and provide any necessary context needed to understand the code change. --> Fixes # Design discussion issue (if applicable) # ## Merge requirement checklist * [ ] [CONTRIBUTING](https://github.com/NillionNetwork/nillion/blob/main/CONTRIBUTING.md) guidelines followed * [x] Unit tests added/updated (if applicable) * [ ] Breaking change analysis completed (if applicable). "Will this change require all network cluster operators to update? Does it break public APIs?" * [ ] For new features or breaking changes, created a documentation issue in [nillion-docs](https://github.com/NillionNetwork/nillion-docs/issues/new/choose) Co-authored-by: jfdreis <[email protected]>
- Loading branch information
Showing
14 changed files
with
411 additions
and
78 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Signing protocol | ||
|
||
- This protocol is the main singing protocol of the FROST EdDSA Signing protocol from the [givre](https://docs.rs/givre/latest/givre/index.html) library. | ||
- It generates a signature that is sent to the client. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//! Threshold EdDSA protocol | ||
pub mod output; | ||
pub mod state; | ||
|
||
pub use state::*; | ||
#[cfg(test)] | ||
pub mod test; | ||
|
||
use state_machine::StateMachine; | ||
|
||
/// The Eddsa Signing state machine. | ||
pub type EddsaSignStateMachine = StateMachine<EddsaSignState>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! Outputs for the EdDSA signing protocol. | ||
use givre::signing::round2::SigningError; | ||
use std::fmt::Display; | ||
use threshold_keypair::signature::EddsaSignature; | ||
|
||
/// The EdDSA signing output. | ||
pub enum EddsaSignatureOutput { | ||
/// The protocol was successful. | ||
Success { | ||
/// The output elements. | ||
element: EddsaSignature, | ||
}, | ||
|
||
/// This or a subprotocol aborted by chance. | ||
Abort { | ||
/// The reason why it aborted | ||
reason: SigningError, | ||
}, | ||
} | ||
|
||
impl Display for EddsaSignatureOutput { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
match self { | ||
Self::Success { .. } => write!(f, "Success"), | ||
Self::Abort { .. } => write!(f, "Abort"), | ||
} | ||
} | ||
} |
Oops, something went wrong.