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 (FrCodec::calc_num_fields<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
45
54template <typename FF>
55static void shift_translation_masking_term_eval(const FF& evaluation_challenge_x, FF& translation_masking_term_eval)
56{
57 // This method is only invoked within Goblin, which runs ECCVM with a fixed size.
58 static constexpr size_t LOG_MASKING_OFFSET = numeric::get_msb(NUM_DISABLED_ROWS_IN_SUMCHECK);
59 static_assert(1UL << LOG_MASKING_OFFSET == NUM_DISABLED_ROWS_IN_SUMCHECK, "MASKING_OFFSET must be a power of 2");
60
61 FF x_to_num_disabled_rows = evaluation_challenge_x;
62 for (size_t idx = 0; idx < LOG_MASKING_OFFSET; idx++) {
63 x_to_num_disabled_rows = x_to_num_disabled_rows.sqr();
64 }
65
66 FF x_to_circuit_size = x_to_num_disabled_rows;
67
68 for (size_t idx = LOG_MASKING_OFFSET; idx < CONST_ECCVM_LOG_N; idx++) {
69 x_to_circuit_size = x_to_circuit_size.sqr();
70 }
71
72 // Update `translation_masking_term_eval`
73 translation_masking_term_eval *= x_to_circuit_size;
74 translation_masking_term_eval *= x_to_num_disabled_rows.invert();
75};
76} // 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.
Definition api.hpp:5
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
Data passed from ECCVM Verifier to Translator Verifier for verification.
MSGPACK_FIELDS(evaluation_challenge_x, batching_challenge_v, accumulated_result)
constexpr field invert() const noexcept
BB_INLINE constexpr field sqr() const noexcept