pub trait CompoundProof<'a, S: ProofScheme<'a>, C: Circuit<Scalar> + CircuitComponent + Send>{
Show 18 methods // Required methods fn generate_public_inputs( pub_in: &S::PublicInputs, pub_params: &S::PublicParams, partition_k: Option<usize>, ) -> Result<Vec<Fr>>; fn circuit( public_inputs: &S::PublicInputs, component_private_inputs: C::ComponentPrivateInputs, vanilla_proof: &S::Proof, public_param: &S::PublicParams, partition_k: Option<usize>, ) -> Result<C>; fn blank_circuit(public_params: &S::PublicParams) -> C; // Provided methods fn setup(sp: &SetupParams<'a, S>) -> Result<PublicParams<'a, S>> { ... } fn partition_count(public_params: &PublicParams<'a, S>) -> usize { ... } fn prove( pub_params: &PublicParams<'a, S>, pub_in: &S::PublicInputs, priv_in: &S::PrivateInputs, groth_params: &Bls12GrothParams, ) -> Result<Vec<Proof<Bls12>>> { ... } fn prove_with_vanilla( pub_params: &PublicParams<'a, S>, pub_in: &S::PublicInputs, vanilla_proofs: Vec<S::Proof>, groth_params: &Bls12GrothParams, ) -> Result<Vec<Proof<Bls12>>> { ... } fn verify<'b>( public_params: &PublicParams<'a, S>, public_inputs: &S::PublicInputs, multi_proof: &MultiProof<'b>, requirements: &S::Requirements, ) -> Result<bool> { ... } fn batch_verify<'b>( public_params: &PublicParams<'a, S>, public_inputs: &[S::PublicInputs], multi_proofs: &[MultiProof<'b>], requirements: &S::Requirements, ) -> Result<bool> { ... } fn circuit_proofs( pub_in: &S::PublicInputs, vanilla_proofs: Vec<S::Proof>, pub_params: &S::PublicParams, groth_params: &Bls12GrothParams, priority: bool, ) -> Result<Vec<Proof<Bls12>>> { ... } fn aggregate_proofs( prover_srs: &ProverSRS<Bls12>, hashed_seeds_and_comm_rs: &[u8], proofs: &[Proof<Bls12>], version: AggregateVersion, ) -> Result<AggregateProof<Bls12>> { ... } fn verify_aggregate_proofs( ip_verifier_srs: &VerifierSRS<Bls12>, pvk: &PreparedVerifyingKey<Bls12>, hashed_seeds_and_comm_rs: &[u8], public_inputs: &[Vec<Fr>], aggregate_proof: &AggregateProof<Bls12>, version: AggregateVersion, ) -> Result<bool> { ... } fn groth_params<R: RngCore>( rng: Option<&mut R>, public_params: &S::PublicParams, ) -> Result<Bls12GrothParams> { ... } fn verifying_key<R: RngCore>( rng: Option<&mut R>, public_params: &S::PublicParams, ) -> Result<VerifyingKey<Bls12>> { ... } fn srs_key<R: RngCore>( rng: Option<&mut R>, public_params: &S::PublicParams, num_proofs_to_aggregate: usize, ) -> Result<ProverSRS<Bls12>> { ... } fn srs_verifier_key<R: RngCore>( rng: Option<&mut R>, public_params: &S::PublicParams, num_proofs_to_aggregate: usize, ) -> Result<VerifierSRS<Bls12>> { ... } fn circuit_for_test( public_parameters: &PublicParams<'a, S>, public_inputs: &S::PublicInputs, private_inputs: &S::PrivateInputs, ) -> Result<(C, Vec<Fr>)> { ... } fn circuit_for_test_all( public_parameters: &PublicParams<'a, S>, public_inputs: &S::PublicInputs, private_inputs: &S::PrivateInputs, ) -> Result<Vec<(C, Vec<Fr>)>> { ... }
}
Expand description

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§

source

fn generate_public_inputs( pub_in: &S::PublicInputs, pub_params: &S::PublicParams, partition_k: Option<usize>, ) -> Result<Vec<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.

source

fn circuit( public_inputs: &S::PublicInputs, component_private_inputs: C::ComponentPrivateInputs, vanilla_proof: &S::Proof, public_param: &S::PublicParams, partition_k: Option<usize>, ) -> Result<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.

