Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <protogalaxy_prover.hpp>
Public Types | |
using | DeciderProvingKeys = DeciderProvingKeys_< Flavor, NUM_KEYS > |
using | DeciderVerificationKeys = DeciderVerificationKeys_< Flavor, NUM_KEYS > |
using | FF = typename Flavor::FF |
using | CombinerQuotient = Univariate< FF, DeciderProvingKeys::BATCHED_EXTENDED_LENGTH, NUM_KEYS > |
using | TupleOfTuplesOfUnivariates = typename Flavor::template ProtogalaxyTupleOfTuplesOfUnivariates< NUM_KEYS > |
using | UnivariateRelationParameters = bb::RelationParameters< Univariate< FF, DeciderProvingKeys::EXTENDED_LENGTH, 0, NUM_KEYS - 1 > > |
using | UnivariateSubrelationSeparators = std::array< Univariate< FF, DeciderProvingKeys::BATCHED_EXTENDED_LENGTH >, Flavor::NUM_SUBRELATIONS - 1 > |
using | Transcript = typename Flavor::Transcript |
using | DeciderPK = DeciderProvingKeys::DeciderPK |
using | DeciderVK = DeciderVerificationKeys::DeciderVK |
using | CommitmentKey = typename Flavor::CommitmentKey |
using | PGInternal = ProtogalaxyProverInternal< DeciderProvingKeys > |
Public Member Functions | |
ProtogalaxyProver_ ()=default | |
ProtogalaxyProver_ (const std::vector< std::shared_ptr< DeciderPK > > &keys, const std::vector< std::shared_ptr< DeciderVK > > &vks, const std::shared_ptr< Transcript > &transcript, ExecutionTraceUsageTracker trace_usage_tracker=ExecutionTraceUsageTracker{}) | |
void | run_oink_prover_on_one_incomplete_key (std::shared_ptr< DeciderPK >, std::shared_ptr< DeciderVK >, const std::string &domain_separator) |
For each key produced by a circuit, prior to folding, we need to complete the computation of its prover polynomials; commit to witnesses and generate the relation parameters; and send the public data ϕ of the key to the verifier. | |
void | run_oink_prover_on_each_incomplete_key () |
Create inputs to folding protocol (an Oink interaction). | |
std::tuple< std::vector< FF >, Polynomial< FF > > | perturbator_round (const std::shared_ptr< const DeciderPK > &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 DeciderProvingKeys &keys) |
Steps 6 - 11 of the paper. | |
void | update_target_sum_and_fold (const DeciderProvingKeys &keys, 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 | |
DeciderProvingKeys | keys_to_fold |
DeciderVerificationKeys | vks_to_fold |
CommitmentKey | commitment_key |
std::shared_ptr< Transcript > | transcript = std::make_shared<Transcript>() |
std::shared_ptr< DeciderPK > | 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 = DeciderProvingKeys::NUM_SUBRELATIONS |
Definition at line 17 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::CombinerQuotient = Univariate<FF, DeciderProvingKeys::BATCHED_EXTENDED_LENGTH, NUM_KEYS> |
Definition at line 22 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::CommitmentKey = typename Flavor::CommitmentKey |
Definition at line 32 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::DeciderPK = DeciderProvingKeys::DeciderPK |
Definition at line 30 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::DeciderProvingKeys = DeciderProvingKeys_<Flavor, NUM_KEYS> |
Definition at line 19 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::DeciderVerificationKeys = DeciderVerificationKeys_<Flavor, NUM_KEYS> |
Definition at line 20 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::DeciderVK = DeciderVerificationKeys::DeciderVK |
Definition at line 31 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::FF = typename Flavor::FF |
Definition at line 21 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::PGInternal = ProtogalaxyProverInternal<DeciderProvingKeys> |
Definition at line 33 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::Transcript = typename Flavor::Transcript |
Definition at line 29 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::TupleOfTuplesOfUnivariates = typename Flavor::template ProtogalaxyTupleOfTuplesOfUnivariates<NUM_KEYS> |
Definition at line 23 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::UnivariateRelationParameters = bb::RelationParameters<Univariate<FF, DeciderProvingKeys::EXTENDED_LENGTH, 0, NUM_KEYS - 1> > |
Definition at line 24 of file protogalaxy_prover.hpp.
using bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::UnivariateSubrelationSeparators = std::array<Univariate<FF, DeciderProvingKeys::BATCHED_EXTENDED_LENGTH>, Flavor::NUM_SUBRELATIONS - 1> |
Definition at line 26 of file protogalaxy_prover.hpp.
|
default |
|
inline |
Definition at line 57 of file protogalaxy_prover.hpp.
std::tuple< std::vector< typename Flavor::FF >, typename ProtogalaxyProver_< Flavor, NUM_KEYS >::UnivariateSubrelationSeparators, typename ProtogalaxyProver_< Flavor, NUM_KEYS >::UnivariateRelationParameters, typename Flavor::FF, typename ProtogalaxyProver_< Flavor, NUM_KEYS >::CombinerQuotient > bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::combiner_quotient_round | ( | const std::vector< FF > & | gate_challenges, |
const std::vector< FF > & | deltas, | ||
const DeciderProvingKeys & | keys | ||
) |
Steps 6 - 11 of the paper.
Compute combiner (G polynomial in the paper) and then its quotient (K polynomial), whose coefficient will be sent to the verifier.
Definition at line 82 of file protogalaxy_prover_impl.hpp.
std::tuple< std::vector< typename Flavor::FF >, Polynomial< typename Flavor::FF > > bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::perturbator_round | ( | const std::shared_ptr< const DeciderPK > & | 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 55 of file protogalaxy_prover_impl.hpp.
FoldingResult< Flavor > bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::prove | ( | ) |
Execute the folding prover.
Definition at line 174 of file protogalaxy_prover_impl.hpp.
void bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::run_oink_prover_on_each_incomplete_key | ( | ) |
Create inputs to folding protocol (an Oink interaction).
Complete the decider pks 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, NUM_KEYS >::run_oink_prover_on_one_incomplete_key | ( | std::shared_ptr< DeciderPK > | key, |
std::shared_ptr< DeciderVK > | vk, | ||
const std::string & | domain_separator | ||
) |
For each key produced by a circuit, prior to folding, we need to complete the computation of its prover polynomials; commit to witnesses and generate the relation parameters; and send the public data ϕ of the key to the verifier.
domain_separator | a label used for tracking data in the transcript |
Definition at line 18 of file protogalaxy_prover_impl.hpp.
void bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::update_target_sum_and_fold | ( | const DeciderProvingKeys & | keys, |
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^* \) plus, then update the prover accumulator by taking a Lagrange-linear combination of the current accumulator and the decider keys 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 116 of file protogalaxy_prover_impl.hpp.
std::shared_ptr<DeciderPK> bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::accumulator |
Definition at line 46 of file protogalaxy_prover.hpp.
UnivariateSubrelationSeparators bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::alphas |
Definition at line 52 of file protogalaxy_prover.hpp.
CombinerQuotient bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::combiner_quotient |
Definition at line 49 of file protogalaxy_prover.hpp.
CommitmentKey bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::commitment_key |
Definition at line 42 of file protogalaxy_prover.hpp.
std::vector<FF> bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::deltas |
Definition at line 48 of file protogalaxy_prover.hpp.
DeciderProvingKeys bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::keys_to_fold |
Definition at line 40 of file protogalaxy_prover.hpp.
|
staticconstexpr |
Definition at line 38 of file protogalaxy_prover.hpp.
Polynomial<FF> bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::perturbator |
Definition at line 47 of file protogalaxy_prover.hpp.
FF bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::perturbator_evaluation |
Definition at line 50 of file protogalaxy_prover.hpp.
PGInternal bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::pg_internal |
Definition at line 54 of file protogalaxy_prover.hpp.
UnivariateRelationParameters bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::relation_parameters |
Definition at line 51 of file protogalaxy_prover.hpp.
std::shared_ptr<Transcript> bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::transcript = std::make_shared<Transcript>() |
Definition at line 45 of file protogalaxy_prover.hpp.
DeciderVerificationKeys bb::ProtogalaxyProver_< Flavor, NUM_KEYS >::vks_to_fold |
Definition at line 41 of file protogalaxy_prover.hpp.