Trait SharedValueSource

Source
pub trait SharedValueSource<C: CurveGroup>: Send + Sync {
    // Required methods
    fn next_shared_bit(&mut self) -> Scalar<C>;
    fn next_shared_value(&mut self) -> Scalar<C>;
    fn next_shared_inverse_pair(&mut self) -> (Scalar<C>, Scalar<C>);
    fn next_triplet(&mut self) -> (Scalar<C>, Scalar<C>, Scalar<C>);

    // Provided methods
    fn next_shared_bit_batch(&mut self, num_values: usize) -> Vec<Scalar<C>> { ... }
    fn next_shared_value_batch(&mut self, num_values: usize) -> Vec<Scalar<C>> { ... }
    fn next_shared_inverse_pair_batch(
        &mut self,
        num_pairs: usize,
    ) -> (Vec<Scalar<C>>, Vec<Scalar<C>>) { ... }
    fn next_triplet_batch(
        &mut self,
        num_triplets: usize,
    ) -> (Vec<Scalar<C>>, Vec<Scalar<C>>, Vec<Scalar<C>>) { ... }
}
Expand description

SharedValueSource implements both the functionality for: 1. Single additively shared values [x] where party 1 holds x_1 and party 2 holds x_2 such that x_1 + x_2 = x 2. Beaver triplets; additively shared values [a], [b], [c] such that a * b = c

Required Methods§

Source

fn next_shared_bit(&mut self) -> Scalar<C>

Fetch the next shared single bit

Source

fn next_shared_value(&mut self) -> Scalar<C>

Fetch the next shared single value

Source

fn next_shared_inverse_pair(&mut self) -> (Scalar<C>, Scalar<C>)

Fetch the next pair of values that are multiplicative inverses of one another

Source

fn next_triplet(&mut self) -> (Scalar<C>, Scalar<C>, Scalar<C>)

Fetch the next beaver triplet

Provided Methods§

Source

fn next_shared_bit_batch(&mut self, num_values: usize) -> Vec<Scalar<C>>

Fetch the next shared batch of bits

Source

fn next_shared_value_batch(&mut self, num_values: usize) -> Vec<Scalar<C>>

Fetch a batch of shared single values

Source

fn next_shared_inverse_pair_batch( &mut self, num_pairs: usize, ) -> (Vec<Scalar<C>>, Vec<Scalar<C>>)

Fetch the next batch of multiplicative inverse pairs

Source

fn next_triplet_batch( &mut self, num_triplets: usize, ) -> (Vec<Scalar<C>>, Vec<Scalar<C>>, Vec<Scalar<C>>)

Fetch a batch of beaver triplets

Implementors§