Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
public_inputs_trace.cpp
Go to the documentation of this file.
2
5
6namespace bb::avm2::tracegen {
7
18{
19 using C = Column;
20
21 auto cols = public_inputs.to_columns();
22
23 trace.reserve_column(C::public_inputs_cols_0_, AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH);
24 trace.reserve_column(C::public_inputs_cols_1_, AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH);
25 trace.reserve_column(C::public_inputs_cols_2_, AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH);
26 trace.reserve_column(C::public_inputs_cols_3_, AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH);
27
28 for (uint32_t row = 0; row < AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH; row++) {
29 trace.set(C::public_inputs_cols_0_, row, cols[0][row]);
30 trace.set(C::public_inputs_cols_1_, row, cols[1][row]);
31 trace.set(C::public_inputs_cols_2_, row, cols[2][row]);
32 trace.set(C::public_inputs_cols_3_, row, cols[3][row]);
33 }
34}
35
39
49{
50 using C = Column;
51
52 // sel is precomputed to be 1 for rows [0, AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH)
53 trace.reserve_column(C::public_inputs_sel, AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH);
54 for (uint32_t row = 0; row < AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH; row++) {
55 trace.set(C::public_inputs_sel, row, 1);
56 }
57}
58
59} // namespace bb::avm2::tracegen
#define AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH
void process_public_inputs(TraceContainer &trace, const PublicInputs &public_inputs)
Populate the public inputs trace columns from the given public inputs.
void process_public_inputs_aux_precomputed(TraceContainer &trace)
Populate the auxiliary precomputed selector for the public inputs subtrace.
TestTraceContainer trace
constexpr uint32_t PRECOMPUTED_TRACE_SIZE
std::vector< std::vector< FF > > to_columns() const
Serialization to columns.
Definition avm_io.cpp:142