Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
evaluation_domain.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
10#include <vector>
11
12namespace bb {
13
14template <typename FF> class EvaluationDomain {
15 public:
17 : size(0)
18 , num_threads(0)
19 , thread_size(0)
20 , log2_size(0)
24 , root(FF::zero())
25 , root_inverse(FF::zero())
26 , domain(FF::zero())
27 , domain_inverse(FF::zero())
28 , generator(FF::zero())
29 , generator_inverse(FF::zero())
30 , four_inverse(FF::zero())
31 , roots(nullptr) {};
32
33 EvaluationDomain(const size_t domain_size, const size_t target_generator_size = 0);
36
39
41
43 void compute_generator_table(const size_t target_generator_size);
44
45 const std::vector<FF*>& get_round_roots() const { return round_roots; };
46 const std::vector<FF*>& get_inverse_round_roots() const { return inverse_round_roots; }
47
48 size_t size; // n, always a power of 2
49 size_t num_threads; // num_threads * thread_size = size
51 size_t log2_size;
55
56 FF root; // omega; the nth root of unity
57 FF root_inverse; // omega^{-1}
58 FF domain; // n; same as size
59 FF domain_inverse; // n^{-1}
63
64 private:
65 std::vector<FF*> round_roots; // An entry for each of the log(n) rounds: each entry is a pointer to
66 // the subset of the roots of unity required for that fft round.
67 // E.g. round_roots[0] = [1, ω^(n/2 - 1)],
68 // round_roots[1] = [1, ω^(n/4 - 1), ω^(n/2 - 1), ω^(3n/4 - 1)]
69 // ...
70 std::vector<FF*> inverse_round_roots;
71
72 std::shared_ptr<FF[]> roots;
73};
74
75// add alias for compatibility
77} // namespace bb
void compute_generator_table(const size_t target_generator_size)
const std::vector< FF * > & get_round_roots() const
std::vector< FF * > inverse_round_roots
const std::vector< FF * > & get_inverse_round_roots() const
std::vector< FF * > round_roots
EvaluationDomain & operator=(const EvaluationDomain &)=delete
std::shared_ptr< FF[]> roots
Entry point for Barretenberg command-line interface.
typename Flavor::FF FF