Export serde_impl::FieldWrap.

master
Andreas Fackler 6 years ago committed by Andreas Fackler
parent a14e7d1867
commit 8b6fa87cdc
  1. 2
      src/lib.rs
  2. 13
      src/serde_impl.rs

@ -15,10 +15,10 @@ pub extern crate pairing;
mod into_fr; mod into_fr;
mod secret; mod secret;
mod serde_impl;
pub mod error; pub mod error;
pub mod poly; pub mod poly;
pub mod serde_impl;
use std::fmt; use std::fmt;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};

@ -1,3 +1,7 @@
//! Serialization and deserialization implementations for group and field elements.
pub use self::field_vec::FieldWrap;
use std::borrow::Cow; use std::borrow::Cow;
use crate::G1; use crate::G1;
@ -43,7 +47,7 @@ impl<'de> Deserialize<'de> for BivarCommitment {
} }
/// Serialization and deserialization of a group element's compressed representation. /// Serialization and deserialization of a group element's compressed representation.
pub mod projective { pub(crate) mod projective {
use std::fmt; use std::fmt;
use std::marker::PhantomData; use std::marker::PhantomData;
@ -101,7 +105,7 @@ pub mod projective {
} }
/// Serialization and deserialization of vectors of projective curve elements. /// Serialization and deserialization of vectors of projective curve elements.
pub mod projective_vec { pub(crate) mod projective_vec {
use std::borrow::Borrow; use std::borrow::Borrow;
use std::iter::FromIterator; use std::iter::FromIterator;
use std::marker::PhantomData; use std::marker::PhantomData;
@ -154,7 +158,7 @@ pub mod projective_vec {
} }
/// Serialization and deserialization of vectors of field elements. /// Serialization and deserialization of vectors of field elements.
pub mod field_vec { pub(crate) mod field_vec {
use std::borrow::Borrow; use std::borrow::Borrow;
use pairing::PrimeField; use pairing::PrimeField;
@ -164,9 +168,10 @@ pub mod field_vec {
use crate::{Fr, FrRepr}; use crate::{Fr, FrRepr};
/// A wrapper type to facilitate serialization and deserialization of field elements. /// A wrapper type to facilitate serialization and deserialization of field elements.
pub struct FieldWrap<B>(B); pub struct FieldWrap<B>(pub B);
impl FieldWrap<Fr> { impl FieldWrap<Fr> {
/// Returns the wrapped field element.
pub fn into_inner(self) -> Fr { pub fn into_inner(self) -> Fr {
self.0 self.0
} }

Loading…
Cancel
Save