Mpc

Trait Mpc 

Source
pub trait Mpc {
    type Msg;
    type Exec: MpcExecution<Msg = Self::Msg, SendErr = Self::SendErr>;
    type SendErr;

    // Required methods
    fn add_round<R>(
        &mut self,
        round: R,
    ) -> <Self::Exec as MpcExecution>::Round<R>
       where R: RoundStore,
             Self::Msg: RoundMsg<R::Msg>;
    fn finish_setup(self) -> Self::Exec;
}
Expand description

Abstracts functionalities needed for creating an MPC protocol execution.

An object implementing this trait is accepted as a parameter of a protocol. It is used to configure the protocol with Mpc::add_round, and then finalized into a protocol executor with Mpc::finish_setup

Required Associated Types§

Source

type Msg

Protocol message

Source

type Exec: MpcExecution<Msg = Self::Msg, SendErr = Self::SendErr>

A type of a finalized instatiation of a party for this protocol

After being created with Mpc::finish_setup, you can use an object with this type to drive the protocol execution using the methods of MpcExecution.

Source

type SendErr

Error indicating that sending a message has failed

Required Methods§

Source

fn add_round<R>(&mut self, round: R) -> <Self::Exec as MpcExecution>::Round<R>
where R: RoundStore, Self::Msg: RoundMsg<R::Msg>,

Registers a round

Source

fn finish_setup(self) -> Self::Exec

Completes network setup

Once this method is called, no more rounds can be added, but the protocol can receive and send messages.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<D, M, MainMsg> Mpc for WithEchoBroadcast<D, M, MainMsg>
where D: Digest + 'static, M: Mpc<Msg = Msg<D, MainMsg>>, MainMsg: ProtocolMsg + Digestable + Clone + 'static,

Available on crate feature echo-broadcast only.
Source§

type Msg = MainMsg

Source§

type Exec = WithEchoBroadcast<D, <M as Mpc>::Exec, MainMsg>

Source§

type SendErr = Error<<M as Mpc>::SendErr>

Source§

impl<M, D, E, AsyncR> Mpc for MpcParty<M, D, AsyncR>
where M: ProtocolMsg + 'static, D: Stream<Item = Result<Incoming<M>, E>> + Unpin + Sink<Outgoing<M>, Error = E>, AsyncR: AsyncRuntime,

Source§

type Msg = M

Source§

type Exec = MpcParty<M, D, AsyncR, true>

Source§

type SendErr = E