Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement interactive signing #475

Merged
merged 5 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/auxinfo/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ mod storage {
pub struct AuxInfoParticipant {
/// The current session identifier
sid: Identifier,
/// The current protocol input
input: (),
/// A unique identifier for this participant
id: ParticipantIdentifier,
/// A list of all other participant identifiers participating in the
Expand Down Expand Up @@ -142,7 +140,6 @@ impl ProtocolParticipant for AuxInfoParticipant {
) -> Result<Self> {
Ok(Self {
sid,
input,
id,
other_participant_ids: other_participant_ids.clone(),
local_storage: Default::default(),
Expand Down Expand Up @@ -176,10 +173,6 @@ impl ProtocolParticipant for AuxInfoParticipant {
self.sid
}

fn input(&self) -> &Self::Input {
&self.input
}

#[cfg_attr(feature = "flame_it", flame("auxinfo"))]
#[instrument(skip_all, err(Debug))]
fn process_message<R: RngCore + CryptoRng>(
Expand Down
3 changes: 0 additions & 3 deletions src/broadcast/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ impl ProtocolParticipant for BroadcastParticipant {
self.sid
}

fn input(&self) -> &Self::Input {
&()
}
fn ready_type() -> MessageType {
// I'm not totally confident since broadcast takes a different shape than the
// other protocols, but this is definitely the first message in the
Expand Down
4 changes: 0 additions & 4 deletions src/keygen/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ impl ProtocolParticipant for KeygenParticipant {
self.sid
}

fn input(&self) -> &Self::Input {
&()
}

#[cfg_attr(feature = "flame_it", flame("keygen"))]
#[instrument(skip_all)]
fn process_message<R: RngCore + CryptoRng>(
Expand Down
2 changes: 1 addition & 1 deletion src/message_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{
use std::collections::HashMap;

/// A type for storing a queue of [`Message`]s by [`MessageType`].
#[derive(Clone, Default)]
#[derive(Debug, Clone, Default)]
pub(crate) struct MessageQueue(HashMap<MessageType, Vec<Message>>);

impl MessageQueue {
Expand Down
3 changes: 0 additions & 3 deletions src/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@ pub trait ProtocolParticipant {

/// The session identifier for the current session
fn sid(&self) -> Identifier;

/// The input of the current session
fn input(&self) -> &Self::Input;
}

pub(crate) trait InnerProtocolParticipant: ProtocolParticipant {
Expand Down
4 changes: 4 additions & 0 deletions src/presign/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ impl Input {
})
}

pub(crate) fn public_key_shares(&self) -> &[KeySharePublic] {
self.keygen_output.public_key_shares()
}

/// Get the set of participants that contributed to the input.
///
/// By construction, this must be the same for the auxinfo and key share
Expand Down
8 changes: 4 additions & 4 deletions src/presign/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,6 @@ impl ProtocolParticipant for PresignParticipant {
self.sid
}

fn input(&self) -> &Self::Input {
&self.input
}

/// Process the incoming message.
///
/// This method produces a [`PresignRecord`] once presigning is complete.
Expand Down Expand Up @@ -364,6 +360,10 @@ impl Broadcast for PresignParticipant {
}

impl PresignParticipant {
fn input(&self) -> &Input {
&self.input
}

/// Handle "Ready" messages from the protocol participants.
///
/// Once "Ready" messages have been received from all participants, this
Expand Down
Loading