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 {
8// clang-format off
9
10#ifdef STARKNET_GARAGA_FLAVORS
11template <typename T>
12concept IsUltraHonk = IsAnyOf<T, UltraFlavor, UltraKeccakFlavor, UltraStarknetFlavor, UltraKeccakZKFlavor, UltraStarknetZKFlavor, UltraZKFlavor>;
13#else
14template <typename T>
16#endif
17template <typename T>
19
20template <typename T>
21concept IsMegaFlavor = IsAnyOf<T, MegaFlavor, MegaZKFlavor, MegaAvmFlavor,
22 MegaRecursiveFlavor_<UltraCircuitBuilder>,
23 MegaRecursiveFlavor_<MegaCircuitBuilder>,
24 MegaAvmRecursiveFlavor_<UltraCircuitBuilder>,
25 MegaZKRecursiveFlavor_<MegaCircuitBuilder>,
26 MegaZKRecursiveFlavor_<UltraCircuitBuilder>>;
27
28template <typename T>
30
31// Whether the Flavor has randomness at the end of its trace to randomise commitments and evaluations of its polynomials
32// hence requiring an adjustment to the round univariates via the RowDisablingPolynomial.
33// This is not the case for Translator, where randomness resides in different parts of the trace and the locations will
34// be reflected via Translator relations.
36template <typename T> concept UseRowDisablingPolynomial = !IsTranslatorFlavor<T>;
37
38
39
40template <typename T>
42 UltraRecursiveFlavor_<MegaCircuitBuilder>,
43 UltraZKRecursiveFlavor_<UltraCircuitBuilder>,
44 UltraZKRecursiveFlavor_<MegaCircuitBuilder>,
45 MegaRecursiveFlavor_<UltraCircuitBuilder>,
46 MegaRecursiveFlavor_<MegaCircuitBuilder>,
47 MegaZKRecursiveFlavor_<MegaCircuitBuilder>,
48 MegaZKRecursiveFlavor_<UltraCircuitBuilder>,
49 MegaAvmRecursiveFlavor_<UltraCircuitBuilder>,
50 TranslatorRecursiveFlavor,
51 ECCVMRecursiveFlavor,
52 MultilinearBatchingRecursiveFlavor,
53 avm2::AvmRecursiveFlavor>;
54
55template <typename T>
57
58template <typename T>
60
61// This concept is relevant for the Sumcheck Prover, where the logic differs between BN254 and Grumpkin
63template <typename Container, typename Element>
64inline std::string flavor_get_label(Container&& container, const Element& element) {
65 for (auto [label, data] : zip_view(container.get_labels(), container.get_all())) {
66 if (&data == &element) {
67 return label;
68 }
69 }
70 return "(unknown label)";
71}
72
73// clang-format on
74} // namespace bb
const std::vector< MemoryValue > data
bb::curve::BN254::Element Element
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
std::string flavor_get_label(Container &&container, const Element &element)