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,
28 MegaRecursiveFlavor_<UltraCircuitBuilder>,
29 MegaRecursiveFlavor_<MegaCircuitBuilder>,
30 MegaZKRecursiveFlavor_<MegaCircuitBuilder>,
31 MegaZKRecursiveFlavor_<UltraCircuitBuilder>>;
32
33template <typename T>
35
36// Whether the Flavor has randomness at the end of its trace to randomise commitments and evaluations of its polynomials
37// hence requiring an adjustment to the round univariates via the RowDisablingPolynomial.
38// This is not the case for Translator, where randomness resides in different parts of the trace and the locations will
39// be reflected via Translator relations.
41
42template <typename T>
44
45template <typename T>
47 UltraRecursiveFlavor_<MegaCircuitBuilder>,
48 UltraZKRecursiveFlavor_<UltraCircuitBuilder>,
49 UltraZKRecursiveFlavor_<MegaCircuitBuilder>,
50 UltraRollupRecursiveFlavor_<UltraCircuitBuilder>,
51 MegaRecursiveFlavor_<UltraCircuitBuilder>,
52 MegaRecursiveFlavor_<MegaCircuitBuilder>,
53 MegaZKRecursiveFlavor_<MegaCircuitBuilder>,
54 MegaZKRecursiveFlavor_<UltraCircuitBuilder>,
55 TranslatorRecursiveFlavor,
56 ECCVMRecursiveFlavor,
57 AvmRecursiveFlavor,
58 avm2::AvmRecursiveFlavor>;
59
60template <typename T>
62
63// This concept is relevant for the Sumcheck Prover, where the logic differs between BN254 and Grumpkin
65template <typename Container, typename Element>
66inline std::string flavor_get_label(Container&& container, const Element& element) {
67 for (auto [label, data] : zip_view(container.get_labels(), container.get_all())) {
68 if (&data == &element) {
69 return label;
70 }
71 }
72 return "(unknown label)";
73}
74
75// clang-format on
76} // namespace bb
Test whether a type T lies in a list of types ...U.
const std::vector< FF > data
Entry point for Barretenberg command-line interface.
std::string flavor_get_label(Container &&container, const Element &element)
Curve::Element Element