pub struct SetupMessage<SK = NoSigningKey, VK = NoVerifyingKey, MS = NoSignature, KS = Keyshare> { /* private fields */ }
Expand description
A message used for setting up signing operations in a multi-party computation protocol.
This struct encapsulates all necessary information for signing operations, including participant information, cryptographic keys, and protocol parameters.
§Type Parameters
SK
- The type of signing key used for message signaturesVK
- The type of verifying key used to verify message signaturesMS
- The type of message signatureKS
- The type of keyshare used in the protocol
Implementations§
Source§impl<SK, VK, MS, KS> SetupMessage<SK, VK, MS, KS>
impl<SK, VK, MS, KS> SetupMessage<SK, VK, MS, KS>
Sourcepub fn new(
instance: InstanceId,
sk: SK,
party_idx: usize,
vk: Vec<VK>,
share: Arc<KS>,
) -> Self
pub fn new( instance: InstanceId, sk: SK, party_idx: usize, vk: Vec<VK>, share: Arc<KS>, ) -> Self
Creates a new setup message for signing operations.
§Arguments
instance
- Instance identifier for the protocolsk
- Signing key for the current partyparty_idx
- Index of the current partyvk
- Vector of verifying keys for all participantsshare
- Reference to the keyshare used in signing
§Returns
A new SetupMessage
instance with default TTL, root derivation path, and zero hash
Sourcepub fn with_chain_path(self, chain_path: DerivationPath) -> Self
pub fn with_chain_path(self, chain_path: DerivationPath) -> Self
Sourcepub fn with_hash_opt(self, hash: Option<[u8; 32]>) -> Self
pub fn with_hash_opt(self, hash: Option<[u8; 32]>) -> Self
Returns a clone of the keyshare.
Sourcepub fn get_chain_path(&self) -> &DerivationPath
pub fn get_chain_path(&self) -> &DerivationPath
Returns a reference to the derivation path.
Trait Implementations§
Source§impl<SK, VK, MS> PreSignSetupMessage for SetupMessage<SK, VK, MS, Keyshare>
impl<SK, VK, MS> PreSignSetupMessage for SetupMessage<SK, VK, MS, Keyshare>
Source§fn chain_path(&self) -> &DerivationPath
fn chain_path(&self) -> &DerivationPath
Returns the derivation path for key derivation.
Returns a reference to the keyshare.
Source§fn presignature_extra(&self) -> &[u8] ⓘ
fn presignature_extra(&self) -> &[u8] ⓘ
Source§impl<SK, VK, MS, KS> ProtocolParticipant for SetupMessage<SK, VK, MS, KS>
impl<SK, VK, MS, KS> ProtocolParticipant for SetupMessage<SK, VK, MS, KS>
Source§fn signer(&self) -> &Self::MessageSigner
fn signer(&self) -> &Self::MessageSigner
Returns the signing key for the current participant.
Source§fn verifier(&self, index: usize) -> &Self::MessageVerifier
fn verifier(&self, index: usize) -> &Self::MessageVerifier
Source§fn instance_id(&self) -> &InstanceId
fn instance_id(&self) -> &InstanceId
Returns the instance identifier for the protocol.
Source§fn message_ttl(&self) -> Duration
fn message_ttl(&self) -> Duration
Returns the time-to-live duration for messages.
Source§fn participant_index(&self) -> usize
fn participant_index(&self) -> usize
Returns the index of the current participant.
Source§fn total_participants(&self) -> usize
fn total_participants(&self) -> usize
Returns the total number of participants in the protocol.
Source§type MessageSignature = MS
type MessageSignature = MS
Source§type MessageSigner = SK
type MessageSigner = SK
Source§type MessageVerifier = VK
type MessageVerifier = VK
Source§fn participant_verifier(&self) -> &Self::MessageVerifier
fn participant_verifier(&self) -> &Self::MessageVerifier
Source§fn all_other_parties(&self) -> AllOtherParties ⓘ
fn all_other_parties(&self) -> AllOtherParties ⓘ
Source§fn msg_id(&self, receiver: Option<usize>, tag: MessageTag) -> MsgId
fn msg_id(&self, receiver: Option<usize>, tag: MessageTag) -> MsgId
Source§fn msg_id_from(
&self,
sender: usize,
receiver: Option<usize>,
tag: MessageTag,
) -> MsgId
fn msg_id_from( &self, sender: usize, receiver: Option<usize>, tag: MessageTag, ) -> MsgId
Source§impl<SK, VK, MS> SignSetupMessage for SetupMessage<SK, VK, MS, Keyshare>
impl<SK, VK, MS> SignSetupMessage for SetupMessage<SK, VK, MS, Keyshare>
Source§fn message_hash(&self) -> [u8; 32]
fn message_hash(&self) -> [u8; 32]
Returns the hash of the message to be signed.