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>;
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
43
44
45template <typename T>
47 UltraRecursiveFlavor_<MegaCircuitBuilder>,
48 UltraZKRecursiveFlavor_<UltraCircuitBuilder>,
49 UltraZKRecursiveFlavor_<MegaCircuitBuilder>,
50 MegaRecursiveFlavor_<UltraCircuitBuilder>,
51 MegaRecursiveFlavor_<MegaCircuitBuilder>,
52 MegaZKRecursiveFlavor_<MegaCircuitBuilder>,
53 MegaZKRecursiveFlavor_<UltraCircuitBuilder>,
54 MegaAvmRecursiveFlavor_<UltraCircuitBuilder>,
55 TranslatorRecursiveFlavor,
56 ECCVMRecursiveFlavor,
57 MultilinearBatchingRecursiveFlavor,
58 avm2::AvmRecursiveFlavor>;
59
60template <typename T>
62
63template <typename T>
65
66// This concept is relevant for the Sumcheck Prover, where the logic differs between BN254 and Grumpkin
68template <typename Container, typename Element>
69inline std::string flavor_get_label(Container&& container, const Element& element) {
70 for (auto [label, data] : zip_view(container.get_labels(), container.get_all())) {
71 if (&data == &element) {
72 return label;
73 }
74 }
75 return "(unknown label)";
76}
77
78// clang-format on
79} // 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