@@ -23,32 +23,33 @@ void AztecIVC::complete_kernel_circuit_logic(ClientCircuit& circuit)
23
23
switch (type) {
24
24
case QUEUE_TYPE::PG: {
25
25
// Construct stdlib verifier accumulator from the native counterpart computed on a previous round
26
- auto stdlib_verifier_accum = std::make_shared<RecursiveVerifierInstance>(&circuit, verifier_accumulator);
26
+ auto stdlib_verifier_accum =
27
+ std::make_shared<RecursiveDeciderVerificationKey>(&circuit, verifier_accumulator);
27
28
28
29
// Perform folding recursive verification to update the verifier accumulator
29
30
FoldingRecursiveVerifier verifier{ &circuit, stdlib_verifier_accum, { stdlib_vkey } };
30
31
auto verifier_accum = verifier.verify_folding_proof (stdlib_proof);
31
32
32
33
// Extract native verifier accumulator from the stdlib accum for use on the next round
33
- verifier_accumulator = std::make_shared<VerifierInstance >(verifier_accum->get_value ());
34
+ verifier_accumulator = std::make_shared<DeciderVerificationKey >(verifier_accum->get_value ());
34
35
35
36
// Perform databus commitment consistency checks and propagate return data commitments via public inputs
36
- bus_depot.execute (verifier.instances [1 ]->witness_commitments ,
37
- verifier.instances [1 ]->public_inputs ,
38
- verifier.instances [1 ]->verification_key ->databus_propagation_data );
37
+ bus_depot.execute (verifier.keys_to_fold [1 ]->witness_commitments ,
38
+ verifier.keys_to_fold [1 ]->public_inputs ,
39
+ verifier.keys_to_fold [1 ]->verification_key ->databus_propagation_data );
39
40
break ;
40
41
}
41
42
case QUEUE_TYPE::OINK: {
42
43
// Construct an incomplete stdlib verifier accumulator from the corresponding stdlib verification key
43
- auto verifier_accum = std::make_shared<RecursiveVerifierInstance >(&circuit, stdlib_vkey);
44
+ auto verifier_accum = std::make_shared<RecursiveDeciderVerificationKey >(&circuit, stdlib_vkey);
44
45
45
46
// Perform oink recursive verification to complete the initial verifier accumulator
46
47
OinkRecursiveVerifier oink{ &circuit, verifier_accum };
47
48
oink.verify_proof (stdlib_proof);
48
- verifier_accum->is_accumulator = true ; // indicate to PG that it should not run oink on this instance
49
+ verifier_accum->is_accumulator = true ; // indicate to PG that it should not run oink on this key
49
50
50
51
// Extract native verifier accumulator from the stdlib accum for use on the next round
51
- verifier_accumulator = std::make_shared<VerifierInstance >(verifier_accum->get_value ());
52
+ verifier_accumulator = std::make_shared<DeciderVerificationKey >(verifier_accum->get_value ());
52
53
// Initialize the gate challenges to zero for use in first round of folding
53
54
verifier_accumulator->gate_challenges =
54
55
std::vector<FF>(verifier_accum->verification_key ->log_circuit_size , 0 );
@@ -72,9 +73,9 @@ void AztecIVC::complete_kernel_circuit_logic(ClientCircuit& circuit)
72
73
}
73
74
74
75
/* *
75
- * @brief Execute prover work for instance accumulation
76
- * @details Construct an instance for the provided circuit. If this is the first instance in the IVC, simply initialize
77
- * the folding accumulator. Otherwise, execute the PG prover to fold the instance into the accumulator and produce a
76
+ * @brief Execute prover work for accumulation
77
+ * @details Construct an proving key for the provided circuit. If this is the first step in the IVC, simply initialize
78
+ * the folding accumulator. Otherwise, execute the PG prover to fold the proving key into the accumulator and produce a
78
79
* folding proof. Also execute the merge protocol to produce a merge proof.
79
80
*
80
81
* @param circuit
@@ -90,40 +91,40 @@ void AztecIVC::accumulate(ClientCircuit& circuit, const std::shared_ptr<Verifica
90
91
// verifier.
91
92
circuit.add_recursive_proof (stdlib::recursion::init_default_agg_obj_indices<ClientCircuit>(circuit));
92
93
93
- // Construct the prover instance for circuit
94
- std::shared_ptr<ProverInstance> prover_instance ;
94
+ // Construct the proving key for circuit
95
+ std::shared_ptr<DeciderProvingKey> proving_key ;
95
96
if (!initialized) {
96
- prover_instance = std::make_shared<ProverInstance >(circuit, trace_structure);
97
+ proving_key = std::make_shared<DeciderProvingKey >(circuit, trace_structure);
97
98
} else {
98
- prover_instance = std::make_shared<ProverInstance >(
99
+ proving_key = std::make_shared<DeciderProvingKey >(
99
100
circuit, trace_structure, fold_output.accumulator ->proving_key .commitment_key );
100
101
}
101
102
102
- // Set the instance verification key from precomputed if available, else compute it
103
- instance_vk = precomputed_vk ? precomputed_vk : std::make_shared<VerificationKey>(prover_instance ->proving_key );
103
+ // Set the verification key from precomputed if available, else compute it
104
+ honk_vk = precomputed_vk ? precomputed_vk : std::make_shared<VerificationKey>(proving_key ->proving_key );
104
105
105
- // If this is the first circuit in the IVC, use oink to compute the completed instance and generate an oink proof
106
+ // If this is the first circuit in the IVC, use oink to complete the decider proving key and generate an oink proof
106
107
if (!initialized) {
107
- OinkProver<Flavor> oink_prover{ prover_instance };
108
+ OinkProver<Flavor> oink_prover{ proving_key };
108
109
oink_prover.prove ();
109
- prover_instance ->is_accumulator = true ; // indicate to PG that it should not run oink on this instance
110
+ proving_key ->is_accumulator = true ; // indicate to PG that it should not run oink on this key
110
111
// Initialize the gate challenges to zero for use in first round of folding
111
- prover_instance ->gate_challenges = std::vector<FF>(prover_instance ->proving_key .log_circuit_size , 0 );
112
+ proving_key ->gate_challenges = std::vector<FF>(proving_key ->proving_key .log_circuit_size , 0 );
112
113
113
- fold_output.accumulator = prover_instance ; // initialize the prover accum with the completed instance
114
+ fold_output.accumulator = proving_key ; // initialize the prover accum with the completed key
114
115
115
116
// Add oink proof and corresponding verification key to the verification queue
116
117
verification_queue.push_back (
117
- bb::AztecIVC::RecursiveVerifierInputs{ oink_prover.transcript ->proof_data , instance_vk , QUEUE_TYPE::OINK });
118
+ bb::AztecIVC::RecursiveVerifierInputs{ oink_prover.transcript ->proof_data , honk_vk , QUEUE_TYPE::OINK });
118
119
119
120
initialized = true ;
120
- } else { // Otherwise, fold the new instance into the accumulator
121
- FoldingProver folding_prover ({ fold_output.accumulator , prover_instance });
121
+ } else { // Otherwise, fold the new key into the accumulator
122
+ FoldingProver folding_prover ({ fold_output.accumulator , proving_key });
122
123
fold_output = folding_prover.prove ();
123
124
124
125
// Add fold proof and corresponding verification key to the verification queue
125
126
verification_queue.push_back (
126
- bb::AztecIVC::RecursiveVerifierInputs{ fold_output.proof , instance_vk , QUEUE_TYPE::PG });
127
+ bb::AztecIVC::RecursiveVerifierInputs{ fold_output.proof , honk_vk , QUEUE_TYPE::PG });
127
128
}
128
129
129
130
// Track the maximum size of each block for all circuits porcessed (for debugging purposes only)
@@ -146,8 +147,8 @@ AztecIVC::Proof AztecIVC::prove()
146
147
};
147
148
148
149
bool AztecIVC::verify (const Proof& proof,
149
- const std::shared_ptr<VerifierInstance >& accumulator,
150
- const std::shared_ptr<VerifierInstance >& final_verifier_instance ,
150
+ const std::shared_ptr<DeciderVerificationKey >& accumulator,
151
+ const std::shared_ptr<DeciderVerificationKey >& final_stack_vk ,
151
152
const std::shared_ptr<AztecIVC::ECCVMVerificationKey>& eccvm_vk,
152
153
const std::shared_ptr<AztecIVC::TranslatorVerificationKey>& translator_vk)
153
154
{
@@ -156,7 +157,7 @@ bool AztecIVC::verify(const Proof& proof,
156
157
bool goblin_verified = goblin_verifier.verify (proof.goblin_proof );
157
158
158
159
// Decider verification
159
- AztecIVC::FoldingVerifier folding_verifier ({ accumulator, final_verifier_instance });
160
+ AztecIVC::FoldingVerifier folding_verifier ({ accumulator, final_stack_vk });
160
161
auto verifier_accumulator = folding_verifier.verify_folding_proof (proof.folding_proof );
161
162
162
163
AztecIVC::DeciderVerifier decider_verifier (verifier_accumulator);
@@ -170,11 +171,11 @@ bool AztecIVC::verify(const Proof& proof,
170
171
* @param proof
171
172
* @return bool
172
173
*/
173
- bool AztecIVC::verify (Proof& proof, const std::vector<std::shared_ptr<VerifierInstance >>& verifier_instances )
174
+ bool AztecIVC::verify (Proof& proof, const std::vector<std::shared_ptr<DeciderVerificationKey >>& vk_stack )
174
175
{
175
176
auto eccvm_vk = std::make_shared<ECCVMVerificationKey>(goblin.get_eccvm_proving_key ());
176
177
auto translator_vk = std::make_shared<TranslatorVerificationKey>(goblin.get_translator_proving_key ());
177
- return verify (proof, verifier_instances [0 ], verifier_instances [1 ], eccvm_vk, translator_vk);
178
+ return verify (proof, vk_stack [0 ], vk_stack [1 ], eccvm_vk, translator_vk);
178
179
}
179
180
180
181
/* *
@@ -199,7 +200,7 @@ bool AztecIVC::prove_and_verify()
199
200
auto proof = prove ();
200
201
201
202
ASSERT (verification_queue.size () == 1 ); // ensure only a single fold proof remains in the queue
202
- auto verifier_inst = std::make_shared<VerifierInstance >(this ->verification_queue [0 ].instance_vk );
203
+ auto verifier_inst = std::make_shared<DeciderVerificationKey >(this ->verification_queue [0 ].honk_verification_key );
203
204
return verify (proof, { this ->verifier_accumulator , verifier_inst });
204
205
}
205
206
0 commit comments