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// === 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#pragma once
8
9#include <cstdint>
10
11namespace bb {
12
20// Number of bb::fr elements used to represent an element of bb::fr in the public inputs
21static constexpr std::size_t FR_PUBLIC_INPUTS_SIZE = 1;
22
23// Number of bb::fr elements used to represent a bigfield element in the public inputs
24static constexpr std::size_t BIGFIELD_PUBLIC_INPUTS_SIZE = 4;
25
26// Number of bb::fr elements used to represent a goblin bigfield element in the public inputs
27static constexpr std::size_t GOBLIN_FIELD_PUBLIC_INPUTS_SIZE = 4;
28
29// Number of bb::fr elements used to represent a biggroup element in the public inputs
30static constexpr std::size_t BIGGROUP_PUBLIC_INPUTS_SIZE = 2 * BIGFIELD_PUBLIC_INPUTS_SIZE;
31
32// Number of bb::fr elements used to represent a goblin biggroup element in the public inputs
33static constexpr std::size_t GOBLIN_GROUP_PUBLIC_INPUTS_SIZE = 2 * GOBLIN_FIELD_PUBLIC_INPUTS_SIZE;
34
41static constexpr std::size_t PAIRING_POINTS_SIZE = 2 * GOBLIN_GROUP_PUBLIC_INPUTS_SIZE;
42
43// Number of bb::fr elements used to represent a opening claim (C, (r, p(r))) over Grumpkin
44// Formula is: a point on Grumpkin (2 * FR_PUBLIC_INPUTS_SIZE) and two points on bb::fq (2 *
45// BIGFIELD_PUBLIC_INPUTS_SIZE)
46static constexpr std::size_t GRUMPKIN_OPENING_CLAIM_SIZE = 2 * FR_PUBLIC_INPUTS_SIZE + 2 * BIGFIELD_PUBLIC_INPUTS_SIZE;
47
48// Invalid public input size, used in OpeningClaim<Curve> when Curve is not Grumpkin
49static constexpr std::size_t INVALID_PUBLIC_INPUTS_SIZE = 0;
50
51// Number of wires in the Mega execution trace, they must be re-defined to avoid circular dependencies
52static constexpr std::size_t MEGA_EXECUTION_TRACE_NUM_WIRES = 4;
53
54// Number of bb::fr elements used to represent the public inputs of an INIT/INNER/RESET/TAIL kernel
55static constexpr std::size_t KERNEL_PUBLIC_INPUTS_SIZE =
56 /*pairing_inputs*/ PAIRING_POINTS_SIZE +
57 /*kernel_return_data*/ GOBLIN_GROUP_PUBLIC_INPUTS_SIZE +
58 /*app_return_data*/ GOBLIN_GROUP_PUBLIC_INPUTS_SIZE +
59 /*table_commitments*/ (MEGA_EXECUTION_TRACE_NUM_WIRES * GOBLIN_GROUP_PUBLIC_INPUTS_SIZE) +
60 /*output_hn_accum_hash*/ FR_PUBLIC_INPUTS_SIZE;
61
62// Number of bb::fr elements used to represent the default public inputs, i.e., the pairing points
63static constexpr std::size_t DEFAULT_PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE;
64
65// Number of bb::fr elements used to represent the public inputs of an App circuit
66static constexpr std::size_t APP_PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE;
67
68// Number of bb::fr elements used to represent the public inputs of the HIDING kernel
69static constexpr std::size_t HIDING_KERNEL_PUBLIC_INPUTS_SIZE =
70 /*pairing_inputs*/ PAIRING_POINTS_SIZE +
71 /*kernel_return_data*/ GOBLIN_GROUP_PUBLIC_INPUTS_SIZE +
72 /*table_commitments*/ (MEGA_EXECUTION_TRACE_NUM_WIRES * GOBLIN_GROUP_PUBLIC_INPUTS_SIZE);
73
74// Number of bb::fr elements used to represent the public inputs of a ROLLUP circuit
75static constexpr std::size_t ROLLUP_PUBLIC_INPUTS_SIZE =
76 /*pairing_inputs*/ PAIRING_POINTS_SIZE + /*ipa_claim*/ GRUMPKIN_OPENING_CLAIM_SIZE;
77
78// Number of bb::fr elements used to represent the public inputs of the inner circuit in the GoblinAvmRecursiveVerifier
79static constexpr std::size_t GOBLIN_AVM_PUBLIC_INPUTS_SIZE = FR_PUBLIC_INPUTS_SIZE + PAIRING_POINTS_SIZE;
80
81} // namespace bb
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13