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§
Fetch the next shared single bit
Fetch the next shared single value
Fetch the next pair of values that are multiplicative inverses of one another
Sourcefn next_triplet(&mut self) -> (Scalar<C>, Scalar<C>, Scalar<C>)
fn next_triplet(&mut self) -> (Scalar<C>, Scalar<C>, Scalar<C>)
Fetch the next beaver triplet
Provided Methods§
Fetch the next shared batch of bits
Fetch a batch of shared single values
Fetch the next batch of multiplicative inverse pairs