6#include "gtest/gtest.h"
20 using Builder = RecursiveFlavor::CircuitBuilder;
60 if (challenge_lhs != challenge_rhs) {
61 info(
"Mismatch in the challenges at index ", idx);
66 info(
"Mismatch in the unshifted commitments");
70 info(
"Mismatch in the shifted commitments");
74 info(
"Mismatch in the unshifted evaluations");
78 info(
"Mismatch in the shifted evaluations");
91 instance->polynomials.w_l.at(1) = NativeFF::random_element();
113 auto [folding_proof, folded_accumulator] = folding_prover.
fold(accumulator, incoming_instance);
118 auto [first_sumcheck_native, second_sumcheck_native, folded_verifier_accumulator_native] =
124 auto stdlib_incoming_instance =
129 auto [first_sumcheck_recursive, second_sumcheck_recursive, folded_verifier_accumulator] =
136 EXPECT_EQ(first_sumcheck_recursive, first_sumcheck_native);
137 EXPECT_TRUE(second_sumcheck_recursive);
138 EXPECT_EQ(second_sumcheck_recursive, second_sumcheck_native);
145 test_folding(TamperingMode::None);
151 test_folding(TamperingMode::Instance);
#define BB_DISABLE_ASSERTS()
static void SetUpTestSuite()
NativeFlavor::VerificationKey NativeVerificationKey
static void tampering(std::shared_ptr< ProverInstance > &instance, const TamperingMode &mode)
NativeFlavor::FF NativeFF
static std::shared_ptr< ProverInstance > generate_new_instance(size_t log_num_gates=4)
RecursiveHypernovaVerifier::Flavor RecursiveFlavor
RecursiveHypernovaVerifier::VerifierInstance RecursiveVerifierInstance
static void test_folding(const TamperingMode &mode)
NativeHypernovaVerifier::VerifierInstance NativeVerifierInstance
NativeHypernovaVerifier::Flavor NativeFlavor
RecursiveFlavor::CircuitBuilder Builder
static bool compare_prover_verifier_accumulators(const NativeProverAccumulator &lhs, const NativeVerifierAccumulator &rhs)
RecursiveHypernovaVerifier::Proof RecursiveProof
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
MultilinearBatchingProverClaim Accumulator
std::pair< HonkProof, Accumulator > fold(const Accumulator &accumulator, const std::shared_ptr< ProverInstance > &instance)
Fold an instance into an accumulator. Folding happens in place.
ProverInstance_< Flavor > ProverInstance
Accumulator instance_to_accumulator(const std::shared_ptr< ProverInstance > &instance)
Turn an instance into an accumulator by running Sumcheck.
std::tuple< bool, bool, Accumulator > verify_folding_proof(const std::shared_ptr< typename HypernovaFoldingVerifier::VerifierInstance > &instance, const Proof &proof)
Verify folding proof. Return the new accumulator and the results of the two sumchecks.
std::conditional_t< IsRecursiveFlavor< Flavor >, typename HypernovaRecursiveTypes::Proof, typename HypernovaNativeTypes::Proof > Proof
std::conditional_t< IsRecursiveFlavor< Flavor >, typename HypernovaRecursiveTypes::VerifierInstance, typename HypernovaNativeTypes::VerifierInstance > VerifierInstance
Flavor::Transcript Transcript
MultilinearBatchingVerifierClaim< Curve > Accumulator
static void add_arithmetic_gates_with_public_inputs(Builder &builder, const size_t num_gates=4)
Add a specified number of arithmetic gates (with public inputs) to the provided circuit.
static void add_lookup_gates(Builder &builder, size_t num_iterations=1)
Add lookup gates using the uint32 XOR lookup table (table size 4096)
static void add_arithmetic_gates(Builder &builder, const size_t num_gates=4)
Add a specified number of arithmetic gates to the provided circuit.
A ProverInstance is normally constructed from a finalized circuit and it contains all the information...
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
Entry point for Barretenberg command-line interface.
TEST_F(IPATest, ChallengesAreZero)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
FF non_shifted_evaluation
std::vector< FF > challenge
Commitment shifted_commitment
Commitment non_shifted_commitment
Commitment non_shifted_commitment
Commitment shifted_commitment
std::vector< FF > challenge
FF non_shifted_evaluation