13#include <gtest/gtest.h>
22template <
typename VK>
auto compute_stdlib_vk_hash(
const VK&
vk)
24 using FF =
typename VK::FF;
25 using Builder =
typename VK::Builder;
28 auto serialize_to_field_buffer = []<
typename T>(
const T& input, std::vector<FF>&
buffer) {
29 std::vector<FF> input_fields = Codec::template serialize_to_fields<T>(input);
30 buffer.insert(
buffer.end(), input_fields.begin(), input_fields.end());
33 std::vector<FF> elements;
34 serialize_to_field_buffer(
vk.log_circuit_size, elements);
35 serialize_to_field_buffer(
vk.num_public_inputs, elements);
36 serialize_to_field_buffer(
vk.pub_inputs_offset, elements);
38 for (
const auto& commitment :
vk.get_all()) {
39 serialize_to_field_buffer(commitment, elements);
54using FlavorTypes = testing::Types<UltraRecursiveFlavor_<UltraCircuitBuilder>,
67 using NativeFlavor =
typename Flavor::NativeFlavor;
68 using NativeVerificationKey =
typename NativeFlavor::VerificationKey;
77 using InnerBuilder =
typename NativeFlavor::CircuitBuilder;
80 if constexpr (HasIPAAccumulator<NativeFlavor>) {
88 OuterBuilder outer_builder;
89 StdlibVerificationKey
vk(&outer_builder, native_vk);
92 FF vk_hash_1 = compute_stdlib_vk_hash(
vk);
96 FF vk_hash_2 =
vk.hash_with_origin_tagging(transcript);
97 EXPECT_EQ(vk_hash_1.get_value(), vk_hash_2.get_value());
static void SetUpTestSuite()
typename Flavor::NativeFlavor NativeFlavor
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
ECCVMCircuitBuilder CircuitBuilder
FixedVKAndHash_< PrecomputedEntities< Commitment >, BF, ECCVMHardcodedVKAndHash > VerificationKey
The verification key stores commitments to the precomputed polynomials used by the verifier.
BaseTranscript< Codec, HashFunction > Transcript
The recursive counterpart to the "native" Mega flavor.
A ProverInstance is normally constructed from a finalized circuit and it contains all the information...
The recursive counterpart to the "native" Ultra flavor.
The recursive counterpart to the "native" UltraRollupFlavor.
static FF hash(const std::vector< FF > &input)
Hashes a vector of field elements.
static void add_default(Builder &builder)
Add default public inputs when they are not present.
static void add_default(Builder &builder)
Add default public inputs when they are not present.
uint8_t buffer[RANDOM_BUFFER_SIZE]
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
Entry point for Barretenberg command-line interface.
TYPED_TEST_SUITE(CommitmentKeyTest, Curves)
TYPED_TEST(CommitmentKeyTest, CommitToZeroPoly)
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept