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: Completed, 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
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 = 2;
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 = 2;
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 an opening claim (C, (r, p(r))) over Grumpkin
44// Formula: challenge (fq) + evaluation (fq) + commitment (2 fr coordinates)
45static constexpr std::size_t GRUMPKIN_OPENING_CLAIM_SIZE =
46 /*challenge*/ BIGFIELD_PUBLIC_INPUTS_SIZE + /*evaluation*/ BIGFIELD_PUBLIC_INPUTS_SIZE +
47 /*commitment*/ 2 * FR_PUBLIC_INPUTS_SIZE;
48
49// Invalid public input size, used in OpeningClaim<Curve> when Curve is not Grumpkin
50static constexpr std::size_t INVALID_PUBLIC_INPUTS_SIZE = 0;
51
52// Number of wires in the Mega execution trace, they must be re-defined to avoid circular dependencies
53static constexpr std::size_t MEGA_EXECUTION_TRACE_NUM_WIRES = 4;
54
55// Number of bb::fr elements used to represent the public inputs of an INIT/INNER/RESET/TAIL kernel
56static constexpr std::size_t KERNEL_PUBLIC_INPUTS_SIZE =
57 /*pairing_inputs*/ PAIRING_POINTS_SIZE +
58 /*kernel_return_data*/ GOBLIN_GROUP_PUBLIC_INPUTS_SIZE +
59 /*app_return_data*/ GOBLIN_GROUP_PUBLIC_INPUTS_SIZE +
60 /*table_commitments*/ (MEGA_EXECUTION_TRACE_NUM_WIRES * GOBLIN_GROUP_PUBLIC_INPUTS_SIZE) +
61 /*output_hn_accum_hash*/ FR_PUBLIC_INPUTS_SIZE;
62
63// Number of bb::fr elements used to represent the default public inputs, i.e., the pairing points
64static constexpr std::size_t DEFAULT_PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE;
65
66// Number of bb::fr elements used to represent the public inputs of the HIDING kernel
67static constexpr std::size_t HIDING_KERNEL_PUBLIC_INPUTS_SIZE =
68 /*pairing_inputs*/ PAIRING_POINTS_SIZE +
69 /*kernel_return_data*/ GOBLIN_GROUP_PUBLIC_INPUTS_SIZE +
70 /*table_commitments*/ (MEGA_EXECUTION_TRACE_NUM_WIRES * GOBLIN_GROUP_PUBLIC_INPUTS_SIZE);
71
72// Number of bb::fr elements used to represent the public inputs of a ROLLUP circuit
73static constexpr std::size_t ROLLUP_PUBLIC_INPUTS_SIZE =
74 /*pairing_inputs*/ PAIRING_POINTS_SIZE + /*ipa_claim*/ GRUMPKIN_OPENING_CLAIM_SIZE;
75
76// Number of bb::fr elements used to represent the public inputs of the inner circuit in the GoblinAvmRecursiveVerifier
77static constexpr std::size_t GOBLIN_AVM_PUBLIC_INPUTS_SIZE = FR_PUBLIC_INPUTS_SIZE + PAIRING_POINTS_SIZE;
78
79} // 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