Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
special_public_inputs.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Complete, auditors: [Sergei], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
8
13
14namespace bb {
15
20class DefaultIO {
21 public:
24
26 static constexpr bool HasIPA = false;
27
29
33 void reconstruct_from_public(const std::vector<FF>& public_inputs)
34 {
35 // Assumes that the app-io public inputs are at the end of the public_inputs vector
36 uint32_t index = static_cast<uint32_t>(public_inputs.size() - PUBLIC_INPUTS_SIZE);
38 }
39
43 template <typename Builder> static void add_default(Builder& builder)
44 {
46 }
47};
48
53 public:
56 using TableCommitments = std::array<G1, MegaCircuitBuilder::NUM_WIRES>;
57
60
61 static constexpr size_t PUBLIC_INPUTS_SIZE =
63 static constexpr bool HasIPA = false;
64
68
72 void reconstruct_from_public(const std::vector<FF>& public_inputs)
73 {
74 // Assumes that the hiding-kernel-io public inputs are at the end of the public_inputs vector
75 uint32_t index = static_cast<uint32_t>(public_inputs.size() - PUBLIC_INPUTS_SIZE);
76
80 index += G1::PUBLIC_INPUTS_SIZE;
81 for (auto& commitment : ecc_op_tables) {
82 commitment = PublicPoint::reconstruct(public_inputs, { index });
83 index += G1::PUBLIC_INPUTS_SIZE;
84 }
85 }
86
94};
95
99class RollupIO {
100 public:
103
106
107 static constexpr size_t PUBLIC_INPUTS_SIZE = ROLLUP_PUBLIC_INPUTS_SIZE;
108 static constexpr bool HasIPA = true;
109
112
116 void reconstruct_from_public(const std::vector<FF>& public_inputs)
117 {
118 // Assumes that the rollup-io public inputs are at the end of the public_inputs vector
119 uint32_t index = static_cast<uint32_t>(public_inputs.size() - PUBLIC_INPUTS_SIZE);
120
124 }
125
129 template <typename Builder> static void add_default(Builder& builder)
130 {
132 }
133};
134
135} // namespace bb
Manages the data that is propagated on the public inputs of an application/function circuit.
PairingPoints< curve::BN254 > pairing_inputs
static constexpr size_t PUBLIC_INPUTS_SIZE
static void add_default(Builder &builder)
Add default IO values to a circuit builder (for native tests)
void reconstruct_from_public(const std::vector< FF > &public_inputs)
Reconstructs the IO components from a public inputs array.
static constexpr bool HasIPA
Manages the data that is propagated on the public inputs of of a hiding kernel circuit.
static constexpr size_t PUBLIC_INPUTS_SIZE
PairingPoints< curve::BN254 > pairing_inputs
std::array< G1, MegaCircuitBuilder::NUM_WIRES > TableCommitments
void reconstruct_from_public(const std::vector< FF > &public_inputs)
Reconstructs the IO components from a public inputs array.
static constexpr bool HasIPA
TableCommitments ecc_op_tables
static void add_default(Builder &builder)
Add default IO values to a circuit builder (for native tests)
curve::BN254::AffineElement G1
An object storing two EC points that represent the inputs to a pairing check.
A wrapper class for deserializing objects from the public inputs of a circuit.
static ComponentType reconstruct(const std::vector< bb::fr > &public_inputs, const Key &key)
The data that is propagated on the public inputs of a rollup circuit.
void reconstruct_from_public(const std::vector< FF > &public_inputs)
Reconstructs the IO components from a public inputs array.
static void add_default(Builder &builder)
Add default IO values to a circuit builder (for native tests)
PairingPoints< curve::BN254 > pairing_inputs
static constexpr bool HasIPA
static constexpr size_t PUBLIC_INPUTS_SIZE
typename Group::affine_element AffineElement
Definition bn254.hpp:22
bb::fr ScalarField
Definition bn254.hpp:18
static void add_default(Builder &builder)
Add default public inputs when they are not present.
static void add_default(Builder &builder)
Add default public inputs when they are not present.
static void add_default(Builder &builder)
Add default public inputs when they are not present.
AluTraceBuilder builder
Definition alu.test.cpp:124
Entry point for Barretenberg command-line interface.
Definition api.hpp:5