|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <protogalaxy_prover.hpp>
Public Types | |
| using | ProverInstance = ProverInstance_< Flavor > |
| using | VerifierInstance = VerifierInstance_< Flavor > |
| using | FF = typename Flavor::FF |
| using | CombinerQuotient = Univariate< FF, BATCHED_EXTENDED_LENGTH, NUM_INSTANCES > |
| using | TupleOfTuplesOfUnivariates = typename Flavor::template ProtogalaxyTupleOfTuplesOfUnivariates< NUM_INSTANCES > |
| using | UnivariateRelationParameters = bb::RelationParameters< Univariate< FF, EXTENDED_LENGTH, 0, SKIP_COUNT > > |
| using | UnivariateSubrelationSeparators = std::array< Univariate< FF, BATCHED_EXTENDED_LENGTH >, NUM_SUBRELATIONS - 1 > |
| using | Transcript = typename Flavor::Transcript |
| using | CommitmentKey = typename Flavor::CommitmentKey |
| using | PGInternal = ProtogalaxyProverInternal< ProverInstance > |
| using | ProverInstances = std::array< std::shared_ptr< ProverInstance >, NUM_INSTANCES > |
| using | VerifierInstances = std::array< std::shared_ptr< VerifierInstance >, NUM_INSTANCES > |
Public Member Functions | |
| ProtogalaxyProver_ ()=default | |
| ProtogalaxyProver_ (const ProverInstances &prover_insts, const VerifierInstances &verifier_insts, const std::shared_ptr< Transcript > &transcript, ExecutionTraceUsageTracker trace_usage_tracker=ExecutionTraceUsageTracker{}) | |
| void | run_oink_prover_on_one_incomplete_instance (std::shared_ptr< ProverInstance >, std::shared_ptr< VerifierInstance >, const std::string &domain_separator) |
| For each Prover instance derived from a circuit, prior to folding, we need to complete the computation of its polynomials (some of which require generating relation parameters first); commit to witnesses and generate the relation parameters; and send the public data ϕ of the instance to the verifier (which will represent the verifier instance). | |
| void | run_oink_prover_on_each_incomplete_instance () |
| Create inputs to folding protocol (an Oink interaction). | |
| std::tuple< std::vector< FF >, Polynomial< FF > > | perturbator_round (const std::shared_ptr< const ProverInstance > &accumulator) |
| Steps 2 - 5 of the paper. | |
| std::tuple< std::vector< FF >, UnivariateSubrelationSeparators, UnivariateRelationParameters, FF, CombinerQuotient > | combiner_quotient_round (const std::vector< FF > &gate_challenges, const std::vector< FF > &deltas, const ProverInstances &instances) |
| Steps 6 - 11 of the paper. | |
| void | update_target_sum_and_fold (const ProverInstances &instances, const CombinerQuotient &combiner_quotient, const UnivariateSubrelationSeparators &alphas, const UnivariateRelationParameters &univariate_relation_parameters, const FF &perturbator_evaluation) |
| Steps 12 - 13 of the paper plus the prover folding work. | |
| BB_PROFILE FoldingResult< Flavor > | prove () |
| Execute the folding prover. | |
Public Attributes | |
| ProverInstances | prover_insts_to_fold |
| VerifierInstances | verifier_insts_to_fold |
| CommitmentKey | commitment_key |
| std::shared_ptr< Transcript > | transcript = std::make_shared<Transcript>() |
| std::shared_ptr< ProverInstance > | accumulator |
| Polynomial< FF > | perturbator |
| std::vector< FF > | deltas |
| CombinerQuotient | combiner_quotient |
| FF | perturbator_evaluation |
| UnivariateRelationParameters | relation_parameters |
| UnivariateSubrelationSeparators | alphas |
| PGInternal | pg_internal |
Static Public Attributes | |
| static constexpr size_t | NUM_SUBRELATIONS = Flavor::NUM_SUBRELATIONS |
| static constexpr size_t | EXTENDED_LENGTH = computed_extended_length<Flavor>() |
| static constexpr size_t | BATCHED_EXTENDED_LENGTH = computed_batched_extended_length<Flavor>() |
Private Member Functions | |
| size_t | get_max_dyadic_size () const |
| Get the maximum dyadic circuit size among all prover instances. | |
Definition at line 19 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::CombinerQuotient = Univariate<FF, BATCHED_EXTENDED_LENGTH, NUM_INSTANCES> |
Definition at line 28 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::CommitmentKey = typename Flavor::CommitmentKey |
Definition at line 35 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::FF = typename Flavor::FF |
Definition at line 27 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::PGInternal = ProtogalaxyProverInternal<ProverInstance> |
Definition at line 36 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::ProverInstance = ProverInstance_<Flavor> |
Definition at line 25 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::ProverInstances = std::array<std::shared_ptr<ProverInstance>, NUM_INSTANCES> |
Definition at line 38 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::Transcript = typename Flavor::Transcript |
Definition at line 34 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::TupleOfTuplesOfUnivariates = typename Flavor::template ProtogalaxyTupleOfTuplesOfUnivariates<NUM_INSTANCES> |
Definition at line 29 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::UnivariateRelationParameters = bb::RelationParameters<Univariate<FF, EXTENDED_LENGTH, 0, SKIP_COUNT> > |
Definition at line 30 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::UnivariateSubrelationSeparators = std::array<Univariate<FF, BATCHED_EXTENDED_LENGTH>, NUM_SUBRELATIONS - 1> |
Definition at line 32 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::VerifierInstance = VerifierInstance_<Flavor> |
Definition at line 26 of file protogalaxy_prover.hpp.
| using bb::ProtogalaxyProver_< Flavor >::VerifierInstances = std::array<std::shared_ptr<VerifierInstance>, NUM_INSTANCES> |
Definition at line 39 of file protogalaxy_prover.hpp.
|
default |
|
inline |
Definition at line 58 of file protogalaxy_prover.hpp.
| std::tuple< std::vector< typename Flavor::FF >, typename ProtogalaxyProver_< Flavor >::UnivariateSubrelationSeparators, typename ProtogalaxyProver_< Flavor >::UnivariateRelationParameters, typename Flavor::FF, typename ProtogalaxyProver_< Flavor >::CombinerQuotient > bb::ProtogalaxyProver_< Flavor >::combiner_quotient_round | ( | const std::vector< FF > & | gate_challenges, |
| const std::vector< FF > & | deltas, | ||
| const ProverInstances & | instances | ||
| ) |
Steps 6 - 11 of the paper.
Compute combiner (G polynomial in the paper) and then its quotient (K polynomial), whose coefficients will be sent to the verifier.
Definition at line 74 of file protogalaxy_prover_impl.hpp.
|
inlineprivate |
Get the maximum dyadic circuit size among all prover instances.
Definition at line 134 of file protogalaxy_prover.hpp.
| std::tuple< std::vector< typename Flavor::FF >, Polynomial< typename Flavor::FF > > bb::ProtogalaxyProver_< Flavor >::perturbator_round | ( | const std::shared_ptr< const ProverInstance > & | accumulator | ) |
Steps 2 - 5 of the paper.
Compute perturbator (F polynomial in paper). Send all but the constant coefficient to verifier.
| accumulator |
Definition at line 50 of file protogalaxy_prover_impl.hpp.
| FoldingResult< Flavor > bb::ProtogalaxyProver_< Flavor >::prove | ( | ) |
Execute the folding prover.
Definition at line 220 of file protogalaxy_prover_impl.hpp.
| void bb::ProtogalaxyProver_< Flavor >::run_oink_prover_on_each_incomplete_instance | ( | ) |
Create inputs to folding protocol (an Oink interaction).
Complete all Prover instances that will be folded: complete computation of all the witness polynomials and compute commitments. Send commitments to the verifier and retrieve challenges.
Definition at line 29 of file protogalaxy_prover_impl.hpp.
| void bb::ProtogalaxyProver_< Flavor >::run_oink_prover_on_one_incomplete_instance | ( | std::shared_ptr< ProverInstance > | key, |
| std::shared_ptr< VerifierInstance > | vk, | ||
| const std::string & | domain_separator | ||
| ) |
For each Prover instance derived from a circuit, prior to folding, we need to complete the computation of its polynomials (some of which require generating relation parameters first); commit to witnesses and generate the relation parameters; and send the public data ϕ of the instance to the verifier (which will represent the verifier instance).
| domain_separator | a label used for tracking data in the transcript |
Definition at line 19 of file protogalaxy_prover_impl.hpp.
| void bb::ProtogalaxyProver_< Flavor >::update_target_sum_and_fold | ( | const ProverInstances & | instances, |
| const CombinerQuotient & | combiner_quotient, | ||
| const UnivariateSubrelationSeparators & | alphas, | ||
| const UnivariateRelationParameters & | univariate_relation_parameters, | ||
| const FF & | perturbator_evaluation | ||
| ) |
Steps 12 - 13 of the paper plus the prover folding work.
Given the challenge \(\gamma\), compute \(Z(\gamma)\) and \(L_0(\gamma),L_1(\gamma)\).
Compute \( e^* \) (the new target sum), then update the prover accumulator by taking a Lagrange-linear combination of the current accumulator and the prover instances to be folded. In our mental model, we are doing a scalar multiplication of matrices whose columns are polynomials, as well as taking similar linear combinations of the relation parameters.
Definition at line 115 of file protogalaxy_prover_impl.hpp.
| std::shared_ptr<ProverInstance> bb::ProtogalaxyProver_< Flavor >::accumulator |
Definition at line 47 of file protogalaxy_prover.hpp.
| UnivariateSubrelationSeparators bb::ProtogalaxyProver_< Flavor >::alphas |
Definition at line 53 of file protogalaxy_prover.hpp.
|
staticconstexpr |
Definition at line 23 of file protogalaxy_prover.hpp.
| CombinerQuotient bb::ProtogalaxyProver_< Flavor >::combiner_quotient |
Definition at line 50 of file protogalaxy_prover.hpp.
| CommitmentKey bb::ProtogalaxyProver_< Flavor >::commitment_key |
Definition at line 43 of file protogalaxy_prover.hpp.
| std::vector<FF> bb::ProtogalaxyProver_< Flavor >::deltas |
Definition at line 49 of file protogalaxy_prover.hpp.
|
staticconstexpr |
Definition at line 22 of file protogalaxy_prover.hpp.
|
staticconstexpr |
Definition at line 21 of file protogalaxy_prover.hpp.
| Polynomial<FF> bb::ProtogalaxyProver_< Flavor >::perturbator |
Definition at line 48 of file protogalaxy_prover.hpp.
| FF bb::ProtogalaxyProver_< Flavor >::perturbator_evaluation |
Definition at line 51 of file protogalaxy_prover.hpp.
| PGInternal bb::ProtogalaxyProver_< Flavor >::pg_internal |
Definition at line 55 of file protogalaxy_prover.hpp.
| ProverInstances bb::ProtogalaxyProver_< Flavor >::prover_insts_to_fold |
Definition at line 41 of file protogalaxy_prover.hpp.
| UnivariateRelationParameters bb::ProtogalaxyProver_< Flavor >::relation_parameters |
Definition at line 52 of file protogalaxy_prover.hpp.
| std::shared_ptr<Transcript> bb::ProtogalaxyProver_< Flavor >::transcript = std::make_shared<Transcript>() |
Definition at line 46 of file protogalaxy_prover.hpp.
| VerifierInstances bb::ProtogalaxyProver_< Flavor >::verifier_insts_to_fold |
Definition at line 42 of file protogalaxy_prover.hpp.