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
59
65 void reconstruct_from_public(const std::vector<FF>& public_inputs)
66 {
67 // Assumes that the hiding-kernel-io public inputs are at the end of the public_inputs vector
68 uint32_t index = static_cast<uint32_t>(public_inputs.size() - PUBLIC_INPUTS_SIZE);
69
73 index += G1::PUBLIC_INPUTS_SIZE;
74 for (auto& commitment : ecc_op_tables) {
75 commitment = PublicPoint::reconstruct(public_inputs, { index });
76 index += G1::PUBLIC_INPUTS_SIZE;
77 }
78 }
79};
80
84class RollupIO {
85 public:
88
91
92 static constexpr size_t PUBLIC_INPUTS_SIZE = ROLLUP_PUBLIC_INPUTS_SIZE;
93
96
102 void reconstruct_from_public(const std::vector<FF>& public_inputs)
103 {
104 // Assumes that the app-io public inputs are at the end of the public_inputs vector
105 uint32_t index = static_cast<uint32_t>(public_inputs.size() - PUBLIC_INPUTS_SIZE);
106
110 }
111};
112
113} // 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
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
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.
TableCommitments ecc_op_tables
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.
PairingPoints< curve::BN254 > pairing_inputs
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.
Definition api.hpp:5