Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
public_inputs_type.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
5namespace bb {
6
14// Number of bb::fr elements used to represent an element of bb::fr in the public inputs
15static constexpr std::size_t FR_PUBLIC_INPUTS_SIZE = 1;
16
17// Number of bb::fr elements used to represent a bigfield element in the public inputs
18static constexpr std::size_t BIGFIELD_PUBLIC_INPUTS_SIZE = 4;
19
20// Number of bb::fr elements used to represent a goblin bigfield element in the public inputs
21static constexpr std::size_t GOBLIN_FIELD_PUBLIC_INPUTS_SIZE = 4;
22
23// Number of bb::fr elements used to represent a biggroup element in the public inputs
24static constexpr std::size_t BIGGROUP_PUBLIC_INPUTS_SIZE = 2 * BIGFIELD_PUBLIC_INPUTS_SIZE;
25
26// Number of bb::fr elements used to represent a goblin biggroup element in the public inputs
27static constexpr std::size_t GOBLIN_GROUP_PUBLIC_INPUTS_SIZE = 2 * GOBLIN_FIELD_PUBLIC_INPUTS_SIZE;
28
35static constexpr std::size_t PAIRING_POINTS_SIZE = 2 * GOBLIN_GROUP_PUBLIC_INPUTS_SIZE;
36
37// Number of bb::fr elements used to represent a opening claim (C, (r, p(r))) over Grumpkin
38// Formula is: a point on Grumpkin (2 * FR_PUBLIC_INPUTS_SIZE) and two points on bb::fq (2 *
39// BIGFIELD_PUBLIC_INPUTS_SIZE)
40static constexpr std::size_t GRUMPKIN_OPENING_CLAIM_SIZE = 2 * FR_PUBLIC_INPUTS_SIZE + 2 * BIGFIELD_PUBLIC_INPUTS_SIZE;
41
42// Invalid public input size, used in OpeningClaim<Curve> when Curve is not Grumpkin
43static constexpr std::size_t INVALID_PUBLIC_INPUTS_SIZE = 0;
44
45// Number of wires in the Mega execution trace, they must be re-defined to avoid circular dependencies
46static constexpr std::size_t MEGA_EXECUTION_TRACE_NUM_WIRES = 4;
47
48// Number of bb::fr elements used to represent the public inputs of an INIT/INNER/RESET/TAIL kernel
49static constexpr std::size_t KERNEL_PUBLIC_INPUTS_SIZE =
50 /*pairing_inputs*/ PAIRING_POINTS_SIZE +
51 /*kernel_return_data*/ GOBLIN_GROUP_PUBLIC_INPUTS_SIZE +
52 /*app_return_data*/ GOBLIN_GROUP_PUBLIC_INPUTS_SIZE +
53 /*table_commitments*/ (MEGA_EXECUTION_TRACE_NUM_WIRES * GOBLIN_GROUP_PUBLIC_INPUTS_SIZE) +
54 /*output_pg_accum_hash*/ FR_PUBLIC_INPUTS_SIZE;
55
56// Number of bb::fr elements used to represent the default public inputs, i.e., the pairing points
57static constexpr std::size_t DEFAULT_PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE;
58
59// Number of bb::fr elements used to represent the public inputs of an App circuit
60static constexpr std::size_t APP_PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE;
61
62// Number of bb::fr elements used to represent the public inputs of the HIDING kernel
63static constexpr std::size_t HIDING_KERNEL_PUBLIC_INPUTS_SIZE =
64 /*pairing_inputs*/ PAIRING_POINTS_SIZE +
65 /*table_commitments*/ (MEGA_EXECUTION_TRACE_NUM_WIRES * GOBLIN_GROUP_PUBLIC_INPUTS_SIZE);
66
67// Number of bb::fr elements used to represent the public inputs of a ROLLUP circuit
68static constexpr std::size_t ROLLUP_PUBLIC_INPUTS_SIZE =
69 /*pairing_inputs*/ PAIRING_POINTS_SIZE + /*ipa_claim*/ GRUMPKIN_OPENING_CLAIM_SIZE;
70
71// Number of bb::fr elements used to represent the public inputs of the inner circuit in the GoblinAvmRecursiveVerifier
72static constexpr std::size_t GOBLIN_AVM_PUBLIC_INPUTS_SIZE = FR_PUBLIC_INPUTS_SIZE + PAIRING_POINTS_SIZE;
73
74} // namespace bb
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13