pub trait Protocolwhere
Self: Debug,{
type Party: Party + Send;
// Required methods
fn setup_parties(&self, n_parties: usize) -> Vec<Self::Party>;
fn generate_inputs(
&self,
n_parties: usize,
) -> Vec<<Self::Party as Party>::Input>;
// Provided methods
fn validate_outputs(
&self,
_inputs: &[<Self::Party as Party>::Input],
_outputs: &[<Self::Party as Party>::Output],
) -> bool { ... }
fn evaluate<N: NetworkDescription>(
&self,
experiment_name: String,
n_parties: usize,
network_description: &N,
repetitions: usize,
) -> AggregatedStats { ... }
}Expand description
MPC protocols are described by the Protocol trait for a given Party type that can be sent accross threads. An implementation should hold the protocol-specific parameters.
Required Associated Types§
Required Methods§
Sourcefn setup_parties(&self, n_parties: usize) -> Vec<Self::Party>
fn setup_parties(&self, n_parties: usize) -> Vec<Self::Party>
Sets up n_parties according to this parameterization of the Protocol.
Provided Methods§
Sourcefn validate_outputs(
&self,
_inputs: &[<Self::Party as Party>::Input],
_outputs: &[<Self::Party as Party>::Output],
) -> bool
fn validate_outputs( &self, _inputs: &[<Self::Party as Party>::Input], _outputs: &[<Self::Party as Party>::Output], ) -> bool
Validates the outputs of one run of the Protocol. If false, evaluate will print a warning.
Sourcefn evaluate<N: NetworkDescription>(
&self,
experiment_name: String,
n_parties: usize,
network_description: &N,
repetitions: usize,
) -> AggregatedStats
fn evaluate<N: NetworkDescription>( &self, experiment_name: String, n_parties: usize, network_description: &N, repetitions: usize, ) -> AggregatedStats
Evaluates multiple repetitions of the protocol with this parameterization of the Protocol.
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.