38 using FF =
typename InnerFlavor::FF;
39 static constexpr size_t FIRST_WITNESS_INDEX = InnerFlavor::NUM_PRECOMPUTED_ENTITIES;
43 const auto num_public_inputs = inner_prover.prover_instance->num_public_inputs();
45 InnerFlavor::USE_PADDING ? CONST_PROOF_SIZE_LOG_N : inner_prover.prover_instance->log_dyadic_size();
46 structured_proof.deserialize(inner_prover.transcript->test_get_proof_data(), num_public_inputs, log_n);
53 structured_proof.sumcheck_univariates[0].value_at(0) += delta;
54 structured_proof.sumcheck_univariates[0].value_at(1) -= delta;
64 structured_proof.gemini_fold_comms[0] = structured_proof.gemini_fold_comms[0] *
FF::random_element();
65 structured_proof.gemini_fold_evals[0] =
FF::zero();
72 structured_proof.serialize(inner_prover.transcript->test_get_proof_data(), log_n);
73 inner_prover.transcript->test_set_proof_parsing_state(
74 0, compute_proof_length_for_export<InnerFlavor>(num_public_inputs, log_n));
75 inner_proof = inner_prover.export_proof();
86 using Commitment =
typename InnerFlavor::Curve::AffineElement;
87 using FF =
typename InnerFlavor::FF;
88 using Codec =
typename InnerFlavor::Transcript::Codec;
90 static constexpr size_t NUM_FRS_PER_COMMITMENT = Codec::template calc_num_fields<Commitment>();
94 size_t offset = inner_proof.size() - NUM_FRS_PER_COMMITMENT;
95 auto element_span = std::span{ inner_proof }.subspan(
offset, NUM_FRS_PER_COMMITMENT);
96 auto commitment = Codec::template deserialize_from_fields<Commitment>(element_span);
97 commitment = commitment *
FF(2);
98 auto serialized = Codec::serialize_to_fields(commitment);
103 static constexpr size_t NUM_FRS = Codec::template calc_num_fields<PP>();
105 if (inner_proof.size() >= NUM_FRS) {
106 auto pp_span = std::span{ inner_proof }.subspan(0, NUM_FRS);
107 PP pairing_points = Codec::template deserialize_from_fields<PP>(pp_span);
108 pairing_points.P0() = pairing_points.P0() + Commitment::one();
109 auto serialized = Codec::serialize_to_fields(pairing_points);
110 std::copy(serialized.begin(), serialized.end(), inner_proof.begin());
void tamper_with_proof(InnerProver &inner_prover, ProofType &inner_proof, TamperType type)
Test method that provides several ways to tamper with a proof. TODO(https://github....