15#include <gtest/gtest.h>
24template <
typename VK>
auto compute_stdlib_vk_hash(
const VK&
vk)
26 using FF =
typename VK::FF;
27 using Builder =
typename VK::Builder;
30 auto serialize_to_field_buffer = []<
typename T>(
const T& input, std::vector<FF>&
buffer) {
31 std::vector<FF> input_fields = Codec::template serialize_to_fields<T>(input);
32 buffer.insert(
buffer.end(), input_fields.begin(), input_fields.end());
35 std::vector<FF> elements;
36 serialize_to_field_buffer(
vk.log_circuit_size, elements);
37 serialize_to_field_buffer(
vk.num_public_inputs, elements);
38 serialize_to_field_buffer(
vk.pub_inputs_offset, elements);
40 for (
const auto& commitment :
vk.get_all()) {
41 serialize_to_field_buffer(commitment, elements);
56using FlavorTypes = testing::Types<UltraRecursiveFlavor_<UltraCircuitBuilder>,
71 using NativeFlavor =
typename Flavor::NativeFlavor;
72 using NativeVerificationKey =
typename NativeFlavor::VerificationKey;
80 if constexpr (IsAnyOf<Flavor, TranslatorRecursiveFlavor, ECCVMRecursiveFlavor>) {
84 using InnerBuilder =
typename NativeFlavor::CircuitBuilder;
87 if constexpr (HasIPAAccumulator<NativeFlavor>) {
96 OuterBuilder outer_builder;
97 StdlibVerificationKey
vk(&outer_builder, native_vk);
100 FF vk_hash_1 = compute_stdlib_vk_hash(
vk);
104 if constexpr (!IsAnyOf<Flavor, TranslatorRecursiveFlavor, ECCVMRecursiveFlavor>) {
106 FF vk_hash_2 =
vk.hash_with_origin_tagging(transcript);
107 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...
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
ECCVMCircuitBuilder CircuitBuilder
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 of the native Translator flavor.
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(ShpleminiTest, TestSettings)
TYPED_TEST(ShpleminiTest, CorrectnessOfMultivariateClaimBatching)
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept