removed protobuf support

master
Vladimir Komendantskiy 7 years ago
parent 150389c591
commit bf98f1271f
  1. 7
      Cargo.toml
  2. 4
      src/lib.rs
  3. 20
      src/protobuf_impl.rs

@ -16,18 +16,11 @@ failure = "0.1"
init_with = "1.1.0" init_with = "1.1.0"
log = "0.4.1" log = "0.4.1"
pairing = { version = "0.14.2", features = ["u128-support"] } pairing = { version = "0.14.2", features = ["u128-support"] }
protobuf = { version = "2.0.0", optional = true }
rand = "0.4.2" rand = "0.4.2"
rand_derive = "0.3.1" rand_derive = "0.3.1"
ring = "^0.12" ring = "^0.12"
serde = "1.0.55" serde = "1.0.55"
serde_derive = "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] [dev-dependencies]
bincode = "1.0.0" bincode = "1.0.0"

@ -11,8 +11,6 @@ extern crate init_with;
#[macro_use] #[macro_use]
extern crate log; extern crate log;
extern crate pairing; extern crate pairing;
#[cfg(feature = "serialization-protobuf")]
extern crate protobuf;
extern crate rand; extern crate rand;
#[macro_use] #[macro_use]
extern crate rand_derive; extern crate rand_derive;
@ -24,8 +22,6 @@ extern crate serde_derive;
pub mod error; pub mod error;
mod into_fr; mod into_fr;
pub mod poly; pub mod poly;
#[cfg(feature = "serialization-protobuf")]
pub mod protobuf_impl;
pub mod serde_impl; pub mod serde_impl;
use std::fmt; use std::fmt;

@ -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<u8> {
let comp = self.0.into_affine().into_compressed();
comp.as_ref().to_vec()
}
pub fn from_bytes(bytes: &[u8]) -> Option<Self> {
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
}
}
}
Loading…
Cancel
Save