25 const BF& batching_challenge_v,
29 const auto compute_four_limbs = [](
const auto& in) {
31 return std::array<FF, 4>{ in.slice(0, NUM_LIMB_BITS),
32 in.slice(NUM_LIMB_BITS, NUM_LIMB_BITS * 2),
33 in.slice(NUM_LIMB_BITS * 2, NUM_LIMB_BITS * 3),
34 in.slice(NUM_LIMB_BITS * 3, NUM_LIMB_BITS * 4) };
37 const auto compute_five_limbs = [](
const auto& in) {
40 in.slice(NUM_LIMB_BITS, NUM_LIMB_BITS * 2),
41 in.slice(NUM_LIMB_BITS * 2, NUM_LIMB_BITS * 3),
42 in.slice(NUM_LIMB_BITS * 3, NUM_LIMB_BITS * 4),
49 for (
size_t i = 0; i < 4; i++) {
62 const BF& batching_challenge_v)
68 using ClaimBatch = ClaimBatcher::Batch;
69 using InterleavedBatch = ClaimBatcher::InterleavedBatch;
78 transcript->add_to_hash_buffer(
"vk_hash", vk_hash);
79 vinfo(
"Translator vk hash in verifier: ", vk_hash);
84 const BF accumulated_result =
transcript->template receive_from_prover<BF>(
"accumulated_result");
89 for (
auto [comm, label] :
zip_view(commitments.get_wires_and_ordered_range_constraints(),
91 comm =
transcript->template receive_from_prover<Commitment>(label);
93 op_queue_commitments = { commitments.op, commitments.x_lo_y_hi, commitments.x_hi_z_1, commitments.y_lo_z_2 };
96 FF beta =
transcript->template get_challenge<FF>(
"beta");
97 FF gamma =
transcript->template get_challenge<FF>(
"gamma");
103 commitments.z_perm =
transcript->template receive_from_prover<Commitment>(commitment_labels.z_perm);
107 const FF alpha =
transcript->template get_challenge<FF>(
"Sumcheck:alpha");
113 for (
size_t idx = 0; idx < gate_challenges.size(); idx++) {
119 libra_commitments[0] =
transcript->template receive_from_prover<Commitment>(
"Libra:concatenation_commitment");
122 std::ranges::fill(padding_indicator_array,
FF{ 1 });
124 auto sumcheck_output = sumcheck.verify(
relation_parameters, gate_challenges, padding_indicator_array);
127 if (!sumcheck_output.verified) {
131 libra_commitments[1] =
transcript->template receive_from_prover<Commitment>(
"Libra:grand_sum_commitment");
132 libra_commitments[2] =
transcript->template receive_from_prover<Commitment>(
"Libra:quotient_commitment");
135 bool consistency_checked =
false;
136 ClaimBatcher claim_batcher{
137 .unshifted = ClaimBatch{ commitments.get_unshifted_without_interleaved(),
138 sumcheck_output.claimed_evaluations.get_unshifted_without_interleaved() },
139 .shifted = ClaimBatch{ commitments.get_to_be_shifted(), sumcheck_output.claimed_evaluations.get_shifted() },
140 .interleaved = InterleavedBatch{ .commitments_groups = commitments.get_groups_to_be_interleaved(),
141 .evaluations = sumcheck_output.claimed_evaluations.get_interleaved() }
144 Shplemini::compute_batch_opening_claim(padding_indicator_array,
146 sumcheck_output.challenge,
151 &consistency_checked,
153 sumcheck_output.claimed_libra_evaluation);
154 const auto pairing_points = PCS::reduce_verify_batch_opening_claim(opening_claim,
transcript);
157 auto verified = pcs_vkey.pairing_check(pairing_points[0], pairing_points[1]);
158 return verified && consistency_checked;
162 const BF& translation_masking_term_eval)
164 const auto reconstruct_from_array = [&](
const auto& arr) {
166 const BF elt_1 = (
static_cast<uint256_t>(arr[1]) << 68);
167 const BF elt_2 = (
static_cast<uint256_t>(arr[2]) << 136);
168 const BF elt_3 = (
static_cast<uint256_t>(arr[3]) << 204);
169 const BF reconstructed = elt_0 + elt_1 + elt_2 + elt_3;
170 return reconstructed;
173 const auto& reconstruct_value_from_eccvm_evaluations = [&](
const TranslationEvaluations& translation_evaluations,
181 const BF& op = translation_evaluations.
op;
182 const BF& Px = translation_evaluations.
Px;
183 const BF& Py = translation_evaluations.
Py;
184 const BF& z1 = translation_evaluations.
z1;
185 const BF& z2 = translation_evaluations.
z2;
187 const BF eccvm_opening = (op + (v1 * Px) + (v2 * Py) + (v3 * z1) + (v4 * z2)) - translation_masking_term_eval;
189 return x * accumulated_result == eccvm_opening;
192 bool is_value_reconstructed =
194 return is_value_reconstructed;