pub trait SharedValueSource: Send + Sync {
// Required methods
fn next_shared_bit(&mut self) -> Scalar;
fn next_shared_value(&mut self) -> Scalar;
fn next_shared_inverse_pair(&mut self) -> (Scalar, Scalar);
fn next_triplet(&mut self) -> (Scalar, Scalar, Scalar);
// Provided methods
fn next_shared_bit_batch(&mut self, num_values: usize) -> Vec<Scalar> { ... }
fn next_shared_value_batch(&mut self, num_values: usize) -> Vec<Scalar> { ... }
fn next_shared_inverse_pair_batch(
&mut self,
num_pairs: usize,
) -> (Vec<Scalar>, Vec<Scalar>) { ... }
fn next_triplet_batch(
&mut self,
num_triplets: usize,
) -> (Vec<Scalar>, Vec<Scalar>, Vec<Scalar>) { ... }
}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, Scalar, Scalar)
fn next_triplet(&mut self) -> (Scalar, Scalar, Scalar)
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