Support serde by default.

This removes the `serialization-serde` feature, since serde is already
used internally and therefore a dependency anyway.
master
Andreas Fackler 7 years ago committed by Vladimir Komendantskiy
parent 78b2a008c1
commit db2d84cabd
  1. 5
      mod.rs
  2. 10
      poly.rs

@ -2,7 +2,6 @@ pub mod error;
pub mod poly;
#[cfg(feature = "serialization-protobuf")]
pub mod protobuf_impl;
#[cfg(feature = "serialization-serde")]
mod serde_impl;
use self::poly::{Commitment, Poly};
@ -179,8 +178,7 @@ impl<E: Engine> PartialEq for DecryptionShare<E> {
}
/// A public key and an associated set of public key shares.
#[cfg_attr(feature = "serialization-serde", derive(Serialize, Deserialize))]
#[derive(Clone, Debug)]
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct PublicKeySet<E: Engine> {
/// The coefficients of a polynomial whose value at `0` is the "master key", and value at
/// `i + 1` is key share number `i`.
@ -526,7 +524,6 @@ mod tests {
assert_eq!(20, hash(g0, 20).len());
}
#[cfg(feature = "serialization-serde")]
#[test]
fn test_serde() {
use bincode;

@ -248,11 +248,10 @@ impl<E: Engine> Poly<E> {
}
/// A commitment to a univariate polynomial.
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serialization-serde", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Commitment<E: Engine> {
/// The coefficients of the polynomial.
#[cfg_attr(feature = "serialization-serde", serde(with = "super::serde_impl::projective_vec"))]
#[serde(with = "super::serde_impl::projective_vec")]
coeff: Vec<E::G1>,
}
@ -395,13 +394,12 @@ impl<E: Engine> BivarPoly<E> {
}
/// A commitment to a bivariate polynomial.
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serialization-serde", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BivarCommitment<E: Engine> {
/// The polynomial's degree in each of the two variables.
degree: usize,
/// The commitments to the coefficients.
#[cfg_attr(feature = "serialization-serde", serde(with = "super::serde_impl::projective_vec"))]
#[serde(with = "super::serde_impl::projective_vec")]
coeff: Vec<E::G1>,
}

Loading…
Cancel
Save