Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <ram_table.hpp>
Public Member Functions | |
ram_table () | |
ram_table (Builder *builder, const size_t table_size) | |
Construct a new ram table<Builder>::ram table object. It's dynamic memory! | |
ram_table (const std::vector< field_pt > &table_entries) | |
Construct a new ram table<Builder>::ram table object. It's dynamic memory! | |
ram_table (const ram_table &other) | |
Construct a new ram table<Builder>::ram table object. | |
ram_table (ram_table &&other) | |
Construct a new ram table<Builder>::ram table object. | |
void | initialize_table () const |
internal method, is used to call Builder methods that will generate RAM table. | |
ram_table & | operator= (const ram_table &other) |
Copy assignment operator. | |
ram_table & | operator= (ram_table &&other) |
Move assignment operator. | |
field_pt | read (const field_pt &index) const |
Read a field element from the RAM table at an index value. | |
void | write (const field_pt &index, const field_pt &value) |
Write a field element from the RAM table at an index value. | |
size_t | size () const |
Builder * | get_context () const |
bool | check_indices_initialized () const |
Private Types | |
typedef field_t< Builder > | field_pt |
Private Attributes | |
std::vector< field_pt > | _raw_entries |
std::vector< OriginTag > | _tags |
std::vector< bool > | _index_initialized |
size_t | _length = 0 |
size_t | _ram_id = 0 |
bool | _ram_table_generated_in_builder = false |
bool | _all_entries_written_to_with_constant_index = false |
Builder * | _context = nullptr |
Definition at line 16 of file ram_table.hpp.
|
private |
Definition at line 18 of file ram_table.hpp.
|
inline |
Definition at line 21 of file ram_table.hpp.
bb::stdlib::ram_table< Builder >::ram_table | ( | Builder * | builder, |
const size_t | table_size | ||
) |
Construct a new ram table<Builder>::ram table object. It's dynamic memory!
Builder |
table_entries | vector of field elements that will initialize the RAM table |
Definition at line 23 of file ram_table.cpp.
bb::stdlib::ram_table< Builder >::ram_table | ( | const std::vector< field_pt > & | table_entries | ) |
Construct a new ram table<Builder>::ram table object. It's dynamic memory!
Builder |
table_entries | vector of field elements that will initialize the RAM table |
Definition at line 45 of file ram_table.cpp.
bb::stdlib::ram_table< Builder >::ram_table | ( | const ram_table< Builder > & | other | ) |
Construct a new ram table<Builder>::ram table object.
Builder |
other |
Definition at line 123 of file ram_table.cpp.
bb::stdlib::ram_table< Builder >::ram_table | ( | ram_table< Builder > && | other | ) |
Construct a new ram table<Builder>::ram table object.
Builder |
other |
Definition at line 141 of file ram_table.cpp.
|
inline |
Definition at line 40 of file ram_table.hpp.
|
inline |
Definition at line 38 of file ram_table.hpp.
void bb::stdlib::ram_table< Builder >::initialize_table | ( | ) | const |
internal method, is used to call Builder methods that will generate RAM table.
initialize the table once we perform a read. This ensures we always have a pointer to a Builder. (if both the table entries and the index are constant, we don't need a builder as we can directly extract the desired value fram _raw_entries
)
Builder |
Definition at line 82 of file ram_table.cpp.
ram_table< Builder > & bb::stdlib::ram_table< Builder >::operator= | ( | const ram_table< Builder > & | other | ) |
Copy assignment operator.
Builder |
other |
Definition at line 159 of file ram_table.cpp.
ram_table< Builder > & bb::stdlib::ram_table< Builder >::operator= | ( | ram_table< Builder > && | other | ) |
Move assignment operator.
Builder |
other |
Definition at line 180 of file ram_table.cpp.
field_t< Builder > bb::stdlib::ram_table< Builder >::read | ( | const field_pt & | index | ) | const |
Read a field element from the RAM table at an index value.
Builder |
index |
Definition at line 200 of file ram_table.cpp.
|
inline |
Definition at line 36 of file ram_table.hpp.
void bb::stdlib::ram_table< Builder >::write | ( | const field_pt & | index, |
const field_pt & | value | ||
) |
Write a field element from the RAM table at an index value.
Builder |
index | |
value |
Definition at line 244 of file ram_table.cpp.
|
mutableprivate |
Definition at line 64 of file ram_table.hpp.
|
mutableprivate |
Definition at line 65 of file ram_table.hpp.
|
mutableprivate |
Definition at line 60 of file ram_table.hpp.
|
private |
Definition at line 61 of file ram_table.hpp.
|
mutableprivate |
Definition at line 62 of file ram_table.hpp.
|
mutableprivate |
Definition at line 63 of file ram_table.hpp.
|
private |
Definition at line 57 of file ram_table.hpp.
|
mutableprivate |
Definition at line 59 of file ram_table.hpp.