diff --git a/schnorr_fun/src/frost/shared_key.rs b/schnorr_fun/src/frost/shared_key.rs index 3e44d158..15d4d6dc 100644 --- a/schnorr_fun/src/frost/shared_key.rs +++ b/schnorr_fun/src/frost/shared_key.rs @@ -53,8 +53,8 @@ impl SharedKey { /// To get the first coefficient of the polynomial typed correctly call [`public_key`]. /// /// [`public_key`]: Self::public_key - pub fn point_polynomial(&self) -> Vec> { - self.point_polynomial.clone() + pub fn point_polynomial(&self) -> &[Point] { + &self.point_polynomial } /// ☠ Type unsafe: you have to make sure the polynomial fits the type parameters @@ -157,8 +157,8 @@ impl SharedKey { pub fn public_key(&self) -> Point { // SAFETY: we hold the first coefficient to match the type parameters always let public_key = Z::cast_point(self.point_polynomial[0]).expect("invariant"); - let public_key = T::cast_point(public_key).expect("invariant"); - public_key + T::cast_point(public_key).expect("invariant") + } } }