[−][src]Struct bls_dkg::key_gen::KeyGen
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]
our_id: XorName,
threshold: usize,
names: BTreeSet<XorName>
) -> Result<(KeyGen, Message), Error>
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]
&mut self,
rng: &mut R,
msg: Message
) -> Result<Vec<Message>, Error>
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]
&mut self,
rng: &mut R
) -> Result<Vec<Message>, Error>
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,