Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
flavor_concepts.hpp
Go to the documentation of this file.
1#pragma once
2
3// Establish concepts for testing flavor attributes
6#include <string>
7namespace bb {
14// clang-format off
15
16#ifdef STARKNET_GARAGA_FLAVORS
17template <typename T>
18concept IsUltraHonk = IsAnyOf<T, UltraFlavor, UltraKeccakFlavor, UltraStarknetFlavor, UltraKeccakZKFlavor, UltraStarknetZKFlavor, UltraZKFlavor, UltraRollupFlavor>;
19#else
20template <typename T>
22#endif
23template <typename T>
25
26template <typename T>
27concept IsMegaFlavor = IsAnyOf<T, MegaFlavor, MegaZKFlavor, MegaAvmFlavor,
28 MegaRecursiveFlavor_<UltraCircuitBuilder>,
29 MegaRecursiveFlavor_<MegaCircuitBuilder>,
30 MegaAvmRecursiveFlavor_<UltraCircuitBuilder>,
31 MegaZKRecursiveFlavor_<MegaCircuitBuilder>,
32 MegaZKRecursiveFlavor_<UltraCircuitBuilder>>;
33
34template <typename T>
36
37// Whether the Flavor has randomness at the end of its trace to randomise commitments and evaluations of its polynomials
38// hence requiring an adjustment to the round univariates via the RowDisablingPolynomial.
39// This is not the case for Translator, where randomness resides in different parts of the trace and the locations will
40// be reflected via Translator relations.
42
43template <typename T>
45
46template <typename T>
48 UltraRecursiveFlavor_<MegaCircuitBuilder>,
49 UltraZKRecursiveFlavor_<UltraCircuitBuilder>,
50 UltraZKRecursiveFlavor_<MegaCircuitBuilder>,
51 UltraRollupRecursiveFlavor_<UltraCircuitBuilder>,
52 MegaRecursiveFlavor_<UltraCircuitBuilder>,
53 MegaRecursiveFlavor_<MegaCircuitBuilder>,
54 MegaZKRecursiveFlavor_<MegaCircuitBuilder>,
55 MegaZKRecursiveFlavor_<UltraCircuitBuilder>,
56 MegaAvmRecursiveFlavor_<UltraCircuitBuilder>,
57 TranslatorRecursiveFlavor,
58 ECCVMRecursiveFlavor,
59 MultilinearBatchingRecursiveFlavor,
60 avm2::AvmRecursiveFlavor>;
61
62template <typename T>
64
65template <typename T>
67
68// This concept is relevant for the Sumcheck Prover, where the logic differs between BN254 and Grumpkin
70template <typename Container, typename Element>
71inline std::string flavor_get_label(Container&& container, const Element& element) {
72 for (auto [label, data] : zip_view(container.get_labels(), container.get_all())) {
73 if (&data == &element) {
74 return label;
75 }
76 }
77 return "(unknown label)";
78}
79
80// clang-format on
81} // namespace bb
Test whether a type T lies in a list of types ...U.
const std::vector< MemoryValue > data
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
std::string flavor_get_label(Container &&container, const Element &element)
Curve::Element Element