Skip to content

Commit

Permalink
algebra: authenticated-poly: Add random method for random shared polys
Browse files Browse the repository at this point in the history
  • Loading branch information
joeykraut committed Oct 25, 2023
1 parent 67457b2 commit 2b49548
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/algebra/poly/authenticated_poly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ impl<C: CurveGroup> AuthenticatedDensePoly<C> {
self.coeffs.len() - 1
}

/// Sample a random polynomial of given degree
pub fn random(d: usize, fabric: &MpcFabric<C>) -> Self {
let coeffs = fabric.random_shared_scalars_authenticated(d + 1);
Self::from_coeffs(coeffs)
}

/// Get the fabric underlying the polynomial
pub fn fabric(&self) -> &MpcFabric<C> {
self.coeffs[0].fabric()
Expand Down

0 comments on commit 2b49548

Please sign in to comment.