diff --git a/src/lib.rs b/src/lib.rs index 637c2d8..6f01263 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,10 +15,10 @@ pub extern crate pairing; mod into_fr; mod secret; -mod serde_impl; pub mod error; pub mod poly; +pub mod serde_impl; use std::fmt; use std::hash::{Hash, Hasher}; diff --git a/src/serde_impl.rs b/src/serde_impl.rs index a617259..4feaeaa 100644 --- a/src/serde_impl.rs +++ b/src/serde_impl.rs @@ -1,3 +1,7 @@ +//! Serialization and deserialization implementations for group and field elements. + +pub use self::field_vec::FieldWrap; + use std::borrow::Cow; use crate::G1; @@ -43,7 +47,7 @@ impl<'de> Deserialize<'de> for BivarCommitment { } /// Serialization and deserialization of a group element's compressed representation. -pub mod projective { +pub(crate) mod projective { use std::fmt; use std::marker::PhantomData; @@ -101,7 +105,7 @@ pub mod projective { } /// Serialization and deserialization of vectors of projective curve elements. -pub mod projective_vec { +pub(crate) mod projective_vec { use std::borrow::Borrow; use std::iter::FromIterator; use std::marker::PhantomData; @@ -154,7 +158,7 @@ pub mod projective_vec { } /// Serialization and deserialization of vectors of field elements. -pub mod field_vec { +pub(crate) mod field_vec { use std::borrow::Borrow; use pairing::PrimeField; @@ -164,9 +168,10 @@ pub mod field_vec { use crate::{Fr, FrRepr}; /// A wrapper type to facilitate serialization and deserialization of field elements. - pub struct FieldWrap(B); + pub struct FieldWrap(pub B); impl FieldWrap { + /// Returns the wrapped field element. pub fn into_inner(self) -> Fr { self.0 }