source

fn blank_circuit(public_params: &S::PublicParams) -> C

Provided Methods§

source

fn setup(sp: &SetupParams<'a, S>) -> Result<PublicParams<'a, S>>

source

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

source

fn prove( pub_params: &PublicParams<'a, S>, pub_in: &S::PublicInputs, priv_in: &S::PrivateInputs, groth_params: &Bls12GrothParams, ) -> Result<Vec<Proof<Bls12>>>

prove is equivalent to ProofScheme::prove.

source

fn prove_with_vanilla( pub_params: &PublicParams<'a, S>, pub_in: &S::PublicInputs, vanilla_proofs: Vec<S::Proof>, groth_params: &Bls12GrothParams, ) -> Result<Vec<Proof<Bls12>>>

source

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

source

fn batch_verify<'b>( public_params: &PublicParams<'a, S>, public_inputs: &[S::PublicInputs], multi_proofs: &[MultiProof<'b>], requirements: &S::Requirements, ) -> Result<bool>

Efficiently verify multiple proofs.

source

fn circuit_proofs( pub_in: &S::PublicInputs, vanilla_proofs: Vec<S::Proof>, pub_params: &S::PublicParams, groth_params: &Bls12GrothParams, priority: bool, ) -> Result<Vec<Proof<Bls12>>>

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.

source

fn aggregate_proofs( prover_srs: &ProverSRS<Bls12>, hashed_seeds_and_comm_rs: &[u8], proofs: &[Proof<Bls12>], version: AggregateVersion, ) -> Result<AggregateProof<Bls12>>

Given a prover_srs key, a list of groth16 proofs, and an ordered list of seeds (used to derive the PoRep challenges) hashed pair-wise with the comm_rs using sha256, aggregate them all into an AggregateProof type.

source

fn verify_aggregate_proofs( ip_verifier_srs: &VerifierSRS<Bls12>, pvk: &PreparedVerifyingKey<Bls12>, hashed_seeds_and_comm_rs: &[u8], public_inputs: &[Vec<Fr>], aggregate_proof: &AggregateProof<Bls12>, version: AggregateVersion, ) -> Result<bool>

Verifies the aggregate proof, with respect to the flattened input list.

Note that this method internally instantiates an OSRng and passes it to the verify_aggregate_proofs method in bellperson. While proofs would normally parameterize the type of rng used, we don’t want it exposed past this level so as not to force the wrapper calls around this method in rust-filecoin-proofs-api to unroll this call outside of the tree parameterized with_shape macro usage.

source

fn groth_params<R: RngCore>( rng: Option<&mut R>, public_params: &S::PublicParams, ) -> Result<Bls12GrothParams>

If the rng option argument is set, parameters will be generated using it. This is used for testing only, or where parameters are otherwise unavailable (e.g. benches). If rng is not set, an error will result if parameters are not present.

source

fn verifying_key<R: RngCore>( rng: Option<&mut R>, public_params: &S::PublicParams, ) -> Result<VerifyingKey<Bls12>>

If the rng option argument is set, parameters will be generated using it. This is used for testing only, or where parameters are otherwise unavailable (e.g. benches). If rng is not set, an error will result if parameters are not present.

source

fn srs_key<R: RngCore>( rng: Option<&mut R>, public_params: &S::PublicParams, num_proofs_to_aggregate: usize, ) -> Result<ProverSRS<Bls12>>

If the rng option argument is set, parameters will be generated using it. This is used for testing only, or where parameters are otherwise unavailable (e.g. benches). If rng is not set, an error will result if parameters are not present.

source

fn srs_verifier_key<R: RngCore>( rng: Option<&mut R>, public_params: &S::PublicParams, num_proofs_to_aggregate: usize, ) -> Result<VerifierSRS<Bls12>>

If the rng option argument is set, parameters will be generated using it. This is used for testing only, or where parameters are otherwise unavailable (e.g. benches). If rng is not set, an error will result if parameters are not present.

source

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

source

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

Like circuit_for_test but returns values for all partitions.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, Tree: 'static + MerkleTreeTrait> CompoundProof<'a, PoR<Tree>, PoRCircuit<Tree>> for PoRCompound<Tree>