diff --git a/Cargo.toml b/Cargo.toml index 9877385..5c275dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,18 +16,11 @@ failure = "0.1" init_with = "1.1.0" log = "0.4.1" pairing = { version = "0.14.2", features = ["u128-support"] } -protobuf = { version = "2.0.0", optional = true } rand = "0.4.2" rand_derive = "0.3.1" ring = "^0.12" serde = "1.0.55" serde_derive = "1.0.55" -[features] -serialization-protobuf = [ "protobuf", "protobuf-codegen-pure" ] - -[build-dependencies] -protobuf-codegen-pure = { version = "2.0.0", optional = true } - [dev-dependencies] bincode = "1.0.0" diff --git a/src/lib.rs b/src/lib.rs index 90849f7..24b47d6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,8 +11,6 @@ extern crate init_with; #[macro_use] extern crate log; extern crate pairing; -#[cfg(feature = "serialization-protobuf")] -extern crate protobuf; extern crate rand; #[macro_use] extern crate rand_derive; @@ -24,8 +22,6 @@ extern crate serde_derive; pub mod error; mod into_fr; pub mod poly; -#[cfg(feature = "serialization-protobuf")] -pub mod protobuf_impl; pub mod serde_impl; use std::fmt; diff --git a/src/protobuf_impl.rs b/src/protobuf_impl.rs deleted file mode 100644 index 2067933..0000000 --- a/src/protobuf_impl.rs +++ /dev/null @@ -1,20 +0,0 @@ -use super::Signature; -use pairing::bls12_381::G2Compressed; -use pairing::{CurveAffine, CurveProjective, EncodedPoint}; - -impl Signature { - pub fn to_vec(&self) -> Vec { - let comp = self.0.into_affine().into_compressed(); - comp.as_ref().to_vec() - } - - pub fn from_bytes(bytes: &[u8]) -> Option { - let mut comp = G2Compressed::empty(); - comp.as_mut().copy_from_slice(bytes); - if let Ok(affine) = comp.into_affine() { - Some(Signature(affine.into_projective())) - } else { - None - } - } -}