From c0cef3b50b62c9aefe72950f2072cc89ba7ccb3c Mon Sep 17 00:00:00 2001 From: Andreas Fackler Date: Wed, 27 Jun 2018 14:25:32 +0200 Subject: [PATCH] Avoid redundant key computations. --- mod.rs | 2 +- poly.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mod.rs b/mod.rs index 29dbb7b..921d202 100644 --- a/mod.rs +++ b/mod.rs @@ -223,7 +223,7 @@ impl PublicKeySet { /// Returns the public key. pub fn public_key(&self) -> PublicKey { - PublicKey(self.commit.evaluate(0)) + PublicKey(self.commit.coeff[0]) } /// Returns the `i`-th public key share. diff --git a/poly.rs b/poly.rs index f03dab6..427832e 100644 --- a/poly.rs +++ b/poly.rs @@ -29,7 +29,7 @@ use rand::Rng; pub struct Poly { /// The coefficients of a polynomial. #[serde(with = "super::serde_impl::field_vec")] - coeff: Vec, + pub(super) coeff: Vec, } impl> ops::AddAssign for Poly { @@ -246,7 +246,7 @@ impl Poly { pub struct Commitment { /// The coefficients of the polynomial. #[serde(with = "super::serde_impl::projective_vec")] - coeff: Vec, + pub(super) coeff: Vec, } impl Hash for Commitment {