pub struct Proof<E: PairingEngine> {
pub a: E::G1Affine,
pub b: E::G2Affine,
pub c: E::G1Affine,
/* private fields */
}
Expand description
A proof in the Groth16 SNARK.
Fields
a: E::G1Affine
b: E::G2Affine
c: E::G1Affine
Implementations
sourceimpl<E: PairingEngine> Proof<E>
impl<E: PairingEngine> Proof<E>
sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Returns true
if the proof is in compressed form.
sourcepub fn write_compressed<W: Write>(&self, writer: W) -> IoResult<()>
pub fn write_compressed<W: Write>(&self, writer: W) -> IoResult<()>
Serialize the proof into bytes in compressed form, for storage on disk or transmission over the network.
sourcepub fn write_uncompressed<W: Write>(&self, writer: W) -> IoResult<()>
pub fn write_uncompressed<W: Write>(&self, writer: W) -> IoResult<()>
Serialize the proof into bytes in uncompressed form, for storage on disk or transmission over the network.
sourcepub fn read_compressed<R: Read>(reader: R) -> IoResult<Self>
pub fn read_compressed<R: Read>(reader: R) -> IoResult<Self>
Deserialize the proof from compressed bytes.
sourcepub fn read_uncompressed<R: Read>(reader: R) -> IoResult<Self>
pub fn read_uncompressed<R: Read>(reader: R) -> IoResult<Self>
Deserialize the proof from uncompressed bytes.
sourcepub fn read<R: Read>(reader: R) -> IoResult<Self>
pub fn read<R: Read>(reader: R) -> IoResult<Self>
Deserialize a proof from compressed or uncompressed bytes.
sourcepub fn compressed_proof_size() -> IoResult<usize>
pub fn compressed_proof_size() -> IoResult<usize>
Returns the number of bytes in a compressed proof serialization.
sourcepub fn uncompressed_proof_size() -> IoResult<usize>
pub fn uncompressed_proof_size() -> IoResult<usize>
Returns the number of bytes in an uncompressed proof serialization.
Trait Implementations
sourceimpl<E: PairingEngine> CanonicalDeserialize for Proof<E>
impl<E: PairingEngine> CanonicalDeserialize for Proof<E>
sourcefn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
Reads Self
from reader
.
sourcefn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
fn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
Reads Self
from reader
without compression.
sourceimpl<E: PairingEngine> CanonicalSerialize for Proof<E>
impl<E: PairingEngine> CanonicalSerialize for Proof<E>
sourcefn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
Serializes self
into writer
.
fn serialized_size(&self) -> usize
sourcefn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
fn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
Serializes self
into writer
without compression.
fn uncompressed_size(&self) -> usize
sourceimpl<E: Clone + PairingEngine> Clone for Proof<E> where
E::G1Affine: Clone,
E::G2Affine: Clone,
E::G1Affine: Clone,
impl<E: Clone + PairingEngine> Clone for Proof<E> where
E::G1Affine: Clone,
E::G2Affine: Clone,
E::G1Affine: Clone,
sourceimpl<E: Debug + PairingEngine> Debug for Proof<E> where
E::G1Affine: Debug,
E::G2Affine: Debug,
E::G1Affine: Debug,
impl<E: Debug + PairingEngine> Debug for Proof<E> where
E::G1Affine: Debug,
E::G2Affine: Debug,
E::G1Affine: Debug,
sourceimpl<E: PairingEngine> Default for Proof<E>
impl<E: PairingEngine> Default for Proof<E>
sourceimpl<'de, E: PairingEngine> Deserialize<'de> for Proof<E>
impl<'de, E: PairingEngine> Deserialize<'de> for Proof<E>
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<E: PairingEngine> Display for Proof<E>
impl<E: PairingEngine> Display for Proof<E>
sourceimpl<E: PairingEngine> FromBytes for Proof<E>
impl<E: PairingEngine> FromBytes for Proof<E>
sourceimpl<E: PairingEngine> FromStr for Proof<E>
impl<E: PairingEngine> FromStr for Proof<E>
sourceimpl<E: PairingEngine> PartialEq<Proof<E>> for Proof<E>
impl<E: PairingEngine> PartialEq<Proof<E>> for Proof<E>
sourceimpl<E: PairingEngine> Serialize for Proof<E>
impl<E: PairingEngine> Serialize for Proof<E>
sourceimpl<E: PairingEngine> ToBytes for Proof<E>
impl<E: PairingEngine> ToBytes for Proof<E>
impl<E: Eq + PairingEngine> Eq for Proof<E> where
E::G1Affine: Eq,
E::G2Affine: Eq,
E::G1Affine: Eq,
impl<E: PairingEngine> StructuralEq for Proof<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for Proof<E> where
<E as PairingEngine>::G1Affine: RefUnwindSafe,
<E as PairingEngine>::G2Affine: RefUnwindSafe,
impl<E> Send for Proof<E>
impl<E> Sync for Proof<E>
impl<E> Unpin for Proof<E> where
<E as PairingEngine>::G1Affine: Unpin,
<E as PairingEngine>::G2Affine: Unpin,
impl<E> UnwindSafe for Proof<E> where
<E as PairingEngine>::G1Affine: UnwindSafe,
<E as PairingEngine>::G2Affine: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more