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: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8
12
13namespace bb {
14
19class DefaultIO {
20 public:
23
24 static constexpr size_t PUBLIC_INPUTS_SIZE = DEFAULT_PUBLIC_INPUTS_SIZE;
25
27
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);
37
39 }
40};
41
46 public:
49 using TableCommitments = std::array<G1, MegaCircuitBuilder::NUM_WIRES>;
50
53
54 static constexpr size_t PUBLIC_INPUTS_SIZE = HIDING_KERNEL_PUBLIC_INPUTS_SIZE;
55
58
64 void reconstruct_from_public(const std::vector<FF>& public_inputs)
65 {
66 // Assumes that the hiding-kernel-io public inputs are at the end of the public_inputs vector
67 uint32_t index = static_cast<uint32_t>(public_inputs.size() - PUBLIC_INPUTS_SIZE);
68
71 for (auto& commitment : ecc_op_tables) {
72 commitment = PublicPoint::reconstruct(public_inputs, { index });
73 index += G1::PUBLIC_INPUTS_SIZE;
74 }
75 }
76};
77
81class RollupIO {
82 public:
85
88
89 static constexpr size_t PUBLIC_INPUTS_SIZE = ROLLUP_PUBLIC_INPUTS_SIZE;
90
93
99 void reconstruct_from_public(const std::vector<FF>& public_inputs)
100 {
101 // Assumes that the app-io public inputs are at the end of the public_inputs vector
102 uint32_t index = static_cast<uint32_t>(public_inputs.size() - PUBLIC_INPUTS_SIZE);
103
107 }
108};
109
110} // namespace bb
Manages the data that is propagated on the public inputs of an application/function circuit.
PairingPoints pairing_inputs
static constexpr size_t PUBLIC_INPUTS_SIZE
void reconstruct_from_public(const std::vector< FF > &public_inputs)
Reconstructs the IO components from a public inputs array.
Manages the data that is propagated on the public inputs of of a hiding kernel circuit.
static constexpr size_t PUBLIC_INPUTS_SIZE
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.
TableCommitments ecc_op_tables
curve::BN254::AffineElement G1
An object storing two bn254 points that represent the inputs to a pairing check.
static constexpr size_t PUBLIC_INPUTS_SIZE
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.
PairingPoints pairing_inputs
void reconstruct_from_public(const std::vector< FF > &public_inputs)
Reconstructs the IO components from a public inputs array.
static constexpr size_t PUBLIC_INPUTS_SIZE
typename Group::affine_element AffineElement
Definition bn254.hpp:22
bb::fr ScalarField
Definition bn254.hpp:18
Entry point for Barretenberg command-line interface.