[][src]Struct bls_dkg::key_gen::KeyGen

pub struct KeyGen { /* fields omitted */ }

An algorithm for dealerless distributed key generation.

This is trying to follow the protocol as suggested at https://github.com/dashpay/dips/blob/master/dip-0006/bls_m-of-n_threshold_scheme_and_dkg.md#distributed-key-generation-dkg-protocol

A normal usage flow will be: a, call initialize first to generate an instance. b, multicasting the return Message to all participants. c, call handle_message function to handle the incoming Message and multicasting the resulted Message (if has) to all participants. d, call finalize_complaining_phase to complete the complaining phase. (This separate call may need to depend on a separate timer & checker against the key generator's current status) e, repeat step c when there is incoming Message. f, call generate_keys to get the public-key set and secret-key share, if the procedure finalized.

Implementations

impl KeyGen[src]

pub fn initialize(
    our_id: XorName,
    threshold: usize,
    names: BTreeSet<XorName>
) -> Result<(KeyGen, Message), Error>
[src]

Creates a new KeyGen instance, together with the Initial message that should be multicast to all nodes.

pub fn phase(&self) -> Phase[src]

pub fn handle_message<R: RngCore>(
    &mut self,
    rng: &mut R,
    msg: Message
) -> Result<Vec<Message>, Error>
[src]

Dispatching an incoming dkg message.

pub fn all_contribution_received(&self) -> bool[src]

pub fn timed_phase_transition<R: RngCore>(
    &mut self,
    rng: &mut R
) -> Result<Vec<Message>, Error>
[src]

pub fn is_finalized(&self) -> bool[src]

Returns true if in the phase of Finalization.

pub fn generate_keys(&self) -> Option<(BTreeSet<XorName>, Outcome)>[src]

Returns the new secret key share and the public key set.

pub fn possible_blockers(&self) -> BTreeSet<XorName>[src]

This function shall be called when the DKG procedure not reach Finalization phase and before discarding the instace. It returns potential invalid peers that causing the blocking, if any and provable.

Trait Implementations

impl Debug for KeyGen[src]

Auto Trait Implementations

impl RefUnwindSafe for KeyGen

impl Send for KeyGen

impl Sync for KeyGen

impl Unpin for KeyGen

impl UnwindSafe for KeyGen

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,