GenericKeygenBuilder

Struct GenericKeygenBuilder 

Source
pub struct GenericKeygenBuilder<'a, E, M, L, D>
where E: Curve, L: SecurityLevel, D: Digest,
{ /* private fields */ }
Expand description

Key generation entry point with choice for threshold or non-threshold variant

Implementations§

Source§

impl<'a, E, L, D> GenericKeygenBuilder<'a, E, NonThreshold, L, D>
where E: Curve, L: SecurityLevel, D: Digest + Clone + 'static,

Source

pub fn new( eid: ExecutionId<'a>, i: u16, n: u16, ) -> GenericKeygenBuilder<'a, E, NonThreshold, L, D>

Constructs KeygenBuilder

Takes local party index $i$ and number of parties $n$

Source§

impl<'a, E, L, D, M> GenericKeygenBuilder<'a, E, M, L, D>
where E: Curve, L: SecurityLevel, D: Digest + Clone + 'static,

Source

pub fn set_threshold( self, t: u16, ) -> GenericKeygenBuilder<'a, E, WithThreshold, L, D>

Specifies to generate key shares for a threshold scheme

Source

pub fn set_digest<D2>(self) -> GenericKeygenBuilder<'a, E, M, L, D2>
where D2: Digest + Clone + 'static,

Specifies another hash function to use

Source

pub fn set_security_level<L2>(self) -> GenericKeygenBuilder<'a, E, M, L2, D>
where L2: SecurityLevel,

Specifies security level

Source

pub fn set_progress_tracer( self, tracer: &'a mut dyn Tracer, ) -> GenericKeygenBuilder<'a, E, M, L, D>

Sets a tracer that tracks progress of protocol execution

Source

pub fn enforce_reliable_broadcast( self, enforce: bool, ) -> GenericKeygenBuilder<'a, E, M, L, D>

Ensures reliability of broadcast channel by adding one extra communication round

CGGMP21 protocol requires message in the first round to be sent over reliable broadcast channel. We ensure reliability of the broadcast channel by introducing extra communication round (at cost of additional latency). You may disable it, for instance, if your transport layer is reliable by construction (e.g. you use blockchain for communications).

Default: true.

Source

pub fn hd_wallet(self, v: bool) -> GenericKeygenBuilder<'a, E, M, L, D>

Available on crate feature hd-wallet only.

Specifies whether HD derivation is enabled for a key

Source§

impl<'a, E, L, D> GenericKeygenBuilder<'a, E, NonThreshold, L, D>
where E: Curve, L: SecurityLevel, D: Digest + Clone + 'static,

Source

pub async fn start<R, M>( self, rng: &mut R, party: M, ) -> Result<Valid<DirtyCoreKeyShare<E>>, KeygenError>
where R: RngCore + CryptoRng, M: Mpc<ProtocolMessage = Msg<E, L, D>>,

Starts key generation

Source

pub fn into_state_machine<R>( self, rng: &'a mut R, ) -> impl StateMachine<Output = Result<Valid<DirtyCoreKeyShare<E>>, KeygenError>, Msg = Msg<E, L, D>> + 'a
where R: RngCore + CryptoRng,

Available on crate feature state-machine only.

Returns a state machine that can be used to carry out the key generation protocol

See round_based::state_machine for details on how that can be done.

Source§

impl<'a, E, L, D> GenericKeygenBuilder<'a, E, WithThreshold, L, D>
where E: Curve, L: SecurityLevel, D: Digest + Clone + 'static,

Source

pub async fn start<R, M>( self, rng: &mut R, party: M, ) -> Result<Valid<DirtyCoreKeyShare<E>>, KeygenError>
where R: RngCore + CryptoRng, M: Mpc<ProtocolMessage = Msg<E, L, D>>,

Starts threshold key generation

Source

pub fn into_state_machine<R>( self, rng: &'a mut R, ) -> impl StateMachine<Output = Result<Valid<DirtyCoreKeyShare<E>>, KeygenError>, Msg = Msg<E, L, D>> + 'a
where R: RngCore + CryptoRng,

Available on crate feature state-machine only.

Returns a state machine that can be used to carry out the key generation protocol

See round_based::state_machine for details on how that can be done.

Auto Trait Implementations§

§

impl<'a, E, M, L, D> Freeze for GenericKeygenBuilder<'a, E, M, L, D>
where M: Freeze,

§

impl<'a, E, M, L, D> !RefUnwindSafe for GenericKeygenBuilder<'a, E, M, L, D>

§

impl<'a, E, M, L, D> Send for GenericKeygenBuilder<'a, E, M, L, D>
where M: Send, D: Send,

§

impl<'a, E, M, L, D> Sync for GenericKeygenBuilder<'a, E, M, L, D>
where M: Sync, D: Sync,

§

impl<'a, E, M, L, D> Unpin for GenericKeygenBuilder<'a, E, M, L, D>
where M: Unpin, E: Unpin, L: Unpin, D: Unpin,

§

impl<'a, E, M, L, D> !UnwindSafe for GenericKeygenBuilder<'a, E, M, L, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.