Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
translation_evaluations.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
12
13namespace bb {
20template <typename BF> struct TranslationEvaluations_ {
21 BF op, Px, Py, z1, z2;
22 static size_t size() { return field_conversion::calc_num_bn254_frs<BF>() * NUM_TRANSLATION_EVALUATIONS; }
23
25
26 std::array<std::string, NUM_TRANSLATION_EVALUATIONS> labels = {
27 "Translation:op", "Translation:Px", "Translation:Py", "Translation:z1", "Translation:z2"
28 };
29 ;
30
32};
33
42template <typename FF>
43static void shift_translation_masking_term_eval(const FF& evaluation_challenge_x, FF& translation_masking_term_eval)
44{
45 // This method is only invoked within Goblin, which runs ECCVM with a fixed size.
46 static constexpr size_t LOG_MASKING_OFFSET = numeric::get_msb(NUM_DISABLED_ROWS_IN_SUMCHECK);
47 static_assert(1UL << LOG_MASKING_OFFSET == NUM_DISABLED_ROWS_IN_SUMCHECK, "MASKING_OFFSET must be a power of 2");
48
49 FF x_to_num_disabled_rows = evaluation_challenge_x;
50 for (size_t idx = 0; idx < LOG_MASKING_OFFSET; idx++) {
51 x_to_num_disabled_rows = x_to_num_disabled_rows.sqr();
52 }
53
54 FF x_to_circuit_size = x_to_num_disabled_rows;
55
56 for (size_t idx = LOG_MASKING_OFFSET; idx < CONST_ECCVM_LOG_N; idx++) {
57 x_to_circuit_size = x_to_circuit_size.sqr();
58 }
59
60 // Update `translation_masking_term_eval`
61 translation_masking_term_eval *= x_to_circuit_size;
62 translation_masking_term_eval *= x_to_num_disabled_rows.invert();
63};
64} // namespace bb
A template class for a reference array. Behaves as if std::array<T&, N> was possible.
Definition ref_array.hpp:22
constexpr T get_msb(const T in)
Definition get_msb.hpp:47
Entry point for Barretenberg command-line interface.
typename Flavor::FF FF
Stores the evaluations of op, Px, Py, z1, and z2 computed by the ECCVM Prover. These evaluations are ...
MSGPACK_FIELDS(op, Px, Py, z1, z2)
RefArray< BF, NUM_TRANSLATION_EVALUATIONS > get_all()
std::array< std::string, NUM_TRANSLATION_EVALUATIONS > labels
constexpr field invert() const noexcept
BB_INLINE constexpr field sqr() const noexcept