[][src]Trait storage_proofs::compound_proof::CompoundProof

pub trait CompoundProof<'a, E: JubjubEngine, S: ProofScheme<'a>, C: Circuit<E> + CircuitComponent> where
    S::Proof: Sync + Send,
    S::PublicParams: ParameterSetMetadata + Sync + Send,
    S::PublicInputs: Clone + Sync,
    Self: CacheableParameters<E, C, S::PublicParams>, 
{ fn generate_public_inputs(
        pub_in: &S::PublicInputs,
        pub_params: &S::PublicParams,
        partition_k: Option<usize>
    ) -> Vec<E::Fr>;
fn circuit(
        public_inputs: &S::PublicInputs,
        component_private_inputs: C::ComponentPrivateInputs,
        vanilla_proof: &S::Proof,
        public_param: &S::PublicParams,
        engine_params: &'a E::Params
    ) -> C;
fn blank_circuit(
        public_params: &S::PublicParams,
        engine_params: &'a E::Params
    ) -> C; fn setup<'b>(
        sp: &SetupParams<'a, 'b, E, S>
    ) -> Result<PublicParams<'a, E, S>>
    where
        E::Params: Sync
, { ... }
fn partition_count(public_params: &PublicParams<'a, E, S>) -> usize { ... }
fn prove<'b>(
        pub_params: &'b PublicParams<'a, E, S>,
        pub_in: &'b S::PublicInputs,
        priv_in: &'b S::PrivateInputs,
        groth_params: &'b Parameters<E>
    ) -> Result<MultiProof<'b, E>>
    where
        E::Params: Sync
, { ... }
fn verify(
        public_params: &PublicParams<'a, E, S>,
        public_inputs: &S::PublicInputs,
        multi_proof: &MultiProof<E>,
        requirements: &S::Requirements
    ) -> Result<bool> { ... }
fn circuit_proof<'b>(
        pub_in: &S::PublicInputs,
        vanilla_proof: &S::Proof,
        pub_params: &'b S::PublicParams,
        params: &'a E::Params,
        groth_params: &Parameters<E>
    ) -> Result<Proof<E>> { ... }
fn groth_params(
        public_params: &S::PublicParams,
        engine_params: &'a E::Params
    ) -> Result<Parameters<E>> { ... }
fn verifying_key(
        public_params: &S::PublicParams,
        engine_params: &'a E::Params
    ) -> Result<VerifyingKey<E>> { ... }
fn circuit_for_test(
        public_parameters: &PublicParams<'a, E, S>,
        public_inputs: &S::PublicInputs,
        private_inputs: &S::PrivateInputs
    ) -> (C, Vec<E::Fr>) { ... } }

The CompoundProof trait bundles a proof::ProofScheme and a bellperson::Circuit together. It provides methods equivalent to those provided by proof::ProofScheme (setup, prove, verify). See documentation at proof::ProofScheme for details. Implementations should generally only need to supply circuit and generate_public_inputs. The remaining trait methods are used internally and implement the necessary plumbing.

Required methods

fn generate_public_inputs(
    pub_in: &S::PublicInputs,
    pub_params: &S::PublicParams,
    partition_k: Option<usize>
) -> Vec<E::Fr>

generate_public_inputs generates public inputs suitable for use as input during verification of a proof generated from this CompoundProof's bellperson::Circuit (C). These inputs correspond to those allocated when C is synthesized.

fn circuit(
    public_inputs: &S::PublicInputs,
    component_private_inputs: C::ComponentPrivateInputs,
    vanilla_proof: &S::Proof,
    public_param: &S::PublicParams,
    engine_params: &'a E::Params
) -> C

circuit constructs an instance of this CompoundProof's bellperson::Circuit. circuit takes PublicInputs, PublicParams, and Proof from this CompoundProof's proof::ProofScheme (S) and uses them to initialize Circuit fields which will be used to construct public and private inputs during circuit synthesis.

fn blank_circuit(
    public_params: &S::PublicParams,
    engine_params: &'a E::Params
) -> C

Loading content...

Provided methods

fn setup<'b>(sp: &SetupParams<'a, 'b, E, S>) -> Result<PublicParams<'a, E, S>> where
    E::Params: Sync

fn partition_count(public_params: &PublicParams<'a, E, S>) -> usize

fn prove<'b>(
    pub_params: &'b PublicParams<'a, E, S>,
    pub_in: &'b S::PublicInputs,
    priv_in: &'b S::PrivateInputs,
    groth_params: &'b Parameters<E>
) -> Result<MultiProof<'b, E>> where
    E::Params: Sync

prove is equivalent to ProofScheme::prove.

fn verify(
    public_params: &PublicParams<'a, E, S>,
    public_inputs: &S::PublicInputs,
    multi_proof: &MultiProof<E>,
    requirements: &S::Requirements
) -> Result<bool>

fn circuit_proof<'b>(
    pub_in: &S::PublicInputs,
    vanilla_proof: &S::Proof,
    pub_params: &'b S::PublicParams,
    params: &'a E::Params,
    groth_params: &Parameters<E>
) -> Result<Proof<E>>

circuit_proof creates and synthesizes a circuit from concrete params/inputs, then generates a groth proof from it. It returns a groth proof. circuit_proof is used internally and should neither be called nor implemented outside of default trait methods.

fn groth_params(
    public_params: &S::PublicParams,
    engine_params: &'a E::Params
) -> Result<Parameters<E>>

fn verifying_key(
    public_params: &S::PublicParams,
    engine_params: &'a E::Params
) -> Result<VerifyingKey<E>>

fn circuit_for_test(
    public_parameters: &PublicParams<'a, E, S>,
    public_inputs: &S::PublicInputs,
    private_inputs: &S::PrivateInputs
) -> (C, Vec<E::Fr>)

Loading content...

Implementors

impl<'a, H> CompoundProof<'a, Bls12, MerklePoR<H>, PoRCircuit<'a, Bls12, H>> for PoRCompound<H> where
    H: 'a + Hasher
[src]

impl<'a, H> CompoundProof<'a, Bls12, PoRC<'a, H>, PoRCCircuit<'a, Bls12>> for PoRCCompound<H> where
    H: 'a + Hasher
[src]

impl<'a, H, G> CompoundProof<'a, Bls12, DrgPoRep<'a, H, G>, DrgPoRepCircuit<'a, Bls12, H>> for DrgPoRepCompound<H, G> where
    H: 'a + Hasher,
    G: 'a + Graph<H> + ParameterSetMetadata + Sync + Send
[src]

impl<'a, H, V> CompoundProof<'a, Bls12, VDFPoSt<H, V>, VDFPoStCircuit<'a, Bls12>> for VDFPostCompound where
    H: 'static + Hasher,
    V: Vdf<H::Domain>,
    <V as Vdf<H::Domain>>::PublicParams: Send + Sync,
    <V as Vdf<H::Domain>>::Proof: Send + Sync,
    V: Sync + Send
[src]

impl<'a, H: 'static + Hasher> CompoundProof<'a, Bls12, ZigZagDrgPoRep<'a, H>, ZigZagCircuit<'a, Bls12, H>> for ZigZagCompound[src]

impl<'a, H: Hasher, V: Vdf<H::Domain>> CompoundProof<'a, Bls12, BeaconPoSt<H, V>, BeaconPoStCircuit<'a, Bls12, H, V>> for BeaconPoStCompound where
    <V as Vdf<H::Domain>>::PublicParams: Send + Sync,
    <V as Vdf<H::Domain>>::Proof: Send + Sync,
    V: Sync + Send,
    H: 'a, 
[src]

Loading content...