-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
offline-phase: lowgear: shared-random: Generate shared random values
These shared random values are used to construct shared bits and inverse tuples
- Loading branch information
Showing
7 changed files
with
116 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//! Defines the subprotocol for generating tuples (a, a^{-1}) for a random value | ||
//! a | ||
use ark_ec::CurveGroup; | ||
use ark_mpc::network::MpcNetwork; | ||
|
||
use crate::error::LowGearError; | ||
|
||
use super::LowGear; | ||
|
||
impl<C: CurveGroup, N: MpcNetwork<C> + Unpin + Send> LowGear<C, N> { | ||
/// Generate a set of inverse tuples | ||
pub async fn generate_inverse_tuples(&mut self, n: usize) -> Result<(), LowGearError> { | ||
// We use one triplet per tuple, so we need at least n triples | ||
assert!(self.triples.len() >= n, "not enough triplets for {n} inverse tuples"); | ||
let random_values = self.get_authenticated_randomness_vec(2 * n).await?; | ||
|
||
// Split into halves that we will multiply using the Beaver trick | ||
let (random_values1, random_values2) = random_values.split_at(n); | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//! Multiplication sub-protocol using the Beaver trick |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters