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§
Sourcetype Exec: MpcExecution<Msg = Self::Msg, SendErr = Self::SendErr>
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.
Required Methods§
Sourcefn add_round<R>(&mut self, round: R) -> <Self::Exec as MpcExecution>::Round<R>
fn add_round<R>(&mut self, round: R) -> <Self::Exec as MpcExecution>::Round<R>
Registers a round
Sourcefn finish_setup(self) -> Self::Exec
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.
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,
echo-broadcast only.