Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
goblin_avm.cpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Planned, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#include "goblin_avm.hpp"
8
20#include <utility>
21
22namespace bb {
23
25 CommitmentKey<curve::BN254> bn254_commitment_key,
26 const std::shared_ptr<Transcript>& avm_transcript)
27{
28 // Set members of base Goblin class
29 avm_mode = true;
30 op_queue = builder.op_queue;
31 transcript = avm_transcript;
32 commitment_key = std::move(bn254_commitment_key);
33
42 builder.queue_ecc_no_op();
43 builder.queue_ecc_random_op();
44 builder.queue_ecc_random_op();
45 builder.queue_ecc_random_op();
46 // In the AVM Recursive Verifier case, we don't need ZK; so we place a deterministic non-op as a "hiding_op", it
47 // does not contribute to the actual MSM circuit.
49 builder.queue_ecc_hiding_op(Fq(0), Fq(0));
50}
51
53{
54 BB_BENCH_NAME("GoblinAvm::prove");
55
56 op_queue->merge();
57 info("GoblinAvm: num ultra ops = ", op_queue->get_ultra_ops_count());
58
59 vinfo("prove eccvm...");
61 vinfo("finished eccvm proving.");
62 vinfo("prove translator...");
64 vinfo("finished translator proving.");
65
66 return GoblinAvmProof{
68 .ipa_proof = std::move(goblin_proof.ipa_proof),
69 .translator_proof = std::move(goblin_proof.translator_proof),
70 };
71}
72
73} // namespace bb
#define BB_BENCH_NAME(name)
Definition bb_bench.hpp:219
CommitmentKey object over a pairing group 𝔾₁.
GoblinAvmProof prove()
Constuct a full GoblinAvm proof (ECCVM, Translator)
GoblinAvm(MegaBuilder &builder, CommitmentKey< curve::BN254 > bn254_commitment_key=CommitmentKey< curve::BN254 >(), const std::shared_ptr< Transcript > &avm_transcript=std::make_shared< Transcript >())
GoblinProof goblin_proof
Definition goblin.hpp:57
void prove_eccvm()
Construct an ECCVM proof and IPA opening proof.
Definition goblin.cpp:36
std::shared_ptr< OpQueue > op_queue
Definition goblin.hpp:54
void prove_translator()
Construct a translator proof.
Definition goblin.cpp:53
CommitmentKey< curve::BN254 > commitment_key
Definition goblin.hpp:55
bool avm_mode
Definition goblin.hpp:30
std::shared_ptr< Transcript > transcript
Definition goblin.hpp:61
#define info(...)
Definition log.hpp:93
#define vinfo(...)
Definition log.hpp:94
AluTraceBuilder builder
Definition alu.test.cpp:124
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
HonkProof eccvm_proof
Definition types.hpp:18
HonkProof eccvm_proof
Definition types.hpp:23
HonkProof ipa_proof
Definition types.hpp:24
HonkProof translator_proof
Definition types.hpp:25
curve::BN254::BaseField Fq