Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
eccvm_test_utils.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <iomanip>
5#include <iostream>
6#include <string>
7
9
11
21inline void print_eccvm_columns(const std::string& test_name,
23 size_t num_rows)
24{
25 auto to_uint = [](const FF& f) -> uint64_t { return static_cast<uint64_t>(f); };
26
27 std::cout << "\n========== " << test_name << " ==========\n";
28 std::cout << "First " << num_rows << " rows of selected columns:\n\n";
29
30 // Print header
31 std::cout << std::setw(4) << "row"
32 << " | " << std::setw(7) << "pre_sel"
33 << " | " << std::setw(7) << "pre_pc"
34 << " | " << std::setw(7) << "pre_rnd"
35 << " | " << std::setw(7) << "pt_tr"
36 << " | " << std::setw(7) << "sc_sum"
37 << " | " << std::setw(7) << "s1hi"
38 << " | " << std::setw(7) << "s1lo"
39 << " | " << std::setw(7) << "skew"
40 << " | " << std::setw(7) << "tx_pc"
41 << " | " << std::setw(7) << "msm_pc"
42 << " | " << std::setw(7) << "tx_mul"
43 << " | " << std::setw(7) << "tx_eq"
44 << "\n";
45 std::cout << std::string(130, '-') << "\n";
46
47 for (size_t i = 0; i < num_rows; i++) {
48 std::cout << std::setw(4) << i << " | " << std::setw(7) << to_uint(polys.precompute_select[i]) << " | "
49 << std::setw(7) << to_uint(polys.precompute_pc[i]) << " | " << std::setw(7)
50 << to_uint(polys.precompute_round[i]) << " | " << std::setw(7)
51 << to_uint(polys.precompute_point_transition[i]) << " | " << std::setw(7)
52 << to_uint(polys.precompute_scalar_sum[i]) << " | " << std::setw(7)
53 << to_uint(polys.precompute_s1hi[i]) << " | " << std::setw(7) << to_uint(polys.precompute_s1lo[i])
54 << " | " << std::setw(7) << to_uint(polys.precompute_skew[i]) << " | " << std::setw(7)
55 << to_uint(polys.transcript_pc[i]) << " | " << std::setw(7) << to_uint(polys.msm_pc[i]) << " | "
56 << std::setw(7) << to_uint(polys.transcript_mul[i]) << " | " << std::setw(7)
57 << to_uint(polys.transcript_eq[i]) << "\n";
58 }
59 std::cout << "\n";
60}
61
71{
73 op_queue->append_hiding_op(Fq::random_element(), Fq::random_element());
74}
75
76} // namespace bb::eccvm_test_utils
A container for the prover polynomials.
typename Curve::ScalarField FF
bb::fq BaseField
Definition bn254.hpp:19
void print_eccvm_columns(const std::string &test_name, const ECCVMFlavor::ProverPolynomials &polys, size_t num_rows)
Print selected ECCVM columns for debugging purposes.
void add_hiding_op_for_test(const std::shared_ptr< ECCOpQueue > &op_queue)
Set a hiding op on the op_queue for testing.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
static field random_element(numeric::RNG *engine=nullptr) noexcept