Protocol

Trait Protocol 

Source
pub trait Protocol
where 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§

Source

type Party: Party + Send

The type of the parties participating in the Protocol.

Required Methods§

Source

fn setup_parties(&self, n_parties: usize) -> Vec<Self::Party>

Sets up n_parties according to this parameterization of the Protocol.

Source

fn generate_inputs( &self, n_parties: usize, ) -> Vec<<Self::Party as Party>::Input>

Generates each party’s potentially random input for this parameterization of the Protocol.

Provided Methods§

Source

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.

Source

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.

Implementors§