pub struct ParticipantCollectingCommitments<G: Group> { /* private fields */ }
Expand description
Participant state during the first stage of the committed Pedersen’s distributed key generation.
During this stage, participants exchange commitments to their public keys via a public bulletin board (e.g., a blockchain).
Implementations§
Source§impl<G: Group> ParticipantCollectingCommitments<G>
impl<G: Group> ParticipantCollectingCommitments<G>
Sourcepub fn new<R: CryptoRng + RngCore>(
params: Params,
index: usize,
rng: &mut R,
) -> Self
pub fn new<R: CryptoRng + RngCore>( params: Params, index: usize, rng: &mut R, ) -> Self
Instantiates a distributed key generation participant.
§Panics
Panics if index
is greater or equal to the number of shares.
Sourcepub fn commitment(&self) -> [u8; 32]
pub fn commitment(&self) -> [u8; 32]
Returns the commitment of participant’s share of the joint public key.
§Panics
Panics if the commitment is missing which can only happen if this struct got corrupted (e.g., after deserialization).
Sourcepub fn insert_commitment(
&mut self,
participant_index: usize,
commitment: [u8; 32],
)
pub fn insert_commitment( &mut self, participant_index: usize, commitment: [u8; 32], )
Inserts a commitment from the participant with index participant_index
.
§Panics
Panics if commitment for given participant was already provided or
participant_index
is out of bounds.
Sourcepub fn missing_commitments(&self) -> impl Iterator<Item = usize> + '_
pub fn missing_commitments(&self) -> impl Iterator<Item = usize> + '_
Returns indices of parties whose commitments were not provided.
Sourcepub fn finish_commitment_phase(self) -> ParticipantCollectingPolynomials<G>
pub fn finish_commitment_phase(self) -> ParticipantCollectingPolynomials<G>
Proceeds to the next step of the DKG protocol, in which participants exchange public polynomials.
§Panics
Panics if any commitments are missing. If this is not known statically, check
with Self::missing_commitments()
before calling this method.
Trait Implementations§
Source§impl<G: Clone + Group> Clone for ParticipantCollectingCommitments<G>
impl<G: Clone + Group> Clone for ParticipantCollectingCommitments<G>
Source§fn clone(&self) -> ParticipantCollectingCommitments<G>
fn clone(&self) -> ParticipantCollectingCommitments<G>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de, G: Group> Deserialize<'de> for ParticipantCollectingCommitments<G>
impl<'de, G: Group> Deserialize<'de> for ParticipantCollectingCommitments<G>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl<G> Freeze for ParticipantCollectingCommitments<G>
impl<G> RefUnwindSafe for ParticipantCollectingCommitments<G>
impl<G> Send for ParticipantCollectingCommitments<G>
impl<G> Sync for ParticipantCollectingCommitments<G>
impl<G> Unpin for ParticipantCollectingCommitments<G>
impl<G> UnwindSafe for ParticipantCollectingCommitments<G>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)