Struct libspartan::SNARK
source · [−]pub struct SNARK { /* private fields */ }Expand description
SNARK holds a proof produced by Spartan SNARK
Implementations
sourceimpl SNARK
impl SNARK
sourcepub fn encode(
inst: &Instance,
gens: &SNARKGens
) -> (ComputationCommitment, ComputationDecommitment)
pub fn encode(
inst: &Instance,
gens: &SNARKGens
) -> (ComputationCommitment, ComputationDecommitment)
A public computation to create a commitment to an R1CS instance
sourcepub fn prove(
inst: &Instance,
comm: &ComputationCommitment,
decomm: &ComputationDecommitment,
vars: VarsAssignment,
inputs: &InputsAssignment,
gens: &SNARKGens,
transcript: &mut Transcript
) -> Self
pub fn prove(
inst: &Instance,
comm: &ComputationCommitment,
decomm: &ComputationDecommitment,
vars: VarsAssignment,
inputs: &InputsAssignment,
gens: &SNARKGens,
transcript: &mut Transcript
) -> Self
A method to produce a SNARK proof of the satisfiability of an R1CS instance
sourcepub fn verify(
&self,
comm: &ComputationCommitment,
input: &InputsAssignment,
transcript: &mut Transcript,
gens: &SNARKGens
) -> Result<(), ProofVerifyError>
pub fn verify(
&self,
comm: &ComputationCommitment,
input: &InputsAssignment,
transcript: &mut Transcript,
gens: &SNARKGens
) -> Result<(), ProofVerifyError>
A method to verify the SNARK proof of the satisfiability of an R1CS instance
Trait Implementations
sourceimpl<'de> Deserialize<'de> for SNARK
impl<'de> Deserialize<'de> for SNARK
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for SNARK
impl Send for SNARK
impl Sync for SNARK
impl Unpin for SNARK
impl UnwindSafe for SNARK
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> Cast<U> for T where
U: FromCast<T>,
impl<T, U> Cast<U> for T where
U: FromCast<T>,
fn cast(self) -> U
fn cast(self) -> U
Numeric cast from self to T.
impl<T> FromBits<T> for T
impl<T> FromBits<T> for T
fn from_bits(t: T) -> T
fn from_bits(t: T) -> T
Safe lossless bitwise transmute from T to Self.
impl<T> FromCast<T> for T
impl<T> FromCast<T> for T
fn from_cast(t: T) -> T
fn from_cast(t: T) -> T
Numeric cast from T to Self.
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
fn into_bits(self) -> U
fn into_bits(self) -> U
Safe lossless bitwise transmute from self to T.