Skip to main content

Operation

Trait Operation 

Source
pub trait Operation {
    // Required methods
    fn get_input_party_id(&self) -> Option<usize>;
    fn inputs<'a>(&'a self) -> Box<dyn Iterator<Item = WireId> + 'a>;
    fn outputs<'a>(&'a self) -> Box<dyn Iterator<Item = WireId> + 'a>;

    // Provided method
    fn is_input(&self) -> bool { ... }
}
Expand description

A type that represents an MPC operation.

An implementation must satisfy the following invariant:

// Any "input" operation must yield exactly one output.
assert!(op.get_input_party_id().is_none() || op.outputs().count() == 1);

Required Methods§

Source

fn get_input_party_id(&self) -> Option<usize>

If the operation is an input, return the id of the party that gives the input. Otherwise, return None.

Source

fn inputs<'a>(&'a self) -> Box<dyn Iterator<Item = WireId> + 'a>

Return the iterator of the input wires of this operation.

Source

fn outputs<'a>(&'a self) -> Box<dyn Iterator<Item = WireId> + 'a>

Return the iterator of the output wires of this operation.

Provided Methods§

Source

fn is_input(&self) -> bool

Implementors§