Avoid redundant key computations.
This commit is contained in:
parent
e3a401bcb9
commit
c0cef3b50b
2
mod.rs
2
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.
|
||||
|
|
4
poly.rs
4
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<Fr>,
|
||||
pub(super) coeff: Vec<Fr>,
|
||||
}
|
||||
|
||||
impl<B: Borrow<Poly>> ops::AddAssign<B> 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<G1>,
|
||||
pub(super) coeff: Vec<G1>,
|
||||
}
|
||||
|
||||
impl Hash for Commitment {
|
||||
|
|
Loading…
Reference in New Issue