diff --git a/src/algebra/poly/authenticated_poly.rs b/src/algebra/poly/authenticated_poly.rs index 6fc5d83..33e82e8 100644 --- a/src/algebra/poly/authenticated_poly.rs +++ b/src/algebra/poly/authenticated_poly.rs @@ -62,6 +62,12 @@ impl AuthenticatedDensePoly { self.coeffs.len() - 1 } + /// Sample a random polynomial of given degree + pub fn random(d: usize, fabric: &MpcFabric) -> 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 { self.coeffs[0].fabric()