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